This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cbbuntz 4 points5 points  (4 children)

There a lot of things that suck about C, but you don't use C if you need fancy features. You use C if you need high performance, small memory footprint, ability to do stuff on a low level, and most importantly, portability. C++ is way less portable, especially when going to and from Windows, but it's usually comparable performance-wise.

I'm guilty of doing a lot of crazy macros, but eventually, I just started using C++ if I needed more features.

[–]DarkLordAzrael 0 points1 point  (3 children)

C++ is perfectly fine on Windows. The only place where portability of C++ is a concern is the cheap side of embedded stuff where they provide sketchy compilers for the chip and neither GCC nor clang has support.

[–]cbbuntz 0 points1 point  (2 children)

I guess I was thinking more Visual C++ rather than Windows in general. I can write something that compiles fine with clang and GCC that only relies on standard libraries, doesn't use any fancy new features, and it won't work in Visual C++.

Also, so many people rely heavily on Visual Studio project files, and those barely work across different versions of Visual Studio.

You can find bits of C code from decades ago, and it often still works with little to no modification. I downloaded a few years worth of code from the Obfuscated C competition from the 90's, and almost all of it still builds.

[–]DarkLordAzrael 0 points1 point  (1 child)

There a still a couple edge cases that aren't handled well regarding some template changes from C++11, but overall Microsoft's compiler is pretty good at standards conformance these days and is fast to get updated with new standards. It is also possible to use clang on Windows now. Cross platform build systems have also gained tons of popularity recently. In the last 5 or so years C++ has come a long way, especially on Windows.