5 ms·
What I take from this: computer languages (C++ especially, but also systems built in C) are too complex for the average mind No, I'm not significantly smarter
by raverbashing 10y ago
What I take from this: computer languages (C++ especially, but also systems built in C) are too complex for the average mind
No, I'm not significantly smarter than the average programmer
That's what needs to be addressed.
While C++ facilitates things, it is complex. While C is very simple it makes mistakes easier by requiring things to be done manually
IDEs don't help. Code completion is helpful but it is of limited help
And we keep repeating ourselves every time we write a for loop
- informatimago 10y agoSwitch to Common Lisp. And with lisp, you don't have to repeat yourself: any pattern, or any boilerplate can be abstracted away with a macro.
- bluGill 10y ago> can be abstracted away Except for too many levels of abstraction.
- spacemanmatt 10y agoIs that the fault of the programmer or the language, though?
- steveklabnik 10y agoIt's a reference to https://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering https://en.wikipedia.org/wiki/Fundamental_theorem_of_softwar... (and the "humorous clause" mentioned there as well)
- raverbashing 10y agoYes, I believe one of the problems is the way things are abstracted, and I don't see a language solving this Adding more levels can only go so far But I don't know how to do it better. Module/Class/Method won't cut it anymore
- maxerickson 10y agoThat's kind of what some compiler optimizations do isn't it? Look through the abstraction and discard it?
- golergka 10y agoThe fact that something can be done doesn't mean that it should be done.
- vbezhenar 10y agoHow can CL prevent something like "i1 == i1" instead of "i1 == i2" error?
- jjnoakes 10y agoFirst, since the AST is so simple to walk programmatically, one could write a simple check for that kind of bug in, I'm guessing, a few lines of Lisp. Second, just because you can come up with a bug that can be written in a language doesn't mean the language doesn't prevent all sorts of other bugs. All languages can have bugs written in them. That's not the point.
- n00b101 10y ago>computer languages (C++ especially, but also systems built in C) are too complex for the average mind I'm not necessarily disagreeing, but have you looked at the source code [1] of the Apollo Guidance computer [2]? This software was shipped to production 50 years ago. It literally implements a "self-driving space rocket." It is staggering that this was completed in such a short time and actually worked. The code is written entirely in the "Apollo Guidance Computer (AGC) Assembly" language. The hardware that it was written for had to be invented in at the same time, and was the world's first computer to use Integrated Circuits ("chips"). They also implemented a Real-Time Operating System with a multi-task priority scheduler, as well as a virtual machine and assembly interpreter within the software. This was mission and life safety critical code, the risk involved boggles the mind. And yet the software was incredibly reliable. It was so reliable that it even saved the Apollo 11 crew and mission during the lunar descent by famously recovering from a peripheral hardware bug. I honestly do not know how this feat was even humanly possible, but I do know that these programmers did not rely on "code completion." [1] https://github.com/chrislgarry/Apollo-11 https://github.com/chrislgarry/Apollo-11 [2] https://en.wikipedia.org/wiki/Apollo_Guidance_Computer https://en.wikipedia.org/wiki/Apollo_Guidance_Computer
- emodendroket 10y agoYeah, sure. But if they'd had code completion it would have been a help, not a hindrance.
- drzaiusapelord 10y ago>I honestly do not know how this feat was even humanly possible The Apollo program, fixed for inflation, was something like $130 billion dollars. That's buys you a lot of talent, testing, etc. Its also worth noting that the program wasn't without its screw ups. The Apollo 1 deaths. The radar control on Apollo 11 eating up all the CPU during lunar landing. Apollo 13's famous O2 tank explosion. I think you may be glamorizing something that was well done, but falls within the realm of 'you get what you pay for' and the occasional human error, which in the case of Apollo 1, turned out to be fatal. I wouldn't call a program with three deaths and an aborted lunar insert to be infallible. That said, NASA/JPL publish code standards, although I imagine most tech companies would balk at giving up their toys and hot languages/frameworks to do fairly tedious work like this. http://lars-lab.jpl.nasa.gov/ http://lars-lab.jpl.nasa.gov/
- emodendroket 10y agoThis also includes analysis of C#, which is quite different from C.
- raverbashing 10y agoYes, while C#/Java will prevent some kind of errors from happening, others are very common (Example: copy/paste errors, parameter order problems, etc)
- spriggan3 10y ago> While C is very simple it makes mistakes easier by requiring things to be done manually I wouldn't describe C as simple but basic. Of course, it's start being less basic with all the macros and all the tools needed to compile and distribute a C program , like autoconf ... with all these layers , C becomes as complicated as any other language because it relies on so many 3rd party tools (which are often dynamic languages) to fix its shortcomings. But as long as linux kernel is written in C the language isn't going anywhere.
- Pasick 10y agoI wouldn't say that the number of errors in code directly depends on complexity of the language. From my practice I learned that the code quality depends on a software development process implemented in your team. Now we have whole bunch of practices and tools that allow us to minimize risks of appearing stupid mistakes in code: covering the code with unit and integration tests, static and dynamic code analysis, continuous integration, code reviews, refactoring and so on, and, I should say, these things work. So, I think, this article demonstrates that still there are a lot of teams whose development process can be improved.
- nickpsecurity 10y agoThat's actually the problem Ada's designers set out to solve. They add to what they solve every iteration with safe defaults and contraints on use. Whether you do Ada or not, you will likely find skimming this book to be helpful to see how one can systematically analyze all forms of programmer error and attempt to eliminate them: http://www.adacore.com/uploads/technical-papers/SafeSecureAdav2015-covered.pdf http://www.adacore.com/uploads/technical-papers/SafeSecureAd... That's at language level. At process level, Harlan Mills developed Cleanroom back in 80's to try to get software defects as low as cleanrooms CPU's were built in. It combines a formal approach of describing/connecting things, constrained implementation for easy verification, iterative development, and usage-based testing. Defect rate was extremely low even for first use by teams with cost ranging from slightly more to cheaper due to less debugging. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.2667&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.... On productivity side, the DSL-based approach on top of safe, functional languages seems to be winning out. Safe, functional combo already knocks out a lot of problems. DSL's for common categories of programming let you read and write less code to get same work done possibly safer with sane auto-generation (eg parsers, protocols, GUI's). iMatix even did it for C-based, enterprise software. So, there's certainly work on methods for mainstream software development of average coders with still high quality. Cleanroom was most successful in terms of defect rate. Eiffel pretty much made a market out of it by combining safer language, safe concurrency, OOP, and Design-by-Contract. They're still going strong. Haskell community probably most advanced given last item on my list with some financial companies using it. Jane Street's and Esterel's Ocaml work shows it has similar benefits. These have steeper learning curve but benefits add up quickly afterward. Cleanroom w/ Design-by-Contract and safe, high-level language seems to be best combo to deal with your list.