Marty Fried
Posts: 1
Nickname: linfidel
Registered: Apr, 2009
|
|
Re: What Do You Consider "Readable" Code?
|
Posted: Apr 15, 2009 1:24 PM
|
|
> What about systems that are written in multiple languages? > It may be unrealistic to expect everyone to be well versed > in all of them. If the other languages are not > comprehensible without being inducted into the priesthood, > then you end up with "here be dragons" zones.
I'm a little late, but your post brings up what I was thinking for most of the thread - the question wasn't really about what language is most readable, I didn't think; sometimes, you don't have a choice of language - you may need to use whatever language is used for the rest of the project.
So, it seems like the comments should be more along the lines of general guidelines that work in many languages.
I worked with an engineer who drove me crazy with logic statements (C/C++) like this: if (condition) ; else doSomething(); He had trouble with negative conditions, so his conditions didn't always say what he was really doing.
If I need to test for some variable equal to zero, I'd rather write "if (x == 0)" than "if (x)" like a lot of people do, or did in the days of C, because x is not a boolean, and my way emphasizes that it is checking for a value, not a condition.
I hope these aren't too simplistic, but they are just easy examples off the top of my head.
But good thread, nonetheless.
Marty Fried
|
|