5 ms·
it's hard to take an article like this seriously - i just want to make 2 highlights. he started using C++ when the STL didn't exist yet. This is ancient IMO, so
by ramy_d 16y ago
it's hard to take an article like this seriously - i just want to make 2 highlights. he started using C++ when the STL didn't exist yet. This is ancient IMO, so his section on ever-changing standard is moot to me. if he didn't want to maintain the code base, then he should have kept using an older compiler.
second highlight, errors messages - Debugging is the first skill programmers (re)learn, so IMO it's a pretty important one. when he says "You get an error message? You start fudging the code until it compiles." is down right negligent at best - C++ will tell you at exactly in which file, at which line and in which function called from which class your error was caused (more than i can say for other languages) and, i'm sorry, but if you don't know that compiler errors wrap the code in ' ' then wtf have you been doing since the dinosaur age when C++ had no stl?
yes, the STL makes compiler errors extra long but to say you need to fudge with your code to make it work is a spray of FUD to anyone looking to get into the language.
To close this, everything he said in his "hard to read" could be applied to any languages with mutability. The code snippets he took were so small or narrow that no one could be expected to make anything of it. C++ is a strong typed language, should be read as such and evaluated as such.
- silentbicycle 16y ago> To close this, everything he said in his "hard to read" could be applied to any languages with mutability. Really? I dare you to make Python code as hard to read. It has mutability, too. Hell, does C code have that same amount of overloading? The worst things C offers are function pointers and preprocessor hijinks* , while C++ proudly adds whole new categories of ways to make code hard to parse or reason about. (To say nothing of compile times.) I learned C++ before the STL, too. For what the STL accomplishes, I'd rather just use OCaml. C + Lua is also nice - the division emphasizes their strong points, and each seems to keep each others' complexities in check. * http://www.reddit.com/r/programming/comments/b507c/ask_reddit_to_counter_todays_negativity_whats_the/c0l1hxh http://www.reddit.com/r/programming/comments/b507c/ask_reddi...
- shin_lao 16y agoC has got macros, so it can be very hard to read too. Generators (http://docs.python.org/tutorial/classes.html#generators http://docs.python.org/tutorial/classes.html#generators) in Python can make code very hard to read as well in "hiding" a lot of complexity inside the generation. In other words, such code: r = f(param) can be a lot of different things as well. The enter/exit clauses hide a lot of code as well, although they should be used for (de)initialization they can be abused (I've seen it). Finally, I think you should elaborate more when you say "for what the STL accomplishes, I'd rather just use OCaml" because I don't understand what it means and I know both languages (C++ much better, admittedly).
- silentbicycle 16y agoI mentioned C macros already, and I don't think Python generators are a good example - used idiomatically, they usually made code easier to read, and Python's community imposes a fairly consistent style. About OCaml - I much prefer its way of doing parametric data structures, functors, etc.
- ramy_d 16y agoso your argument is: my programming language's concepts make it easier to read as long as you use them correctly, and all of MY friends write the same way anyway so our language is SUPER easy to read. breaking news: it's not. the problem with your argument is you're not c++ programmer, and you saw this post on hacker news and decided to come here tell us how much better whatever language you use is to C++. you don't seem to consider that this language is the way it is for very specific reasons. I'm trying to say that this article is VERY poorly written with very biased opinions and refuses to look at the language as whole. I'm not saying C++ is the EASIEST language to read, it's not. And his examples could have passed off as hard to read for ANY LANGAUGE. honestly? bar = foo(bla); like who the fuck writes like that anyway? Readability is the trade off the C++ standards committee will always make because readability will come in the way of the things most important to the language (C compatibility, speed, high level functionality) but that doesn't mean you get to take a dump on your keyboard and click the send button. if you don't understand the issues at stake then don't release you diatribe into the conversation. C++ isn't python, or C or Ruby nor is it supposed to be. just accept it.