??? 10/28/08 18:40 Read: times |
#159435 - Just a minute ... Responding to: ???'s previous message |
Erik Malund said:
if someone writes code like this
u r goin 4 * 2 8 instead of you are going four times to eat the language does not matter, the writer does. Whatever is said about Pascal I have no doubt it can be obfuscated and I repeat my previous statement that if something is obfuscated, it is not because of the language, but the use thereof. The 'defense' of Pascal "you are forced to write clearly" stinks, I you have to be forced to do so, you should not write code in any language Erik I've been in the position of having to understand and review the work product of others for many years. No language, aside, perhaps from LISP, has given me the heartburn that 'C' has provided. It's for learners that Pascal was written. The author is still alive ... Ask him, if you don't believe that. Beginners certainly should be writing code, though they certainly aren't prepared to do it commercially. How many "stupid" errors have surfaced here in this forum because someone thought they'd written a program correctly because the compiler compiled it? 'C' is a good general-purpose tool because it doesn't get its "features" in your way. That means you're walking the tightrope without a net, though. If you make a mistake, well, that's your problem. Pascal endeavors to "help" you, at least to the extent of getting you past the compiler errors. The very thing that makes some people love 'C' makes others, including me, hate it. With a language like 'C', that's written to keep the language out of the way, there's no safety net. It lets you write the most ridiculous rubbish conceivable, and compiles it, so long as the syntax is correct. Pascal attempts to impose a bit of learning with respect to "orthography," which is more than just spelling. In German, that's called Rechtschreiben. Aside from the rather obscure term, "orthography," I don't know that there's a single English word for it, but it should be used a lot more often, both in conjunction with writing English prose and with coding. The reason the Pascal compiler "slaps your wrist" each time you do something really, Really, stupid is so you'll learn not to do that. 'C' was written as the industry was getting away from the "dollars per line" notion of software cost and moving to a more constructive paradigm. Neither 'C' nor Pascal was written to be a "natural language" tool. That means each has characteristics, lexical and syntactic, as well as orthographic, which have to be learned and understood. A Pascal program that compiles will probably do "something" discernible. That doesn't necessarily hold for 'C'. Managers who like 'C' often like it simply because the line count is smaller. I don't think that's a good thing at all. They don't pay for code by the line any longer, so what should be important, above all, is for the code written last year by someone no longer available, whether he's quit, retired, been shot by a jealous husband, or whatever, to be picked up next year, after nobody initially associated with the project of which it's a part and thoroughly understood the first time it's examined, and not only after six weeks of study by high-dollar consultants. This topic comes up often, and, embedded within it, is the requirement for much better practice in the industry. People don't stay in one company for an entire career as once was the case. Turnover is a big problem for software managers, and coding style and documentation are key issues for them. If coders were paid only for blocks of code that could be immediately understood, correctly, by a new graduate from school, things would improve. I don't have a problem with the a-b++ or thisword && thatone in 'C', but with the sloppy practice that makes it impossible to track which system requirement justifies the presence of a given line, or block, of code, that sloppy practice being so much more common in 'C' than in Pascal, or in ASM. Further, because 'C' is so universally taught, it's often viewed as an excuse, or shortcut, around acquiring knowledge of the task and the hardware environment. Sadly, the practice of simply "throwing something together" is all-too-often superficially successful. That's not to say that it can't happen in Pascal, ASM, or ADA. The code, in whatever language it is written, should be constructed such the reader can easily remain focused on details such as why it's important that "this pointer be incremented here" rather than on "what does this statement mean?" If that practice were adopted, one could actually begin to believe in the existence of "self-documenting code." I believe it's the crappy coding style and absent commenting that makes people believe 'C' is cryptic, and not necessarily the syntax. RE |