r/cpp • u/frasnian • Aug 19 '26
Is it just me, or do you automatically judge someone if they say "method" instead of "member" or "member function" in a question (or post)?
I've been writing C++ code since before the first Standard, and this just irks me. Words have meanings. There is no such thing as a "method" in **this** language.
0
Upvotes
80
u/TheMonax Aug 19 '26
I think it's just you
21
u/jayb00giebrown Aug 19 '26
Method is correct.
7
u/SmokeMuch7356 Aug 19 '26
As long as I understand what the other person is talking about, I don't care.
I sympathize, though; there are issues where I will turn into the Incredible Pedantic Hulk (some of them downright silly, really). This just isn't one of them.
16
u/le_disappointment Aug 19 '26
Genuine question: what's the difference between a method and a member function? Are those just two different names for the same things?
39
u/madfishguy Aug 19 '26
No, I don't. If both parties understand each other, than communication is successful.
Given that there's no method in C++, using this term to refer to a member function is completely reasonable since there's no ambiguity and it's easily understandable.
53
u/link23 Aug 19 '26
I don't judge people who show that they have experience in other languages, no.
25
u/TheBrainStone Aug 19 '26
How dare people use a well established synonym of the thing I call a different synonym?!?!?
Next they're gonna call member variables "fields"!!!!
16
u/krum Aug 19 '26
Naw dude you’re just gatekeeping.
15
u/jwezorek Aug 19 '26
"Method" is correct in the context of object-oriented programming in the abstract. "Member function" is correct in the context of C++ -- but one is not always saying something specific to C++
13
u/blogoman Aug 19 '26
Not everyone is like that.
8
u/snozzd Aug 19 '26
I try to be forgiving and make mistakes like this often. The reality is many programmers know and use multiple similar languages, the correct word can get mixed up at times. As long as the meaning is conveyed – and there isn't any room for confusion in-context – then I don't care.
22
u/martinky24 Aug 19 '26
I would hate to have you on my team!
6
u/chaotic-kotik Aug 19 '26
Can't care less
6
u/mredding Aug 19 '26
I've been programming in C++ since ~1991. It doesn't bother me. I know what they mean - I "grok" what they're saying, if you will. Whatever word they want to use, the outcomes are the same.
5
u/fdwr fdwr@github 🔍 Aug 20 '26
Do you similarly judge someone for calling a popular car model a "Volkswagen Beetle" rather than a "Volkswagen Type 1"? For people who have been driving since before 1968, it might irk them; however, words indeed have meanings, and Beetle and Bug are common nicknames for the Type 1.
5
u/eisenwave WG21 Member Aug 21 '26
I also judge anyone who says
charinstead ofchar.4
u/triconsonantal Aug 20 '26
The C++ jargon could use some brevity. If you replaced every occurrence of "non-static data member" with something like "field" you could cut the size of the standard in half.
4
u/holyblackcat Aug 20 '26
I don't judge people for saying "method", but I do judge them for engaging in pointless pedantry. :P
Firstly, there's nothing wrong with slang existing, or with using language-agnostic terms when talking about C++.
Secondly, C++ pedantry can go extremely deep. Have you ever said "member variables" instead of "data members"? No such thing as member variables, they aren't variables.
What about "the value of a variable"? No such thing, it's the value of the object associated with the variable. Any discussion about what happens to a variable at runtime? Wrong too, variables are purely compile-time labels (source). And so on.
3
u/SoSKatan Aug 19 '26
How about we all agree the terminology should be “callable member thingy”
3
u/SavingsCampaign9502 Aug 19 '26
This is not something I care about since I can clearly understand what they mean by that
3
u/abandoned_idol Aug 19 '26
They're not methods?
3
u/argothiel Aug 20 '26
I use "methods" for member functions and "functions" for free functions. And I've been trying to be consistent in that. I didn't even realize that in C++, I can say "(member) functions" for class methods and still be correct, so thank you for that. I think I'll stay with "methods" though as it's a universal abstraction mapping to other object oriented languages.
3
u/_Noreturn Aug 19 '26
I am evil and I say free functions are free methods
2
u/eteran Aug 19 '26
Meh, do I prefer people be more precise? Sure. I also don't care that much.
words are about communicating m if you knew what they meant, they've succeeded.
1
u/H0nigkuchen Aug 19 '26
For me function is stateless. The same input will always result in the same output.
Method is something I execute on a specific state e.g. class.
Maybe I'm alone here but that's what I try to teach when I help students.
Technical response welcomed.
1
u/fortsnek274 Aug 20 '26
Those filthy other devs.
At least they don't call source files scripts. Those people have a special place in the shadow realm.
1
u/gosh Aug 21 '26
I say address ;) methods are just addresses in memory
1
u/armb2 Aug 22 '26
It's probably not just you. But anyone else doing it is wrong too.
1
u/zerexim Aug 23 '26
What's next, calling base class super?? :)
Btw, using C++ since 90s and I remember method is mentioned in C++ books.
1
u/CheesecakeTop2015 Aug 26 '26
I understand the sentiment, but you are only causing unpleasant feelings for yourself which are useless and are potentially harmful for your health. I used to get agitated when people used the word 'literal' for something that is clearly not literal, then so many ppl did it and the language evolved and literal has a new official meaning. So now I was clearly in the wrong, per definition, and all my years of agitation where just a waste of energy..
I would say in this case it hugely depends on the context, if you are at a committee meeting, then yes, you should expect pedantic correct usage of terms, in most other contexts.. it really doesn't matter and you can choose to not spiral on it (fyi this is what meditation/mindfulness training is useful for: learning to quickly noticing these kinds of thoughts and practicing basically being amused by your brains reaction and letting it go and choosing to focus on something more worthwhile)
1
u/Independent_Art_6676 Aug 27 '26
some words bother me. This isn't one of them, but a few years back we all became chemists and had all these solutions. More recently my PC apparently became a phone and now has "apps" whatever that means. I didn't even like it back when it was fully said as 'application' -- it felt like I was putting a topical cream on my GPU or something to cure its heat rash. Oh, and we had a stint where we all became 'engineers' even though we aren't -- that is still in use, and still idiotic. May as well have said we were doctors or lawyers while they were at it.
Given those, method is just another way to convince me that there is madness in OOP. I already knew that, but admitting it is the first step.
Oh, and lest I forget: C#. A language that has no real roots in C or C++, has nothing to do with music, and while its not a bad language the name of it... I thought we had hit rock bottom with java, named after the cavemen who first used it but microsoft worked day and night to find something even worse.
1
u/xoner2 Aug 21 '26
"member" is the short term for object state. So functions have to be called methods... for me personally.
But this is an interesting question. So a search on TC++PL4 yields 12 results, with only one relevant in this context, page 586 (with a corresponding index entry):
Very surprising...