3 ms·
These kinds of rants sadden me. They purport to outline absolute, logically inviolable reasons that a given language is "bad". What they really do is express th
by putzdown 12y ago
These kinds of rants sadden me. They purport to outline absolute, logically inviolable reasons that a given language is "bad". What they really do is express the writer's frustration, an emotional reaction that probably emerged from working with language attributes and features that he in some cases doesn't understand well or in other cases simply doesn't prefer. C++ works beautifully for millions of programmers who happen to "get" it and like it, just as Java does for others and C# does for others and Haskell does for others and fill in your main squeeze here. Programmers are trees (http://www.jeffwofford.com/?p=915 http://www.jeffwofford.com/?p=915). We each adapt to what we like and come to like what we adapt to. Let's not pretend we alone have the One True Way or that our non-preferred way is stupid.
- izacus 12y agoWhile your point may be valid... let's also not pretend that some genuinely bad solutions are just "non-preferred" ways and that C++ is not without it's shortcomings and hidden pitfalls. After all, there is a reason that any style guide for C++ will include a large list of features that should not be used. I love the language and use it alot... but sadly, in many ways, this FQA is just too true.
- yid 12y agoYou're just reinforcing the parent's point. Take this sentence: > <PROGRAMMING_LANGUAGE> is not without it's shortcomings and hidden pitfalls. After all, there is a reason that any style guide for <PROGRAMMING_LANGUAGE> will include a large list of features that should not be used. This holds true of pretty much any language. Take a look at Google's extensive style guide library [1]; they all contain language features that should be avoided for any language. It all just reflects the iterative nature of programming language design. [1] http://code.google.com/p/google-styleguide/ http://code.google.com/p/google-styleguide/
- jzwinck 12y agoLook at Google's Python Style Guide: http://google-styleguide.googlecode.com/svn/trunk/pyguide.html http://google-styleguide.googlecode.com/svn/trunk/pyguide.ht... There is almost nothing in there that sounds like a landmine. Rather, some general guidance about "don't use global variables," "x may not be thread safe," and "don't write overly complex lambdas." My favorite "gotcha" in Python is using e.g. a list as a default argument. That's in the guide, and it sucks, but Python has surprisingly few such problems for newcomers.
- YZF 12y agoI can think of two landmines that make most C++ issues pale. First is things blowing up at run-time due to typos or syntax errors. Second (related) is that you can't safely refactor because you don't really know the types that functions take or where they're being called from. Sure C++ can be a pain but you can build and maintain very large software in C++. It's a lot harder to do in Python (without taking other considerations into account).
- ajross 12y agoTo be fair, YosefK's FQA is a truly great piece of work, and something that every seriuos C++ developer really should read and internalize. The criticisms in it, both of the language and the culture around it, are biting and valid. And it's a fun read too. Really I think one of the best things to be pointed out about C++11 is that YosefK's response is... a little disappointing. Sure, he makes some good points (I liked the "array[5]={0};" mistake), but really this isn't nearly as strong an indictment as the original was. Frankly modern C++ is a huge step forward (though obviously traps remain), and this is as good evidence as we'll see.
- fsloth 12y agoI get the feeling the anguish arises from working with a large codebase with varying quality of developers. For me the main problem of C++ as a language is that it is marketed as a general purpose programming language while in reality only particular types of developers are capable of using it properly in an industrial context. You have to be an a) expert with b) a good taste or the whole codebase will in time become unmaintainable and/or unstable, or both. And even in the best case scenario there will be horrible bugs arising from some minutiae you forgot to take into account. The expert part is required just to cope. The good taste part comes from the requirement that other people must comprehend your code. i.e. it needs to be simple, pithy and correct. Some languages make it more obvious how to reach this goal than others, while in C++ I see this being mostly the result of trial and error. You require taste, restraint and experience not to implement your production solution in some unmaintaineable template-class-Gang-of-four mishmash "just because you can" and because "it's the C++ way". The main problem with all this, IMHO, is C++'s continuing popularity. There are some problem contraints where it still is the best tool for the job but those contraints should be well understood and realized when selecting it as the implementation language. > C++ works great for millions of programmers who get it I feel this is a huge productivity loss for the industry as a whole. C++ creates a huge bureaucratic burden on the developers where they must spend their efforts to trivial minutiae and not in value adding work. C++11 improves on this considerably, though. I do not presume to impose some other language on those developers - rather my point is that the issues the FAQ author raises are real and that since lots of people are using the language the severity of these issues is multiplied by the number of people using it. Note: I'm a developer who mostly writes C++ in an industrial context :).