8 ms·
There appear to be a lot of good rants against C++. To name a few: * Linus Torvalds : http://lwn.net/Articles/249460/ http://lwn.net/Articles/249460/ * C++ F
by kqr2 16y ago
There appear to be a lot of good rants against C++. To name a few:
* Linus Torvalds : http://lwn.net/Articles/249460/ http://lwn.net/Articles/249460/
* C++ Frequently Questioned Answers : http://yosefk.com/c++fqa/ http://yosefk.com/c++fqa/
Are there any good passionate pro C++ versus C arguments?
- lanstein 16y agohttp://www.odgaard.org/jeod/funny/interview.html http://www.odgaard.org/jeod/funny/interview.html
- alanh 16y agoWell, Bjarne Stroustrup has a rant on C++! But it’s not actually pro C++. (It’s also fictional, but a very amusing read.) http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml
- btmorex 16y agoThe best pro C++ argument is that for all its flaws there's nothing out there that completely replaces it and it's still widely used. My own view: I'm not in love with C++, but it's not nearly as bad as everyone makes it out to be. Most of the arguments I hear against C++ are the same tired things I've heard hundreds of times. They all have a grain of truth, but nothing so bad as to condemn the language.
- weilawei 16y agoIt's not that any one thing is bad. It's that lots of things are bad.
- joe_the_user 16y agoLots and lots of things are bad in C++. But that's because it's an elaborate language with lots of things in it. You only have to use one bad thing at a time ;-). Basically, any language with lots of modularity and lots of low level access is going to be big and have lots of features that are problematic in some situations.
- loup-vaillant 16y agoSay you need both modularity and low level access in a given program. Can they be so entangled that you absolutely have to put both in the same language? No matter how I put it, I fail to see how C++ can be better than C + (Python or Lua or Haskell, with FFI). Is the concept of using 2 languages at the same time so scary?
- dan00 16y ago"Say you need both modularity and low level access in a given program. Can they be so entangled that you absolutely have to put both in the same language?" That's not always an option if you've performance and memory constrains. We're using Python only for high level scripting purposes. If you've a performance critical function, where few data goes in, long computation and few data out, then it's perfect to implement this function in C and have a python function calling it. But if you've a lot of data, then that's not an option. You just can't copy all the data to C and then after computation back to python, it will kill the performance gained by the C function implementation. But also if you're trying to do complex operations on your application object hierarchy, Python will kill your performance. Only compare the time for a member/property access in Python and C++.
- T_S_ 16y ago| Is the concept of using 2 languages at the same time so | scary? Yes, but it seems to be inevitable. Python + C. Haskell + C would be my choices for large scale modeling/data analysis. For apps involving a GUI, I would like to hear others thoughts.
- joe_the_user 16y agoIs the concept of using 2 languages at the same time so scary? In all honesty, yes. But consider this also. The advantage of C++, such as it is, is that the big, harry objects you are creating can call each with just about any calling conventions you chose and you can parameterize them at run time and compile time in whatever crazy way you'd like (pointers, templates, static objects, classes and ponies! (Ponies will only be standardized in C++_2015)). This is why Python, Lua and all each call c/c++ for extensions. But while there are many interesting scripting languages out there, there's no guarantee that any of these languages' calling convention, memory usage and constraints will be what your large objects need. Specifically, to effectively use a particular higher-level language you'd have to know from the beginning that said language's conventions would satisfy your needs from beginning to end. Add to this the fact that C++ may not be a "good" programming language but that it's not that bad if used with discipline and understanding. The badness of c++ comes from the many, many ways you can shoot yourself in the foot - it still doesn't force to do anything. But how many subtle bugs can creep in if you're sloppy in passing raw pointers to some other language? And using any higher level language will involve forcing yourself to do a number of things that could prove problematic.
- deleted 16y ago[deleted]
- joe_the_user 16y agoMy short rant: C++ is as bad as they say it is. It is horrible, it is the worst language in the world ... except for all the other (a la Winston Churchill and democracy). The horrifical complexifications of C++ are just terrible, yet every one of them has a reason behind it. And also, the horrifical complexities are a bit more optional than the horrifical complexities of, say, Java. There isn't another language that has both the large-scale modularization given by OO and low-level efficiency of direct pointer manipulation and other C features. You get a vast library of available free code and a huge number of available tools to boot. There is no other language for crafting large-scale, high performance tools. Java and C# can be just as fast but even fast Java has even greater verbosity overhead. And the scripting languages are great yet their resource overhead makes up for their compactness. C++ is definitely a language of "big design". "Thinking in C++" is a mistake. You should think in your design and implement in C++. Unlike C, C++ seduces people to take the code for the design. In any case, however flawed, the thing occupies a niche no other language can. I'm sorry.
- jshen 16y ago"There isn't another language that has both the large-scale modularization given by OO and low-level efficiency of direct pointer manipulation and other C features." Objective C?
- GreenMan 16y agoArguably this might be true, however if you add another requirement to the list Joe posted it isn't. Cross platform code is important to many people. I work on large scale, performance intensive, cross platform applications. Microsoft tells me I should be doing everything in C#. Apple tells me I should be doing everything in Objective C. I just get on with it and use something that works. A language that gives me the ability to combine high level design with low level efficiency and run on multiple platforms. I often use a paraphrase of the Winston Churchill quote as well. There are probably many better languages for many other applications, however for high performance, cross platform large scale apps C++ is still the only game in town. Joe's point that all the complexities have reasons behind them is a really good one. I'd suggest reading Stroustrup's "The Design and Evolution of C++" for more information.
- timr 16y ago"There appear to be a lot of good rants against C++....Are there any good passionate pro C++ versus C arguments?" By definition, the people who write the "entertaining" rants against C++ have an axe to grind. The people who like C++ just silently use it, and feel no need to write advocacy blog posts for the language. Even if they were to blog about it, it would be about as compelling as someone advocating for their favorite brand of screwdriver. Like it or not, C++ is the incumbent, and it's neither interesting nor fun to read someone advocating for the status quo. Whenever you find yourself arriving at an opinion about a programming language solely from rants that you read on some dude's blog, please keep in mind that you're probably being most heavily influenced by the very people least qualified to teach you anything useful about the language. The internet is filled with useful articles about C++, but you don't remember those. You remember that Zed Shaw couldn't figure out how const works in C++, and once wrote a funny email about it.
- lanstein 16y ago> You remember that Zed Shaw couldn't figure out how const works in C++, and once wrote a funny email about it. source?
- deleted 16y ago[deleted]
- timr 16y agoUh...I'm talking about the content of the post to which this thread is attached, so: http://librelist.com/browser//mongrel2/2010/7/15/c-verses-c++/#770d94bcfc6ddf1d8510199996b607dd http://librelist.com/browser//mongrel2/2010/7/15/c-verses-c+...
- lanstein 16y ago"You'll find crap in C++ like const *const char &, and hell if anyone knows what that really means since even though the pointer to a const to a const reference is consted to hell and back, oh look you can still increment it." I'm still looking for the part where he doesn't understand how const _works_.
- WilliamLP 16y agoIt has grabbed and maintained complete domination of nearly all performance sensitive code in games and desktop software, for nearly a generation now which is an unprecedented reign in computing history. That's a pretty good start to me.
- ericb 16y agoAre you saying that the complete domination claim is also true in comparison to C?
- zedshaw 16y agoYes, I think this is the funniest thing about C++. Everyone who loves it thinks it's the most popular language...well except when compared to C. Basically, until you can kill C your language really isn't that popular. It's a fad by comparison.
- kragen 16y agoI don't know if he's saying that, but yes, nearly all performance-sensitive code in games and desktop software is written in C++, not C. Objective-C seems to be edging in.
- mfukar 16y agoNo. You are mistaken.
- Jach 16y agoSure. http://warp.povusers.org/grrr/HateC.html http://warp.povusers.org/grrr/HateC.html http://warp.povusers.org/grrr/cplusplus_vs_c.html http://warp.povusers.org/grrr/cplusplus_vs_c.html The guy has some fun rants in general. Edit: Oh yeah, and this one, responding to Linus' rant. http://warp.povusers.org/OpenLetters/ResponseToTorvalds.html http://warp.povusers.org/OpenLetters/ResponseToTorvalds.html
- tmsh 16y agoFwiw, from the other day: http://tmsh.posterous.com/you-can-read-the-c0x-faq-in-an-hour http://tmsh.posterous.com/you-can-read-the-c0x-faq-in-an-hou...