6 ms·
It's too late for C++ to regain popularity. C++17 features will become widespread in next 3-4 years (C++14 isn't a common standard yet). Moreover, the language
by wmu 10y ago
It's too late for C++ to regain popularity. C++17 features will become widespread in next 3-4 years (C++14 isn't a common standard yet). Moreover, the language has become incredibly complicated and sadly doesn't provide anything that would reflect modern needs.
- koko775 10y agoRegain popularity? It never lost popularity in the areas it was a good fit for. It's still a great fit for certain kinds of code that requires high performance or low overhead.
- wmu 10y agoI meant that despite the claim that C++ is a general purpose language, it is not popular among average developers. People would choose for a new project C#, Java, Go, Python, Scala or Javascript, but not C++.
- pjmlp 10y agoUntil they need to call into OS APIs, launch a GPU job, or do some kind of critical optimizations.
- gumby 10y ago> I meant that despite the claim that C++ is a general purpose language, it is not popular among average developers. People would choose for a new project C#, Java, Go, Python, Scala or Javascript, but not C++. ...despite claim that the light truck is a general purpose vehicle...people would chose for a new vehicle a bicycle, car, aircraft, motorcycle, or tank... Use the right tools for the job. C++ is intended to be a general purpose systems programming language. An excellent tool for a wide variety of tasks, but not the be all and end all. I am right now working on a library built in C++ and although I also have written some utility programs for the system in C++, its main interface is intended to be through (swig-enabled) Python and Common Lisp.
- wmu 10y agoYou know C++, you're not an average programmer. Entry level into the C++ world is too high for a regular programmer, they would choose something easier. That's the point.
- TillE 10y agoMSVC already supports many key C++17 features. GCC and Clang do almost all of it. I wrote C++98/03 for years and kind of hated it. I love C++11/14. I've tried Rust and other languages, but C++ is such a good choice these days.
- wmu 10y agoWe compile our product with GCC, Clang and MSVC, and we need some #ifdefs. MSVC for years was far behind GCC/Clang, recently Microsoft did a really good job and they catching up. But some #ifdefs are still needed. :) I agree that C++11 was a leap (older C++ was terrible). However, both C++14 and C++17 are just a sets of smaller or bigger improvements.
- Koshkin 10y agoI have never understood this stance 'C++ was terrible'. Even with the introduction of destructors - and exceptions! - C++ became way ahead of other languages of its time and almost instantly secured its well deserved place in the minds of programmers.
- wmu 10y agoOK, maybe "terrible" is too strong adjective. What about "cumbersome"? :) C++11 allowed to get rid off many silly workarounds and introduced, among many others, threads and rvalues.
- pjmlp 10y agoIt was, but mostly regardig portability. One of the reasons I found some pleasure writing Java instead of C++, even before it got a JIT, was the portability story. Writing portable C++ code across the many commercial compilers available back in the days when the only standard was the C++ARM book, wasn't particularly fun.
- pjmlp 10y agoIt is still the official Infrastructure language on the SDKs in OS X and its variants (IO Kit, Metal shaders, LLVM), Android (NDK, ART implementation, LLVM), Windows (DX, UDK, UWP, C++/CLI, C++/CX), Game engines (Unreal, Unity, CryEngine, Godot). So it might not be popular, but any alternative, currently, means more work due to FFI layers, less tooling support regarding IDEs and debugging infrastructure. We should support those more modern alternatives, however also be realistic that only in the last five years or so, many companies have started to move from C into C++ (e.g. BMW, Sony,...), and they will take a few decades to switch to something else.
- krylon 10y agoI am not a fan of C++, believe me, but I as far as I can tell C++ is quite popular in the sense that it is used a lot - all major web browsers are written in C++, for video games it is the language of choice, both Windows' and macOS' kernels are written in (a subset of) C++, lots of desktop applications are written in C++, and that is just the stuff I happen to know. I am glad I do not have to deal with C++, for the very reasons you mention, but as far as I can tell, it is fairly popular already.
- wmu 10y agoC++ is my bread and butter. I neither hate or love the language, just use it and observe the way it is evolving. C++ is still popular because there are a lot of existing projects; nobody would throw away their products. Many things were standardized too late, like threads or strings. Lack of standard solutions had led to produce custom ones, often proprietary. Nobody would rewrite working-for-years subsystem just because C++ finally learnt what a thread is. Another example is variety of incompatible build systems; I wish C++ had something similar to PyPi or CPAN (I even don't dream about Go-like import system). Not to mention incompatible compilers, but I must admit there is a progress. C++ has many substantial problems and when I see that the committee wasting time on such unimportant things, like a 2D graphics library, it makes me upset.
- pjmlp 10y agoA 2D library is important, back in the day all C++ compilers on home computers had one. The goal is not to replace SDL, rather provide a portable way of doing basic 2D graphics. The C culture of leaving the libraries to the OS was one of the reasons why C++ got a chaos of interoperability issues, letting other languages that understood how that is relevant to gain mindshare in the late 90's. C++ needs its batteries.
- fnj 10y agoGraphics is IO, not language. There is absolutely no reason for it to be bloating the language itself.
- jeremyjh 10y agoFirst, all the compilers already implement pretty much all of it. I'm not sure if by widespread you mean "included in a distribution" but you can use these features today, if you want to install a compiler. Second, C++ is popular by pretty much every measure I could think of. Whether you want to measure lines of code, or number of projects, or number of developers - it is very high on the list. It is true that is not popular with web developers and gets shouted down in those echo chambers, but the web entirely runs on C++ because all browsers are written in C++.
- wmu 10y ago> First, all the compilers already implement pretty much all of it. I'm not sure if by widespread you mean "included in a distribution" but you can use these features today, if you want to install a compiler. Of course, I can install any compiler, but my employer might not allow me to use it. Porting to a new compiler is not an easy task when a code base is large; we postponed porting due to lack of time. > Second, C++ is popular by pretty much every measure I could think of. Whether you want to measure lines of code, or number of projects, or number of developers - it is very high on the list. More interesting measure would be the number of new projects. > It is true that is not popular with web developers and gets shouted down in those echo chambers, but the web entirely runs on C++ because all browsers are written in C++. In web backend C++ is not used. You find there C#, Java, PHP, Python, maybe Go.
- pjmlp 10y agoC++ is surely used in the backend, but as library languague integrated into the languages that you mentioned. Every now and then, I integrate a native library into our Java and .NET projects.
- fnj 10y agoIf you have to "port" your code from one C++ compiler to a new C++ compiler, then they are not both true C++ compilers per standards, or your code is not pure standard C++.
- 10y ago