| ▲ | bunderbunder an hour ago | |
I used to write obfuscated C for fun. I haven’t touched it in a while, but as I recall there are really two C syntax features that unlock most of the “magic”. Whitespace is generally not significant, so you can cram a whole lot onto a single line. And the combination of pointers and weak typing lets you be as anarchist as you like about manipulating data. (Oh, and the preprocessor. The one and - thankfully - only C preprocessor.) Of the two^H^Hhree, I think that the first is what contributes most to the aesthetic appeal of obfuscated C. The only other languages I’ve used that are as good for making code that looks impenetrable are Forth and JavaScript, both of which share that feature. (Probably any lisp, too, but for some reason I’ve never actually tried. I can say, though, that the most confusing codebase I ever inherited was written in Clojure.) So yes, I’m inclined to agree that Rust can be a good language for writing deliberately ugly code, and Go not so much. But for a different, perhaps more trivial reason. | ||