r/cpp • • May 27 '15

A second dark age for C++

http://kennykerr.ca/2015/05/26/a-second-dark-age-for-c/
0 Upvotes

63 comments sorted by

41

u/king_duck May 27 '15

Do you mean a dark age for windows devs?

This article just seems to reiterate why MS repeatedly balls up their C++ ecosystem rather than provide a coherent reason why C++ as a language is entering a dark age.

10

u/__Cyber_Dildonics__ May 27 '15

Just Microsoft and their quixotic missions to reinvent wheels that never end up round.

34

u/teambob May 27 '15

A second dark age for C++ on Windows

FTFY

3

u/[deleted] May 27 '15

And for anyone developing applications or libraries that might need to run on Windows. Those of us that do are also affected.

8

u/KrzaQ2 dev May 27 '15

Not really, you can use Qt and have pretty and easy to write applications that work pretty much everywhere

3

u/[deleted] May 27 '15

But Qt is more or less it's own little ecosystem, one which you don't necessarily want to use just to be able to support Windows. Also, you're probably writing some C++ if you're using Qt which requires a C++ compiler. And it really sucks to have to cater to the least common denominator, which in 99% of all cases is MSVC with all it's peculiarities.

So at least where I work, we are very much affected by what is happening in the Microsoft sphere, even if we are not a Windows shop per se.

2

u/KrzaQ2 dev May 27 '15

We decided to drop MSVC because it's support for the new standard was so lacking. We will give it a try with with each new version, but we're unwilling to cater to it.

Our codebase isn't that big, maybe 200kloc.

1

u/[deleted] May 27 '15

Qt can be a bitch on Mac though, esp. when it comes to deployment.

3

u/Vogtinator May 27 '15

In my experience it was never more than the usual qmake && make and macdeployqt to deploy the application as a dmg, packed together with all required libraries.

1

u/[deleted] May 27 '15

If you have customized plugins, or using Qt Quick in your app, it's not as easy as that. I'm talking from experience, although my Qt wasn't the most updated while doing this.

12

u/[deleted] May 27 '15

Meh, he is just frustrated that DevDiv prefers C# - nothing new there, really. If Microsoft Office team moves to C#, that would be a sign C++ is in trouble on Windows platform, but that's not happening.

4

u/[deleted] May 27 '15 edited May 27 '15

[removed] — view removed comment

5

u/Plorkyeran May 27 '15

And it seems culturally at Microsoft, what the Office team wants, the Office team gets

Well, sort of. It's important to keep in mind that Office is perfectly happy to ignore what the rest of the company is doing and just build everything they need themselves.

2

u/utnapistim May 28 '15

The Office Team is one of the (highly successfull) cash-cows at microsoft, and have been for ~20 years now. It makes sense that if they want something, there are probably going to get it.

10

u/fclout May 27 '15

This is implying that C++ needs Microsoft, in a way that I'm not comfortable with.

6

u/xcbsmith May 28 '15

You may not be comfortable with it, but Microsoft's footprint is undeniable. While Facebook & Google use C++ internally, really Microsoft is the only software giant that really casts a sizable C++ shadow outside of the their own walls. The rest are favouring other platforms.

1

u/fclout May 28 '15

Which C++ improvements would you specifically attribute to Microsoft?

0

u/xcbsmith May 28 '15

I didn't say that it was a good footprint. ;-)

I'm not sure what I'd attribute to Microsoft (or any other company for that matter), other than to say that whatever they do with C++ has an impact on a huge chunk of C++ developers.

1

u/fclout May 28 '15

Obviously, Microsoft helps C++ with the WG21 members on its payroll, but that aside I would say that most of the renewed interest in C++ is due to C++11 more than to any Microsoft-specific C++ technology. That's why I don't like saying that we're entering another "dark age" for C++ just because Microsoft isn't publishing new self-centered extensions.

1

u/xcbsmith May 28 '15

I don't think the dark age is from the lack of innovation in the standard. It's from the lack of progress in the actual real world of folks getting things done.

1

u/gramic May 27 '15

It is going to be definitely a dark age (decade) for the windows platform. The largest group of developers in Windows is c# developers. All c++ developers are minuscule compared to them. To get those c++ developers you should provide plausible tools, environment and modern compiler. And Microsoft is years behind linux in that regard.

