SigKILL said:
The main reason for not using hungarian notation is that the data type should be abstracted away.
The location of a variable should be abstracted away as well. Like I illustrated before, variables can change scope without changing roles, especially during refactoring, exactly like they can change type. I don't see why you treat scope and type prefixes differently. I believe the number of bugs caused by scope erros and type errors is pretty equal. And I need to know the types of variables more often (it's easier to remember whether it's a member
Quote
I´m sort of confused: do you dislike coding conventions in general?
No, but I dislike coding conventions that are ugly, leave no room for elegance, and can create misinformation. CamelCase is a useful style convention but it would be perfectly acceptable not to use it when there's a more elegant solution for a certain situation. And I'm quite picky about parenthesis placement and indentation but I once wrote code like this (names are symbolic):
if(flags & FLAG1) doA();
if(state > 0) {
if(flags & FLAG2) doB();
if(state > 0) {
if(flags & FLAG3) doC();
if(state > 0) {
if(flags & FLAG4) doD();
if(state > 0) {
if(flags & FLAG5) doE();
}}}}
This becomes an ugly 'staircase' when using general parenthesis and indentation rules (there are actually more stages in my code and the real variable names make it very clear what it does). So even though the convention is intended to improve elegance I had to deviate from it to get good code elegance. Just like with CamelCase this never causes misinformation.
Rules like 'm_' on the other hand are only meaningful when applied very strictly. You're relying on human hands to keep it consistent, and it becomes misinformation when you break it (intentional or unintentional). So you don't have any freedom. It also uglifies code instead of improving elegance.
The only option to keep things consistent is to back away from a strict convention that forces you to do a 'mechanical' task. You can either read the correct variable scope in the header file or use code assistance to do the 'mechanical' task correctly.
Quote
It really helps you being able to get to know new parts of the code fast.
I beg to differ. This is the second time you've used the word "fast" in this context, and it makes my skin creep. It is truely impossible to get to know code fast. Like I said before you end up writing bugs and breaking the design. You really have to study the headers to get to know the code. Just reading the functions, with scope hints or not, is largely insufficient. Personally I would never risk touching a class's code without mastering its design and keeping the header file right next to the source file or using other assistance.
Quote
If someone breaks the conventions in a non-obvious way, it is managment problem (you should have code review). You should always adapt to companys coding conventions. I´ve heard several stories about people being fired because they are not able/willing to adapt.
Every project needs
guideline conventions, and people should adapt to them
naturally.
If you make your rules too strict, you end up firing the most skilled team members who know how to think for themselves.