|
God yes, I have to do some work with some old store procedures in Oracle and some of them were written by a mouth breather that doesn't indent at all. It's so hard to follow.
|
|
|
|
|
If the coding practices are well thought out and adhered to, all of the other issues can be resolved with refactoring tools. To my mind, coding practices define naming conventions (item 1), use of logic patterns (item 2), commenting requirements (item 3), whitespace (item 5), size limits (item 6), and spelling (item 7).
Software Zen: delete this;
|
|
|
|
|
- I couldn't agree more.
- Adherence to Common coding practices just about covers the rest of the choices!!
void izmoto(char* szKwazi);
|
|
|
|
|
You got it!
http://troysmusic.com
|
|
|
|
|
The technique I used to evaluate this was, if the factor in question were of pathetic quality and the rest were great, what effect would it have on the overall code quality? Eg: what if the code is neatly laid out, variables are named well, etc, but there are no comments?
When I used to work for [payment processing company that will remain nameless], I came across code littered with variable names like ntl and icpt . I asked the cretin who wrote the code what they represented, and he said they were notional and intercept . Quite understandably, I didn't ask him what cnt stood for.
I find that intuitive naming comes out on top.
Cheers,
Vikram.
|
|
|
|
|
A clear and good nomenclature aides and facilitates an interesting read for a peer developer without creating any boredom.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
This is a tough poll to answer, it's hard to pick a top answer.
However, I agree with 'intuitive names', the reason being that if good names are chosen for variables, methods, and classes, then some poor choices for structure, logic and design were probably evluated and discarded (or refactored) because they resulted in confusing names.
The confusing names should have been a clue that something was wrong with the design. thus, if properly done, 'intuitive names' should have resulted in better clarity in other areas as well.
|
|
|
|
|
Well expressed, was just thinking the same thing .
Wout
|
|
|
|
|
may sound stupid, but its a fact...
|
|
|
|
|
Which suggests a possible improvement to the surveys: Randomise the order of the answers.
|
|
|
|
|
Or get rid of them entirely.
|
|
|
|
|
I disagree. The results are exactly as I would have weighted them in terms of what is most important. They probably should have not just written down the most important ones they could think of first, though. Yes, ideally the questions for all surveys would be shuffled in random order each time it's taken. But the Microsoft way of doing things is to rely heavily on "wizards" and drag-and-drool GUI tools. When you're not coding by hand, your flexibility is almost always limited in some way. And most of Microsoft's tightly-coupled interfaces punish those of us who like to code everything by hand.
|
|
|
|
|
All of these have significant benefits, but I have to defer to good comments as the best tool for making code maintainable. If I can read a short comment block that explains the purpose of the following code block, it's the best possible head-start.
Intuitive variable names is great; very high on my list, in fact. But I don't want to have to even read the code if I'm not in the right place. I shouldn't have to analyze code, at any level, to determine what the purpose of that code is.
Good coding practices and standards is also great. I don't want to have to weave through a mess of spaghetti just to end up pulling out my hair when it's all done. (Far too little now, as it is, anyway!) But again, do I need to read this code?
I'm my worst critic. I'm working solo on a huge project, and I'm often updating or inserting comments because I want to be able to quickly determine what code I'm looking at, and second, to determine how it works.
|
|
|
|
|
It is not easy to select one but most acceptable when we have one option clear comments that explain every thing.
Whatever you do will be insignificant, but it is very important that you do it
|
|
|
|
|
I'm glad this is making everyone have a bit of a think
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
There are quite a few 'All Of Above' in the 'Optional Text Answers'.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
If said comments would really be useful, they'd explain enough of the code to make it understandable, right? (would they be useful otherwise?)
though of course heavily commenting obfuscated code is not the smartest thing to do..
|
|
|
|
|
Except for those comments that are packed in on all sides with code.
|
|
|
|
|
It wouldn't be a Useful comment then would it
A useful comment is by definition useful
|
|
|
|
|
Well this is an argument for those form vs function people. You know the ones that I'm talking about. The people who believe that function can be completely divorced of form and still maintain function.
|
|
|
|
|
Don't you watch House - everybody lies.
This is true of comments as well (not always updated when code is changed).
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
I chose "Clear and concise code logic and structure" because it's one of the harder things to correct.
The runners-up are:
"Wise use of Whitespace" can easily be fixed in Visual Studio via "Format Document"
and
"Obvious and intuitive names for variables, classes and methods" can probably be easily fixed in Visual Studio with (global) replacements
|
|
|
|
|
I believe all three of these are equally important. I think it would have been a better survey had checkboxes been used instead of radiobuttons.
|
|
|
|
|
DonDriskell wrote: all three of these are equally important
Yes, but two are easier to remedy.
DonDriskell wrote: checkboxes
Yar, maybe "pick three".
|
|
|
|
|
I agree.
I don't think any of the given answers could be looked-to as THE best way to make code readable. Though Clear and Concise, I think, almost covers two other choices (concise meaning limiting length, as short as possible but no shorter, and clear might reference picking obvious and intuitive names, etc.). I'd add good comments as the other needed item (something more than "set x equal to the function return value" -- and YES, I've seen comments like that in production code).
|
|
|
|