24 lines
1.3 KiB
Text
24 lines
1.3 KiB
Text
title = "#cxx"
|
|
include_feed = { tag = "cxx", title = "Posts" }
|
|
|
|
+++
|
|
|
|
Programming in C++.
|
|
|
|
---
|
|
|
|
A lot of people don't like C++, and I can't blame them for it.
|
|
I don't love it too.
|
|
|
|
It's just that it's currently the most pragmatic choice for any sort of multi-domain program which follows [the Philosophy][page:tag/programming].
|
|
|
|
While most C++ code I write is very C-like, I don't limit myself to C, because C++ is a lot more pleasant to program in.
|
|
Just the addition of namespaces, `enum class`, references, parsimonious use of templates, and operator overloading, is enough of an improvement over C that I generally tend to prefer C++ for solving my problems.
|
|
|
|
C++ remains the most pragmatic choice for most long-term projects while [Odin](https://odin-lang.org) and [Zig](https://ziglang.org) are still cooking.
|
|
I can rely on the language not changing under my feet, remaining stable and portable for many years to come, with a library ecosystem following a similar philosophy.
|
|
|
|
Places of unpleasantness in C++ for me include: classes and encapsulation, complicated template metaprogramming, the entire `std` namespace, lack of enum-indexed arrays, and also the Unreal Engine.
|
|
|
|
~...Seriously though, why does _nobody_ but Odin and Nim implement enum-indexed arrays?\
|
|
What is wrong with you people.~
|