>prefixing class members with m_
>>61837952
you're fucking retarded
>>61838166
No u
>>61838184
there is nothing wrong with hungarian notation, as a matter of fact it was quite useful before we had auto complete.
>adopting unfamiliar conventions
The scoundrels!
>>61838224
"Encoding the type of a function into the name (so-called Hungarian notation) is brain damaged—the compiler knows the types anyway and can check those, and it only confuses the programmer."
-Linus
For once I agree with Linus
>>61838224
It was never useful. Knowing the concrete type of a variable is the opposite of abstraction.
>>61838269
Did he say something more about that?
>>61838283
Maybe you should try some low level programming before generalizing too much.
>>61838544
>Maybe you should try some low level programming before generalizing too much.
Even in that case. You can always abstract.
>>61838544
Hungarian is actually more useful in high level. It's still stupid because you can always backtrack. That's if design itself isn't crap to begin with. Hungarian is a poor substitute for proper design.
>>61838640
Achieving "proper design" is often pretty hard when you have to work with existing code, need to do modification and can't afford to rewrite everything properly for whatever reason (try maintaining C++ code written by incompetent colleague who left the job a year ago).
Anyway, seems like I had a wrong idea about what "Hungarian" actually is. This article is worth looking into:
https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/
>>61837952
I fucking hate seeing this in C++ with a passion.
The only fucking reason people even do this in the first place is because `this->` before accessing a class member is optional.
If you have the slightest bit of discipline and preface class member usage with `this->` though, the m_ practice becomes retarded. Not to mention that if you don't do this, and I see `foo` being used in a function but not declared in said function, I now have to wonder whether that's a global or a class member.
It also makes it more difficult to determine whether or not a method can be made const after writing it, since if you do preface class member usage with `this->`, then all you have to do is:
1: See if you can spot a this-> being used for accessing a member
2: See if methods called in this method are const as well.
>>61838269
>For once
Back to re dit, Stallman
>>61838283
You are absolute cancer.
>>61839664
Ok. What floats your boat.
why not just "_"?
>>61838224
>>61838269
Raymond Chen wrote a post a while back about how there used to be two kinds of Hungarian notation at Microsoft, but the wrong one won, and became associated with the name.
The bad kind is encoding into the variable name the kind of thing that it's easy for your editor and compiler to know. Is a member variable, is this or that type, etc. The good kind, now extinct, was encoding into the variable name something about what it represents beyond the type. I think the example was a prefix to distinguish between coordinate-relative-to-one-thing and coordinate-relative-to-another-thing. They're both ints, and it's not a syntax error to compare them, add them, etc, but it's certainly a logic error.
>>61837952
The verbosity is well worth the absolute clarity it provides.
>>61838936
Nice article, thanks