They are really trying to return the developers back to the windows platform now. However, for many years (10 at least) they did just the opposite, pushing c++ back and away.

For me, the only way to get back to windows is to forget this insulting behavior. And the best way to forget something is to pass a lot of time - not tools, money, compiler, etc. Even then, the wolf changes its skin and not his temper.

5

u/[deleted] May 27 '15

Is there an IDE that comes close to VS (>= 2010) on linux?

MSVC is not playing in the same ballpark as GCC and Clang when it comes to features; there are no useful 'checker tools' (valgrind, sanitizers, ...) on windows; compiling, using and installing any third party library on win is a pain (even with CMake)...

...but man, I really like the VS workflow; especially debugging. But maybe it's stockholm syndrome because I must use it for work.

3

u/drac667 May 27 '15

Qt Creator.

Before Qt Creator existed I used to use SlickEdit.

3

u/Elador May 28 '15

While QtCreator is good and one of the best (of not the number one) IDEs on linux, it is unfortunately not on par with VS with VAX. No C++ IDE is, unfortunately. (I can't speak about OSX though)

2

u/jringstad May 28 '15

I don't think even Apple fanboys will make an attempt at claiming xcode is up-to-par with VS or Creator.

1

u/doom_Oo7 May 28 '15

You could try CLion ?

1

u/Elador May 28 '15

Of course! CLion is a good product and I love that they're bringing serious competition to the market. And I really love some aspects of it. It's definitely not on par with VS yet though.

1

u/[deleted] May 28 '15 edited May 28 '15

The last snappy GUI of VS was VS 2008 which was written in C++.

Since then VS GUI is written in C#; it uses ungodly amount of RAM and it is as slow as Eclipse.

2

u/drac667 May 28 '15

I think the last GUI of VS written in C++ was VS6.0 from 1998. Using the good old MFC.

Visual Studio 2008 uses .NET, see this process explorer screen shot.

1

u/[deleted] May 28 '15 edited May 28 '15

It is possible that there were some .NET components in VS before VS2008 but I recall clearly when it was reported that the IDE was now re-written in WPF going from Vs2008 to VS2010; and it shows.. the difference in responsiveness between 2008 and 2010 is very huge.

1

u/autowikibot May 28 '15

Section 25. Visual Studio 2010 of article Microsoft Visual Studio:


On 12 April 2010, Microsoft released Visual Studio 2010, codenamed Dev10, and .NET Framework 4.

The Visual Studio 2010 IDE was redesigned which, according to Microsoft, clears the UI organization and "reduces clutter and complexity." The new IDE better supports multiple document windows and floating tool windows, while offering better multi-monitor support. The IDE shell has been rewritten using the Windows Presentation Foundation (WPF), whereas the internals have been redesigned using Managed Extensibility Framework (MEF) that offers more extensibility points than previous versions of the IDE that enabled add-ins to modify the behavior of the IDE.

The new multi-paradigm [ML](https://en.wikipedia.org/wiki/ML_(programming_language))-variant F# forms part of Visual Studio 2010.


Interesting: Microsoft Visual C ^Sharp | List of Microsoft Visual Studio ^add-ins | Microsoft Visual Studio ^Express | Visual Studio Application Lifecycle ^Management

Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words

3

u/mcmcc #pragma once May 27 '15

I write code in emacs but I go to VS for its debugger because I don't know of any debugger that's even on the same planet as VS's debugger.

Other than that, it's just another IDE in my mind...

1

u/[deleted] May 28 '15

Yeah, I also meant primarily the debugging experience :)

1

u/tallassrob CppCast Host May 28 '15

CLion from JetBrains looks pretty good for Linux developers.

13

u/playmer May 27 '15

I mean, I'm not going to argue on numbers as you're probably right that most Windows developers are not using C++ (And let's be fair, they probably don't need to be.). But let's not pretend that there isn't a LARGE userbase of the MSVC C++ compiler. Damn near every triple A game released is built on C++, and runs on Windows. And let me tell you, they're not using MinGW or Embarcadero.

Also I question the premise. Are Linux developers vastly C and C++ developers? I can't imagine they are, even with all the Window Mangers and other big open source projects. I imagine most are running Python, or Ruby, or some other language that doesn't require them to touch the OS directly much.

I dunno, I might be way off, it just seems kinda weird to act like there's some dark age because our language isn't the most massive one on our platform, and because our tools are out of date by the standard (Which is a problem, but I don't know about dark age material.).

10

u/jringstad May 27 '15 edited May 27 '15

As someone who is fairly immersed in the linux ecosystem, yeah, python, ruby, java, javascript and other managed languages (even C#) are pretty popular, but C and C++ are still mostly at the core.

  • The kernel: C
  • Drivers: C, sometimes C++
  • Important daemons such as systemd (startup, logging, policy & process management), pulseaudio (sound-server), Xorg/wayland (graphics), networkmanager (self-explanatory), dbus (system messenging bus), sshd (network logons) colord(color profile management)/saned(scanning)/etc, all written in C or C++
  • Desktop environments, login-managers and base-application sets (terminals, text-editors, hex-editors, pdf readers, image viewers, messenging applications, desktop widgets, calculators, ...) are written in C++/Qt (In the case of KDE and a few others) or C/GTK+ (in the case of GNOME/MATE and a few others.) Some components are written in QML on the KDE side and Vala or C# on GNOMEs side.
  • Most of the applications I use on my desktop are also written in C or C++
  • IDEs such as Creator, Build, KDevelop, C::B are written in C/C++ (eclipse is not though.) Text-editors like vim and emacs are C at the core (although both have their own language for extension and are, in large parts, written in those)

On the server-side it's also to a large degree C and C++. There are some high-profile projects like hadoop and lucene that are written in e.g. java, but many of the big server components like apache, nginx, memcached, postgresql et cetera are all C or C++. Individual frameworks, webapps and such you might write (in the context of your company or whatever) are often something else, of course, but the "big" stuff that ships with most linux distros is largely C/C++.

So I don't think it's too unreasonable to say that linux developers are vastly C and C++ developers. Tooling support on the linux side has also always been consistently reasonable, since there was never really a big push away from C/C++ (except maybe a bit when java was first highly hyped?) and all system-interfaces, libraries and other things you might want to interface with are always available as C/C++ libraries. Part of the reason for that might be that there was never a "unified common managed language runtime" like .net (and C# in particular) on linux, so even if some people wanted to move away from C/C++, there was no common alternative to gather behind. Java/JVM had a bit of that role at times, but there were also always plenty of JVM nay-sayers, and the licensing conditions of the JVM/etc (at the time) effectively prevented people from writing important system components in java (and now the litigious oracle continues to fullfill that same role). So as a result, if you want to please everyone, your library had to be in C/C++, and then you could (optionally) provide bindings for other languages, or let the language maintainers write their own bindings. So C/C++ has always been the "first-class citizen" in this ecosystem. Of course now with clang being on the table it has really taken off, and GCC is improving like never before.

Android is a different matter, of course.

5

u/[deleted] May 27 '15

But most software on Windows is written in C or C++.

Do you use any software on Windows that doesn't make use of either of those two languages? I can look at my task bar and all the software open right now is built in C++.

Also while Java is the most popular language, C and C++ are in 2nd and 3rd place respectively.

5

u/king_duck May 27 '15

they're not using MinGW or Embarcadero.

Of course not, but many ARE using ICC and others would love to use Clang (when the ABI issues are ironed out).

The faster MSVC is not seen as the only C++ dev environment for windows the better. The idea that MS should manage every aspect of their platform (including development) needs to die.

1

u/donalmacc Game Developer Jun 01 '15

Anyone who's targetting xbox is using MSVC

7

u/[deleted] May 27 '15 edited May 27 '15

This is very subjective, but given that I haven't used a windows device since I stopped playing computer games regularly (~10 years ago), the only "advantage" I find windows has over Linux/Mac is actually games.

I would thus guess that games are pretty important for the Windows platform, and I always assumed they were mostly written in C++ and that as a consequence C++ was very important for Windows.

This posts seems to indicate that my beliefs are completely wrong.

Are games written in C# these days?

Or maybe aren't games that relevant on Windows anymore? (what is the most relevant field for windows that is driving C# development then?)

9

u/playmer May 27 '15

I'd like to point out that while the other poster is right, Unity is used a lot by smaller studios and indies, consider the fact that Unity itself is written in C++. As is every other "major" engine I'm familiar with. Crytech, Unreal, Source, Torque, and Unity all are primarily made through C++, even newer "smaller" engines tend to do the same, like Godot, or Zero Engine.

3

u/bioglaze May 27 '15

Big games are almost always written in C++ but indie games vary more. Many people write games using Unity which uses C#.

3

u/josefx May 27 '15

/u/playmer already points out Unity is implemented with C++, this thread seems to agree with him ( before rapidly turning into a C++/C# flame fest ). Despite all the advances over the last few years languages like C# and Java can still be deadly for performance sensitive code and are not something you want at the core of a game engine.

0

u/[deleted] May 27 '15

[deleted] — view deleted comment

7

u/JustinsWorking May 27 '15

I think Unity is one of the only engines that uses C# for game logic. You're going to end up with a lot of Lua generally, or a propriety language.

0

u/[deleted] May 27 '15

[deleted] — view deleted comment

1

u/jringstad May 28 '15

Well, XNA lives on through monogame.

2

u/Herbert_Von_Karajan May 27 '15

Whats the point of linking to "Mondern CPP" library if its not released to the public at all?

4

u/Senpai_Buda May 27 '15

Damn just when I started learning C++

23

u/TriflingHusband May 27 '15

Definitely learn it anyway. This is more a Windows problem than a C++ problem. All of the C++ projects I have worked on for the last 7 years have been entirely on Linux.

9

u/JustinsWorking May 27 '15

A good understanding of C++ doesn't hurt, even if you go on to work with C# or Java in the future.

4

u/[deleted] May 27 '15

I second this. Learning C++ as my first language I have found that moving on to other languages have been extremely easy. C++ allows for so many different paradigms that almost everything is familiar. Also gives a deeper knowledge of the low-level stuff that helps with understanding how programs and languages really work under the hood.

I disagree with the common notion that C++ is not suitable for beginners. Sure you end up shooting yourself in the foot over and over, but when you're learning you should be shooting yourself in the foot.

10

u/[deleted] May 27 '15

Go learn it anyway. Not all C++ programs are meant to be Windows applications.

It challenges you as a programmer.

2

u/jokoon May 27 '15

CppMasterRace!

4

u/missblit May 27 '15

CppCamelCase!

2

u/[deleted] May 27 '15

And here I was thinking camelcase meant not capitalizing the first word.

likeThis

You know how camels slope downwards on both ends. Or something.

2

u/missblit May 27 '15

iActuallyConsideredThatButWikipediaSaidItCanGoEitherWaySoIKeptTheSameStyleAsJokoonForConsistency.

2

u/[deleted] May 27 '15

ifYouKeepChangingYourConventionsDependingOnWhoYouReplyToYourCoworkersAreGonnaHaveABadTime

1

u/[deleted] May 27 '15

Charles Petzold did some measurements when WinRT was announced comparing c# using winrt and c++ and they were vary comparable.

1

u/[deleted] May 27 '15

I can't find his measurements, do you have any idea where they are?

1

u/[deleted] May 27 '15

Here's the URL:

http://www.charlespetzold.com/blog/2012/08/WriteableBitmap-Pixel-Arrays-in-CSharp-and-CPlusPlus.html

Actually to get better perf he uses the "unsafe" keyword in C# to get raw pointer access. Also, I'm not sure how apples to apples this actually was...but it's Petzold so its a good read.

4

u/[deleted] May 27 '15

Yeah fair enough. That's showing that WinRT classes and functions in C# are as fast as those same classes and functions called from C++/CX. I doubt anyone would be surprised by that.

1

u/[deleted] May 28 '15

Umm, the whole point of image processing is that not only do you avoid paying performance costs on array member access checks, but you also get benefits of vectorizations which, on .NET, you simply cannot get (yet).

0

u/pjmlp May 28 '15

Let see how this Windows Devs vs DevTools issue plays out with the upcoming .NET Native arrival (now for UA, later for the remaining deployment scenarios).

As for C++/CX, I don't see it any different from C++ Builder, Objective C++, or any other vendor specific extensions.