Skip to content

Instantly share code, notes, and snippets.

@a-andreyev
Created July 23, 2021 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-andreyev/d6b0f142679484d04b770ca5734ba020 to your computer and use it in GitHub Desktop.
Save a-andreyev/d6b0f142679484d04b770ca5734ba020 to your computer and use it in GitHub Desktop.

http://harmful.cat-v.org/software/c++/linus

YOU are full of bullshit.

C is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C++ were to do nothing but keep the C programmers out, that in itself would be a huge reason to use C++.

In other words: the choice of C++ is the only sane choice. I know Linus Torvalds unironically said "to piss you off" about C, but it's actually true. I've come to the conclusion that any programmer that would prefer the project to be in C over C++ is likely a programmer that I really would prefer to piss off, so that he doesn't come and screw up any project I'm involved with.

C leads to really really bad design choices. You invariably start using the "nice" library features of the language like GTK and GLib and other total and utter crap, that may "help" you program, but causes:

  • infinite amounts of pain when they don't work (and anybody who tells me that GTK and especially GLib are stable and portable is just so full of BS that it's not even funny)

  • inefficient programming models based on directories and files where two years down the road you notice that some structures weren't very efficient, but now all your code depends on all the nice files and directories around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C ends up to implement all the things that are basically available in C++. And limiting your project to C++ means that people don't screw that up, and also means that you get a lot of programmers that do actually understand data structures and algorithms and don't screw things up with any idiotic "close to the hardware" crap.

So I'm sorry, but for something like Qt/QML, where maintenance and development was a primary objective, the "advantages" of C is just a huge mistake. The fact that we also piss off people who cannot see that is just a big additional advantage.

If you want a GUI that is written in C, go play with GTK. Really. They use a "real backward compatibility". They use "nice low-level independent libraries". They use "nice C bindings". And quite frankly, as a result of all these design decisions that sound so appealing to some Engineering people, the end result is a horrible and unmaintainable mess.

But I'm sure you'd like it more than Qt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment