|
I am surprised to see that limits on class and method sizes is the option with less votes. I think is essential to improve readability to write compact, concise and one task only methods. Writing endless methods is terrible for readability. The same applies to classes with thousands of lines, whenever possible I think they should be split into more cohesive classes.
|
|
|
|
|
Clear and concise code logic and structure I think it's what any programmer should keep in mind while writing code that might be reviewed by others.
It would be also preferable for classes and methods to have obvious and intuitive names, this way you won't have to rely to much on comments to understand the code.
Best regards,
Lizandro Campbell
|
|
|
|
|
I'm sure about "real programmers", but I do think the professionals should create very readable code without too many comments.
|
|
|
|
|
Maybe you program, I develop and the first thing you learn when learning to develop software is the comment your code and comment it well, especially if it is code that is not intuitive. SO to you LOL!
http://troysmusic.com
|
|
|
|
|
If you have to wade through huge amounts of unreadable code then you've got a problem - so, to me, clear and concise is the most important. It just shades it by a whisker however.
|
|
|
|
|
I think clear and concise is a superset of pretty variable names. I mean, it's not particularly clear and concise if the names are all wrong, is it?
I vote clear and concise as well! (I've had to wade through sh*t loads of PowerBuilder crap written by barely-above-chimp-IQ-average code monkeys. I know what clear and concise isn't..)
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
I still find that hungarian notation was a good thing and made code a lot more readable, especially things like C for class and m_ for member...
Have a nice life!!
|
|
|
|
|
a syntax coloring would tell you the same information, why use stupid names m_nCounter, instead of counter.
|
|
|
|
|
Because that way you know that 1. It is a member variable and 2 that it is a number. I have seen a lot of times people mixing up the string of the counter and the counter itself... And apart from that I don't know of any development tool that changes the colour depending on the type...
Have a nice life!!
|
|
|
|
|
I use Visual Assist, which can distinguish between local and member variable.
Also I prefer to use fileName instead of lpszFile or IsOpen instead of bOpen.
It depends on an individual team which coding style they wan't to use, but the public opinion is I guess against Hungarian notation, also .NET does not follow Hungarian guidelines.
|
|
|
|
|
+1 for Priyank.
I voted for B, C and E all together. Hungarian notations can be confusing too...
Stilgar.
|
|
|
|
|
So, just by looking at the color of a variable, do you know instantly what operations it supports?
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
use intellisense, also just by naming any thing with fancy prefix does not provide any guarantee. I prefer editor and compiler capabilities over human guess. The C++ coding standard (book) rejects any Hungarian notation, also as I said above it depends on individual and teams what notation they prefer to use, but my experience in the open source communities tell, most developers find it more confusing than helpful. Also it makes sense for some situation to use Hungarian, but here I am talking in general sense and for code that is to be read by if not thousands, at least few hundreds.
|
|
|
|
|
Intellisense is crap for me most of the time, as I'm three steps ahead in my mind. I can't wait for the editor to show me (mis-)information.
Priyank Bolia wrote: compiler capabilities over human guess.
Do you think I compile it by mind?
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Unfortunately I am not a good programmer, so I just rely on intellisense to provide me inputs.
|
|
|
|
|
I still use it. Some of my coworkers thought I was crazy until one day they had to read a printed copy of their own source code written 6 months earlier and couldn't remember what the variables were. Until intellisense works on the printed page, I will continue to use hungarian notation.
|
|
|
|
|
Right! Code is not only read in IDE's!
But it also helps while using the IntelliSense, cause all Variables of one type are together when sorted - this helps when dealing with "big" classes.
And: I often have to transform variables in other types, so no stupid "CounterString" and "Counter" naming, just call them strCount and nCount...
|
|
|
|
|
Draugnar wrote: Until intellisense works on the printed page, I will continue to use hungarian notation.
That'd make a nice sig quote
|
|
|
|
|
I still use hungarian notation.
Whenever I read a variable string, I will immediately find the variable type, variable scope (local, member, or global) without using any other tools, even though it may be wrong in some cases. In general, it is very useful to me, in comparison to other notations.
Without using hungarian notation, you have to remember variable scope, or use IDE or other tool with some time cost.
I think that public opinions against hungarian notation are too exaggerated.
charlie ye
modified on Friday, March 28, 2008 12:43 PM
|
|
|
|
|
I still use it. Although, I use it to convey a higher level of information than the variable's type. For instance, I use prefixes such as btn for buttons, lbl for labels, str for strings, lst for lists, etc. That way I know in a heart beat what methods the variable has, etc. No syntax coloring or intellisense will ever beat that.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Joe Sonderegger wrote: I still find that hungarian notation was a good thing and made code a lot more readable, especially things like C for class and m_ for member...
It's a crutch, a cop-out. It's possible to structure your code so that you can use descriptive names without slapping prefixes on them. Mandating type prefixes just gives a false sense of security, while allowing - perhaps even encouraging - variable names that differ only by prefix.
That said, i don't have a problem with either C-class names or m_ member names, so long as they're used to describe purpose rather than definition (that is, you'd use an I prefix for interfaces rather than C, and drop the m_ prefix on public members of a simple storage class or struct).
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
But I think the core concepts are Consistency and Clarity of Intent, the points above are mere means to achieve that.
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
Marc
|
|
|
|
|
OK for people like you, what makes it more UNDERSTANDABLE?
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
peterchen wrote: OK for people like you, what makes it more UNDERSTANDABLE?
Plain English. OK - that should have a sick joke icon.
|
|
|
|