SS>> I hate five major things about C++ so far:
SS>> /* 2. Declaring data in random places */
SS>> int HiIAmRandomlyDeclaredHere;
BP> Another thing I did never forgive in C. I write my code. I need an
BP> additional local. Why on earth I have to go up, search start of the
BP> block and insert it there instead of putting it right there?
AD> Code readability, and it makes it easier on the compiler, but the
AD> first one is the real one. Nothing but code readability. I programmed
AD> in BASIC for much too long; it was very painful to convert to C, but
AD> once I managed, I was okay.
AD> Notice that a lot of Sunir's complaints are just what the compiler
AD> ALLOWS -- things that are bad coding practice. I agree; if I'm looking
AD> at your code, I don't want to have to wade around, looking for random
AD> declarations.
To each his own. I find that declaring variables as closely as
possible to where they are used _enhances_ "readability". (Besides the
potenial increase in program reliability via restriciting visibility.)
If the definition and the code are right there on the screen, then which
style of code forces the programmer to "wade around"???
In either case, the "problem" is easily solved with a better set of
tools. With an adequate set of tools, any variable is just one
keystroke away. But I suppose that restrictive (though functionally
useless) software standards could at least somewhat compensate for
primitive tools.
---
þ Blue Wave/QWK v2.12 þ
---------------
* Origin: St. Louis Users Group (1:100/4)
|