On 11/11/2015 10:24 AM, Bernhard Voelker wrote:
On 11/11/2015 04:06 PM, Carlos E. R. wrote:
IMHO, many of those bugs, like buffer overflows, would be prevented by phasing out C, and using something else that does compile and run time time bounds checking.
I see it quite different: nowadays, the kids are teached higher level languages like Java etc. which do /much/ work for the programmer. But the effect I'm seeing is that they don't know or even think what's going on under the hood, and that they code sloppily, i.e., they don't care if some code needs 1M or 1G. Especially with Java, I've very often been disappointed by very bad error handling and messages, i.e., the pro- grammer is tempted to only think about the positive path thru the code, and leaves anything else to an "exception" - hey the whole world is an exception! ;-)
So? Little has changed. Years ago C programmers were rarely taught to check the return codes from system calls/library calls and handle errors. Moving from avionics -- with its rigour - to commercial programming I was often criticised by peers and management for writing code that did all this checking. It slowed down the application and increased the size of the load module. And heck, errors rarely occurred! Right. A real modern language such as Ruby makes exception handling so much easier! So much more natural the Try/Catch style is so easy to use and embed in the lower layers so that the event driven/case driven upper layers can proceed in a declarative fashion. That aids specification-driven generation of code and specification-driven testing. The example of Ruby in this regard has driven other languages to adopt some of these methods, but sadly its not so natural for them, as you point out. All this said: you can screw up and gloriously !FAIL! in any language. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org