Advertisement

How do you pronounce 'ptr'?

Started by November 13, 2015 05:57 PM
42 comments, last by swiftcoder 8 years, 11 months ago

I've been watching a number of the CppCon talks on YouTube, and it's bothering me that Herb Sutter pronounces the variable name ptr as 'put-er' (as in, one who puts things somewhere).

Now, Herb has been at this a lot longer than most of us, so he's probably in good company, but I've always pronounced it as if it wasn't an abbreviation (i.e. 'pointer').

I'm curious how the rest of you pronounce it?

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

It's an abbreviation of "pointer". I've never considered pronouncing it as anything but "pointer".

Advertisement

Depends on how and why I'm reading the code aloud.

I very rarely speak the cryptic incantations of source code.

Normally I dislike variables with names like 'ptr'. I would prefer a descriptive name optionally with a Hungarian-style prefix. pCurrentObject, nearest, pBody, but not ptr.

Sometimes I would one use and sometimes another. If "ptr" was on its own I might call it "pointer", or I might throw in some vowel-like sounds approaching "peter" or "putter" or maybe "pee tee are", depending on who I was explaining it to and why.

There are situations where general understanding is more important than the specific terms and labels. If I were explaining the code in a less technical review I might change "pCurrentObject" to "current object pointer", and that's where I'd change "ptr" to "pointer", I'd change "idx" to "index", "char" becomes "character", and so on. In that scenario the key feature is the concept rather than literal accuracy.

In other scenarios where I am working through code to find a defect that may include subtle naming issues, I would not adjust names. When the exact details of the variable names was important in the meeting I would call pCurrentObject as "Pee Current Object", ptr as either "peter/putter" or "pee tee are", and idx as "eye dee ex" or "eye dex", and "char" remains "char" like blackened meat.

"?-?-?"

"Pointer" or "putter", depending on context.

fooPtr = "foo pointer"

std::shared_ptr "stid shared putter"

I admit I'm not very consistent about it since as has been mentioned, reading code aloud is not something I do very often.

Pointer every time.

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

Advertisement

std::shared_ptr turns into either "stood shared pointer" or "stood shared put-er" depending on whatever I feel like at the time.

Yeah, I'm a sloppy speaker.

I can understand saying "pee tee are" as it's a phonetic reading of what's written, but why the hell anyone would say "putter" over "pointer" is a mystery to me.

"Pointer" is an accurate description of what it is, and takes the same time to say as "putter".

Honestly if you're talking to someone about std::shared_ptr and they don't understand what "shared pointer" means in context, you're probably wasting your time (i.e. either they're an idiot or you're talking at too low a level to them)
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

"Pointer"

I've watched alot of those talks, and I piqued by that pronunciation as well.

Another they use is "stood" instead of "std::" or "standard", as in "stood vector" to mean "std::vector".

That's weird, but is easier pronunciation than "ess tee dee", so I started adopting it when thinking about code.

Previously, I mostly just silently ignored the namespace when vocalizing (internally or audibly).

What's weird about "putter" is it's not faster to say than "pointer", so we're not saving anything, or being any clearer in communicating.


That's weird, but is easier pronunciation than "ess tee dee"

Also, you know, doesn't raise as many eyebrows among non-techies when you start discussing 'STD pointers' in polite company.

That said, I read std::smart_ptr aloud as 'standard smart pointer'.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement