Take

Programming difficulty texture

As I wrote the previous entry, I realized that many programming languages have their own texture of difficulty.

C is difficult because it is an unsafe veneer over assembly, because it's so easy to fall off the edge and because almost nothing is included. That's how it had to be in the 70s if you wanted to write an operating system, but it's easy today to make dangerous mistakes that compilers still won't warn you about, and see uninitialized memory. You're free to express a whole lot of things that just won't be compatible with reality. At every juncture you have to know exactly what you intend to do and intimate details about what the code calling you and the code you call expect to do with values and memory, and tooling to enforce these things are rare and hard-won commodities.

C++ is difficult, and I have always shied away from it more than any language, because of the mix of ambition and tricks to make things low-cost. Between Rule of the big four (and a half), rvalue references, moving semantics and templating, it's the most immensely complicated programming language in the world, and despite all this extra machinery, much of which is called implicitly, if you slip up, you crash really bad.

Rust is difficult because of having so many new concepts, and in being so precise and exacting. As far as I can tell, it moves all of this complexity to the compilation stage, so you end up with things not building instead, although some things can still be surprises.

JavaScript is difficult because the standard library is straight up pants-on-head stupid. Never mind the language; the Date object alone with its "add 1900 to the year", "months start at 0 but days start at 1" and incredibly imprecisely defined functions that have only recently been supplemented with sane alternatives is a good demonstrative microcosm. Not to mention that its relative poverty of functionality combined with having grown up in an unsophisticated environment has lead to a culture of many small ad-hoc polyfills.

PHP is difficult for the very many reasons this is still true. For heaven's sake, I read up on PHP 7 today, and I knew it was created because PHP 6 didn't get anywhere, but I hadn't realized until now that it meant they gave up on having an actual Unicode-compatible string data type.

Previous post: Rust: Five Years of Rust Following post: Surfaces