5 ms·
"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 "ente
by 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_.
- tedunangst 16y ago"const *const char &" is not valid C++ syntax, so I'm pretty sure you can't increment it. Therefore, anyone saying you can increment it doesn't understand it. QED.
- houseabsolute 16y agoThere's this thing called a joke . . . I believe that's waht Zed is making here.
- GreenMan 16y agoPerhaps you could point out the funny bit.
- zedshaw 16y agoOh, you have to read that in the voice of The Comic Book Guy. Then it's fucking hilarious. Here try it: "You sthee const const &const char[const ] is the proper way to make a thruly safe reference to a conthst char array conthst pointer conthst." See, prime comedy gold there. Also, 'cause you guys think the internet should be nothing but a massive academic white paper curated by Knuth, so any amount of hyperbole sends you into a literalism hissy fit.
- bitwize 16y agoComic Book Guy doesn't lisp like that; although his virtual twin, Go-Bots Guy from Robot Chicken, does.
- sgift 16y agoHe mocks that you can attach const nearly anywhere in c++ and it seems to do something different. (Note: This is a generalization, an important aspect of many jokes)
- 16y ago
- SkyMarshal 16y agoGood advice generally, but what axes do Zed and Linus have to grind? Sounds like both just think C++ enables too much complexity to be worth the benefits.
- zedshaw 16y agoIt's actually possible to make C++ nice, the Grace library is wonderful. If I ever have to C++ again I'm totally grabbing it and using it. The Grace value types and type safe format operations are just the best thing ever. My problem though is it's not the right tool for the job. Simply having access to C level APIs doesn't instantly mean your language is awesome at making servers and operating systems. Especially if that same language can't quite figure out what the hell really happens on a copy, or during an exception, or can't make decent strings and data buffers.
- kaens 16y agoI figure they have the axe of "I used this for a while, and really grew to hate it when I compared it to these other things I used" to grind. Sometimes the technologies you use just make you want to get something off your chest, you know?
- aboodman 16y agoFor some concrete examples of the above: WebKit, Chromium, Gecko, and V8 are all C++. My impression is that there is a very high startup cost with C++ to getting it working on the platforms you want to support and picking the subset that isn't going to screw you. Once you get over the hurdle, the improved memory management (I agree with the post Zed is ranting in response to) starts to pay dividends.
- pvdm 16y agoV8 is hardly a ringing endorsement for C++. Just sayin.
- aboodman 16y agoSomebody below said just the opposite. Personally, I find V8 really nice to read and work with. Which part of it do you not like?
- mace 16y agoV8 is ringing endorsement for V8. It is just a well-designed JavaScript virtual machine. It's performant because it compiles JavaScript to native code and uses generational garbase collection.
- gaius 16y agoThe people who like C++ just silently use it Indeed. At my last job, working on trading software, we had around 35 maths or physics PhDs working on a C++ application. A few had personal blogs (cats, children, steam engines, etc) but as far as I am aware no-one there argued on the Internet about which language was best. C++ just doesn't attract self-publicists the way Ruby seems to.
- bad_user 16y ago> C++ just doesn't attract self-publicists the way Ruby seems to. That's a cheap shot ... Linus Tolvards is definitely not the Ruby-type. And his arguments are sound ... for system programming, C is a much better language because it's simpler, lacks magic, making the pieces of code easier to understand without the bigger context, and it's more portable. And for application-level programming, why would you chose a language without a garbage-collector?
- tbrownaw 16y ago> And for application-level programming, why would you chose a language without a garbage-collector? Because your code uses some finite resources other than memory, and you don't want the ability to forget to release said resources when you're done with them and they go out of scope.
- eru 16y agoWhy should memory management related to managing other resources. Anyway, you might be interested in The Haskell Disciplined Disciple Compiler (http://www.haskell.org/haskellwiki/DDC http://www.haskell.org/haskellwiki/DDC) which lets you statically encode resource management rules. (And of course spots garbage collection for memory.)
- tbrownaw 16y agoYour objects contain/use various resources, such as memory, file descriptors, mutexes, etc. The way to reclaim any of these is to destroy the object, which lets you reclaim all of them. So memory management is very much tied to other resource management, since they both involve the same thing (deciding when to destroy objects you no longer need). Unfortunately not all resources can be collected equally lazily, so memory-centric GC schemes that ignore the requirements of other resources tend to get in the way (and make you do using(){...} or try/finally to make sure your files are closed, instead of allowing for RAII).
- wglb 16y agoWell, lack of advocacy could indicate lack of awareness of other programming languages. Don't the boost guys say that now C++ is the most powerful programming language?