---
title: "Meaning & Key Takeaway of: A non-virtual function says, you have to…"
description: "\"A non-virtual function says, you have to do this and you must do it this way. A virtual function says you have to do this, but you don't have to do it ..."
image: "https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png"
---

#  A non-virtual function says, you have to do this and you…

![“A non-virtual function says, you have to do this and you must do it this way. A virtual function says you have to do this, but you don't have to do it this way. That's their fundamental difference.” quote by Scott Meyers](https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png)   [Download](https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png) [Open image](https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png)

> “A non-virtual function says, you have to do this and you must do it this way. A virtual function says you have to do this, but you don't have to do it this way. That's their fundamental difference.”

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

Non‑virtual functions enforce a specific implementation; virtual functions enforce an interface while allowing varied implementations.

**In simple terms:** Non‑virtual fixes code; virtual allows flexibility.

Key Takeaway

Choose virtual when behavior may vary.

Themes

programming design polymorphism

Mood

technical analytical

Type

educational technical

When to use this quote

- software design
- API design
- framework development

Key Concepts

encapsulation inheritance interface

Questions to Reflect On

- When should you prioritize flexibility over performance?
- Do you need to change implementations later?

A Different Perspective

Virtual functions can introduce runtime overhead.

★ ★ ★ ★ ★   No ratings yet

