7 ms·
> He explains that the languages should have been merged into one, so that C would have been a subset of C++ instead of nearly a subset of C++. Thank the stars
by divtxt 15y ago
> He explains that the languages should have been merged into one, so that C would have been a subset of C++ instead of nearly a subset of C++.
Thank the stars this didn't & won't happen!
Bjarne has been stuck in "C++ is the best & only language anyone needs" long after the world has moved on to Java, C#, Python, Ruby, JavaScript, etc.
C occupies a sweet spot combination of:
- low-level with "no magic"
- small enough for most people to "hold in your head"
C++ matched these conditions for a brief time in it's life - the early 90s aka "Stroustrup 2nd edition" - when the only "magic" was basic virtual functions, and templates where just a promising experiment in an appendix.
- randombit 15y ago> when the only "magic" was basic virtual functions What's "magic" about structs of function pointers? This is a classic idiom in C, just given a specialized syntax in C++.
- bigfoot 15y agoWith that argument you could invalidate any high-level language construct. They're all just "specialized syntax" of classic idioms in Assembly.
- randombit 15y agoExactly. And nobody thinks that for loops are "magic".
- rogerbraun 15y agoNo, but for loops are simple. Classes are not that simple. Of course, no feature really is "magic". But there are a lot of features that may be easy to use but hard to deeply understand. Take for example the attr_accessor method that Ruby uses to make variables pseudo-public. Most beginners coming from Java think that it is a language keyword, similar to "public". In fact, it just writes getters and setters for you. Of course, everyone could just write their getters and setters themselves, but this is just what language is: A way to abstractly tell a machine what to do. And if you don't know how it works (and maybe even don't need to know), you can call it "magic".
- zerostar07 15y agoThen again, browsers are written in C++ and so are almost all GUI apps. We spend most of our time with software that is developed in C++, probably for a good reason
- xyzzyz 15y agoso are almost all GUI apps This claim is clearly false on Mac OS X and X Window platforms, and disputable on Windows, with the increasing share of .NET apps.
- berkut 15y agoNo it's not - there's a reason Qt is one of the most mature and well used GUI toolkits in the world by professional desktop software...
- xyzzyz 15y agoHow is wide usage of Qt relevant to the claim that almost all GUI apps are written in C++?
- cppsnob 15y agoPlease, name a .NET app that is widely used on Windows.
- dextorious 15y ago"""This claim is clearly false on Mac OS X and X Window platforms, and disputable on Windows, with the increasing share of .NET apps.""" Actually it is not. On OS X tons of programs, and especially the very largest, most popular ones, are in C++ (think: Photoshop and the Creative Suite, MS Office, and lots of Apple's own: Safari (webkit) is C++, Final Cut and Logic are C++, etc. Don't confuse the front-end UI code (Cocoa) with the backend. C++ is a first class language in XCode, and you can mix it with Obj-C as Objective-C++. On X Window platforms: besides KDE, some of the most important apps are C++, including Firefox, Thunderbird and Open Office. On Windows there are almost no .NET apps that people actually use --people as end users, as opposed to corporations. Most of the popular stuff, from games, to office suites, to design suites, to browsers, etc are C++.
- oneofthose 15y ago> long after the world has moved on to Java, C#, Python, Ruby, JavaScript, etc. I don't think this is true for everyone. In fact I believe recently we have seen a renaissance of native code. C++ is the number one language for that. Those higher level languages waste a lot of cycles. You pay the warm and fuzzy feeling during development with performance and/or energy.
- rbanffy 15y agoI used this argument for Java, but it's the same with C++. If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C. If we are talking gadgets with embedded software, you may use a less powerful hardware and offer a cheaper product, but you'll have to amortize higher development costs and deal with a longer time to market. For many things the world really moved on. C and C++ are still important, just not as important as they were a decade or two ago.
- dextorious 15y ago"""I used this argument for Java, but it's the same with C++. If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C.""" Yeah, the only problem with that logic is that it never happens. (Except in the server space, where it doesn't matter what language you're using to make your web app, and you can throw more server boxes at it to make it go faster). 1) Very few commercial programs are made with some dynamic language as opposed to C/C++, and none in the fields where performance matters (games, video, multimedia) etc. 2) Some do incorporate a scripting language, but for non critical layers (Lightroom for example uses Lua for its UI scripting, but all image crunching is in C/C++). 3) It's not like time to market matters that much. You're not building Facebook, you're building a desktop app. Chances are a lot more exist in the same section of the market. 4) """For many things the world really moved on.""" --care to give some examples of successful desktop apps not written in C/C++? I'm sure you'll find 10. I doubt you'll find 20.
- berkut 15y agoHere we go again... C++ is used heavily from everything from Games, VFX programs (modellers, renderers/raytracer, compositors, paint programs), autopilot and control systems (cars, fighters (JSF), SpaceX are using it for their systems on their rockets), database systems, webservers, etc, etc. There's a reason it is used a lot - in the real world it gets jobs done well by people who know what they're doing with it. Saying "the world has moved on to Java, C#, etc, etc" is pushing it, given that the base system for many of those things are written in C++ (most of the native JNI stuff is C++, most Javascript compilers/interpreters are C++, many databases (Oracle, MySQL, MongoDB) are written in C++. You may not like C++, and it might be difficult, and it may have worts, but thousands of people are using it very successfully for things no other language can do to the same degree overall.
- divtxt 15y agoMy bad - "the world has moved on" was too strong. I meant something like: other languages have risen in popularity because they are better than C++ for many types of projects.