←back to thread

451 points birdculture | 2 comments | | HN request time: 0s | source
Show context
TheChaplain ◴[] No.43982072[source]
My problem with rust is not the learning curve, but the absolute ugliness of the syntax. It's like Perl and C++ template metaprogramming had a child. I just can't stand it.

Python is my favourite, C is elegance in simplicity and Go is tolerable.

replies(3): >>43982172 #>>43982379 #>>43989277 #
krior ◴[] No.43982379[source]
C may be simple, but its too simple to be called elegant. The lack of namespacing comes to mind. Or that it is a staticly typed language, whose type system is barely enforced (you have to declare all types, but sometimes it feels like everything decays to int and *void without the right compiler incantations). Or the build system, where you have to learn a separate language to generate a separate language to compile the program (which a both also not really simple and elegant in my eyes). Or null-terminated strings: to save some 7 bytes per string (on modern platforms) C uses one of the most dangerous and unelegant constructs in the popular part of the programming-world. Or the absolutely inelegant error handling, where you either return an in-band-error-value, set a global variable or both or just silently fail. Or the standard-library, that is littered with dangerous functions. Or the reliance of the language definition on undefined behaviour, that forces you to read a 700-page, expensive document back to back to know whether a vital check in your program might be ignored by compilers or when your program might shred your hard drive, despite you never instructing it to do so. Or...

C has a simple syntax, but it is most certainly not elegant.

replies(1): >>43983282 #
0x000xca0xfe ◴[] No.43983282[source]
C is elegant because as an extremely powerful programming language used to create an uncountable number of high-profile projects it's simple enough that I feel optimistic I could write a C compiler myself if it was really necessary.

It may be impractical for some tasks but the power:complexity rate is very impressive. Lua feels similar in that regard.

replies(2): >>43983417 #>>44003298 #
1. dwattttt ◴[] No.43983417[source]
The mechanism for sharing definitions, 'include' aka "copy file here", is absolutely not elegant. The absolute minimum you could do maybe, but not elegant.
replies(1): >>43983566 #
2. 0x000xca0xfe ◴[] No.43983566[source]
Not to mention the whacky preprocessor as a whole...

I would say includes/standard library/compilers going crazy on UB is part of the infrastructure or ecosystem around the language and not the language itself. And I agree absolutely, while C the language is beautiful, the infra around it is atrocious.