[Difference](https://sms4smile.com/quotes/about/difference/) [Differences](https://sms4smile.com/quotes/about/differences/) [Virtual reality](https://sms4smile.com/quotes/about/virtual-reality/)

## Related quotes

> [The telephone is virtual reality in that you can meet with someone as if you are together, at least for the auditory sense.](https://sms4smile.com/quotes/ray-kurzweil/the-telephone-is-virtual-reality-in-that-you-can-meet-with-someone-as/)

[Ray Kurzweil](https://sms4smile.com/quotes/author/ray-kurzweil/)

> [We don't need virtual reality, we need virtual unreality.](https://sms4smile.com/quotes/peter-greenaway/we-don-t-need-virtual-reality-we-need-virtual-unreality/)

[Peter Greenaway](https://sms4smile.com/quotes/author/peter-greenaway/)

> [A good story needs conflict, and virtual reality is a great hypothetical way to create conflict. ... In some ways, the future is going…](https://sms4smile.com/quotes/palmer-luckey/a-good-story-needs-conflict-and-virtual-reality-is-a-great/)

[Palmer Luckey](https://sms4smile.com/quotes/author/palmer-luckey/)

> [Virtual Reality is really a new communication platform. By feeling truly present, you can share unbounded spaces and experiences with the people in your…](https://sms4smile.com/quotes/mark-zuckerberg/virtual-reality-is-really-a-new-communication-platform-by-feeling/)

[Mark Zuckerberg](https://sms4smile.com/quotes/author/mark-zuckerberg/)

> [“Immersive tech like virtual reality inspires such rich emotions that it’s ripe for abuse. It’s still in its infancy, though, so it’s too soon…](https://sms4smile.com/quotes/adam-alter/immersive-tech-like-virtual-reality-inspires-such-rich-emotions-that/)

[Adam Alter](https://sms4smile.com/quotes/author/adam-alter/)

> [“You slept and went to the dream world, it was wonderful and then you woke up and found yourself in the nightmare world! If…](https://sms4smile.com/quotes/mehmet-murat-ildan/you-slept-and-went-to-the-dream-world-it-was-wonderful-and-then-you/)

[Mehmet Murat ildan](https://sms4smile.com/quotes/author/mehmet-murat-ildan/)

> [Virtual reality is a truly immersive medium and the level of graphics, already quite strong, will only continue to get better and better. You…](https://sms4smile.com/quotes/brett-leonard/virtual-reality-is-a-truly-immersive-medium-and-the-level-of-graphics/)

[Brett Leonard](https://sms4smile.com/quotes/author/brett-leonard/)

> [Virtual reality, to me, seems to have a number of different tiers. Entry-level-tier VR is this experience: on a phone, some simple head-tracking, and…](https://sms4smile.com/quotes/deadmau5/virtual-reality-to-me-seems-to-have-a-number-of-different-tiers-entry/)

Deadmau5

> [The simulator is the stage in-between television and virtual reality, a moment, a phase. The simulator is a moment that leads to cyberspace, that…](https://sms4smile.com/quotes/paul-virilio/the-simulator-is-the-stage-in-between-television-and-virtual-reality/)

[Paul Virilio](https://sms4smile.com/quotes/author/paul-virilio/)

> [It would be nice if we could design a virtual reality in Hyperbolic Space, and meet each other there.](https://sms4smile.com/quotes/donald-knuth/it-would-be-nice-if-we-could-design-a-virtual-reality-in-hyperbolic/)

[Donald Knuth](https://sms4smile.com/quotes/author/donald-knuth/)

> [It's not virtual reality until you can be tortured to death in it.](https://sms4smile.com/quotes/andrew-plotkin/it-s-not-virtual-reality-until-you-can-be-tortured-to-death-in-it/)

[Andrew Plotkin](https://sms4smile.com/quotes/author/andrew-plotkin/)

> [The technologies of virtual reality are attempting to make us see from beneath, from inside, from behind... as if we were God.](https://sms4smile.com/quotes/paul-virilio/the-technologies-of-virtual-reality-are-attempting-to-make-us-see/)

[Paul Virilio](https://sms4smile.com/quotes/author/paul-virilio/)

> [I can imagine people actually working in virtual environments where productive, cooperative work is undertaken, and I think we will find people helping others…](https://sms4smile.com/quotes/vinton-cerf/i-can-imagine-people-actually-working-in-virtual-environments-where/)

[Vinton Cerf](https://sms4smile.com/quotes/author/vinton-cerf/)

> [Putting you into a virtual world really allows you to think differently.](https://sms4smile.com/quotes/lisa-su/putting-you-into-a-virtual-world-really-allows-you-to-think/)

[Lisa Su](https://sms4smile.com/quotes/author/lisa-su/)

> [The Internet and virtual reality make it easier for people to stay rooted in their communities and work for companies headquartered elsewhere. The Internet…](https://sms4smile.com/quotes/ro-khanna/the-internet-and-virtual-reality-make-it-easier-for-people-to-stay/)

[Ro Khanna](https://sms4smile.com/quotes/author/ro-khanna/)

## More by Scott Meyers

> [Lightstone's Convolution Principle: The concurrent development of multiple features operating on intersecting componentry will take longer to complete than the sum of the schedule…](https://sms4smile.com/quotes/scott-meyers/lightstone-s-convolution-principle-the-concurrent-development-of/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [Do that, and the best you can hope for is that people will ignore you. More realistically, you'd be skinned alive, or possibly sentenced…](https://sms4smile.com/quotes/scott-meyers/do-that-and-the-best-you-can-hope-for-is-that-people-will-ignore-you/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [Friends, much as in real life, are often more trouble than their worth.](https://sms4smile.com/quotes/scott-meyers/friends-much-as-in-real-life-are-often-more-trouble-than-their-worth/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [“Other than when dealing with exception-unsafe legacy code (which we'll discuss later in this Item), offering no exception safety guarantee should be an option…](https://sms4smile.com/quotes/scott-meyers/other-than-when-dealing-with-exception-unsafe-legacy-code-which-we-ll/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [“That doesn't upset too many people, but the fact that accessibility restrictions don't enter into the picture has caused more than one otherwise pacifistic…](https://sms4smile.com/quotes/scott-meyers/that-doesn-t-upset-too-many-people-but-the-fact-that-accessibility/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [“First we crawl. Later we crawl on broken glass.”](https://sms4smile.com/quotes/scott-meyers/first-we-crawl-later-we-crawl-on-broken-glass/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

> [... the results are undefined, and we all know what 'undefined' means: it means it works during development, it works during testing, and it…](https://sms4smile.com/quotes/scott-meyers/the-results-are-undefined-and-we-all-know-what-undefined-means-it/)

[Scott Meyers](https://sms4smile.com/quotes/author/scott-meyers/)

[Explore all 8 Scott Meyers quotes ](https://sms4smile.com/quotes/author/scott-meyers/)

## More Difference quotes

> [If you stood me in a costume next to a computer graphic of the same-looking character, I think there would be a difference. And…](https://sms4smile.com/quotes/warwick-davis/if-you-stood-me-in-a-costume-next-to-a-computer-graphic-of-the-same/)

[Warwick Davis](https://sms4smile.com/quotes/author/warwick-davis/)

> [There's a difference between delivering real funny and just silly funny.](https://sms4smile.com/quotes/lil-rel-howery/there-s-a-difference-between-delivering-real-funny-and-just-silly/)

[Lil Rel Howery](https://sms4smile.com/quotes/author/lil-rel-howery/)

> [There may be little practical difference between a Ford Mondeo and a BMW three series, but in terms of perceptions of who you are…](https://sms4smile.com/quotes/martin-jacques/there-may-be-little-practical-difference-between-a-ford-mondeo-and-a/)

[Martin Jacques](https://sms4smile.com/quotes/author/martin-jacques/)

> [I really think there's no difference between an art piece made by a man and one made by a woman. Is it a good…](https://sms4smile.com/quotes/marina-abramovic/i-really-think-there-s-no-difference-between-an-art-piece-made-by-a/)

[Marina Abramovic](https://sms4smile.com/quotes/author/marina-abramovic/)

> [In a play, you only get one chance, and you have to get it perfect. In a film, you can change and fix it…](https://sms4smile.com/quotes/kara-hayward/in-a-play-you-only-get-one-chance-and-you-have-to-get-it-perfect-in-a/)

[Kara Hayward](https://sms4smile.com/quotes/author/kara-hayward/)

> [I like candidates who tell me something that is going to make a difference to me.](https://sms4smile.com/quotes/ann-richards/i-like-candidates-who-tell-me-something-that-is-going-to-make-a/)

[Ann Richards](https://sms4smile.com/quotes/author/ann-richards/)

> [There's a difference between watching a film and watching a bit of cinema and enjoying a film as a piece of cinema.](https://sms4smile.com/quotes/nick-frost/there-s-a-difference-between-watching-a-film-and-watching-a-bit-of/)

[Nick Frost](https://sms4smile.com/quotes/author/nick-frost/)

> [“THE DIFFERENCE BETWEEN ME AND YOU When I hold a rose, I see the soft, velvety petals and smile, because tucked between those precious…](https://sms4smile.com/quotes/lisa-schroeder/the-difference-between-me-and-you-when-i-hold-a-rose-i-see-the-soft/)

[Lisa Schroeder](https://sms4smile.com/quotes/author/lisa-schroeder/)

> [If you ask why I do what I do - I want to make a difference. I don't just want to maintain the status…](https://sms4smile.com/quotes/eli-broad/if-you-ask-why-i-do-what-i-do-i-want-to-make-a-difference-i-don-t/)

[Eli Broad](https://sms4smile.com/quotes/author/eli-broad/)

> [When I came back, after all those stories about Hitler and his snub, I came back to my native country, and I could not…](https://sms4smile.com/quotes/jesse-owens/when-i-came-back-after-all-those-stories-about-hitler-and-his-snub-i/)

[Jesse Owens](https://sms4smile.com/quotes/author/jesse-owens/)

> [To make a big difference in the world show a little love.to know love open your heart to Jesus,to show love open your heart…](https://sms4smile.com/quotes/mohlatsane-nicole/to-make-a-big-difference-in-the-world-show-a-little-love-to-know-love/)

Mohlatsane Nicole

> [The biggest difference between us is in our thoughts. You do not want to know the truth and I cannot forget it.](https://sms4smile.com/quotes/mak-786/the-biggest-difference-between-us-is-in-our-thoughts-you-do-not-want/)

Mak\_786

> [“Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree.”](https://sms4smile.com/quotes/frank-herbert/between-depriving-a-man-of-one-hour-from-his-life-and-depriving-him/)

[Frank Herbert](https://sms4smile.com/quotes/author/frank-herbert/)

> [“it makes such difference where you read”](https://sms4smile.com/quotes/walt-whitman/it-makes-such-difference-where-you-read/)

[Walt Whitman](https://sms4smile.com/quotes/author/walt-whitman/)

> [What's the difference between beautiful and ugly?](https://sms4smile.com/quotes/laozi/what-s-the-difference-between-beautiful-and-ugly/)

[Laozi](https://sms4smile.com/quotes/author/laozi/)

[Browse all 1,876 Difference quotes ](https://sms4smile.com/quotes/about/difference/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "A non-virtual function says, you have to do this and you must do it this way. A virtual function says you have to do this, but you don't have to do it this way. That's their fundamental difference.",
            "creator": {
                "@type": "Person",
                "name": "Scott Meyers"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/scott-meyers/a-non-virtual-function-says-you-have-to-do-this-and-you-must-do-it/",
            "about": {
                "@type": "Thing",
                "name": "Difference"
            },
            "@id": "https://sms4smile.com/quotes/scott-meyers/a-non-virtual-function-says-you-have-to-do-this-and-you-must-do-it/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png",
                "contentUrl": "https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png",
                "url": "https://sms4smile.com/quotes/i/c8e/scott-meyers-49057_difference_a-non-virtual-function-says-you-have-to_3159139.png",
                "width": 1080,
                "height": 1080,
                "caption": "“A non-virtual function says, you have to do this and you must do it this way. A virtual function says you…” — Scott Meyers",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Scott Meyers",
                    "item": "https://sms4smile.com/quotes/author/scott-meyers/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "A non-virtual function says, you have...",
                    "item": "https://sms4smile.com/quotes/scott-meyers/a-non-virtual-function-says-you-have-to-do-this-and-you-must-do-it/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/scott-meyers/a-non-virtual-function-says-you-have-to-do-this-and-you-must-do-it/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
