3 ms·
"Is better" always needs to be followed by "...at X". I'd contend that COBOL is better than Java ...at running on an old AS/400. Doesn't mean I'd touch otherwis
by kstrauser 2y ago
"Is better" always needs to be followed by "...at X". I'd contend that COBOL is better than Java ...at running on an old AS/400. Doesn't mean I'd touch otherwise touch it with a 10 foot pole, though.
> Even when I do systems programming, like low level stuff, I just want to manage my own memory. I do not want to beg the compiler to let me write code, I just want to allocate stuff and put stuff into there. C is fine for this. I’ll try zig later.
Oh lordy please no. That's how we got into so many messes in the first place. I think writing Rust made me a better C programmer by drawing my attention to how many bad things I was doing that a C compiler would cheerfully compile without saying a word. Oh, you want to malloc a chunk of heap, free it 8 calls deep in some random function, and then pinky swear never to touch it again? Go for it!
I don't have anything objectively bad to say about Java, except that it's probably a terrible fit in any scenario where you'd be using Rust in the first place. (Notice there's not a big push to re-implement a bunch of command line tools in Java?) For me, it's almost entirely a preference thing. Java looks ugly and inelegant to me in a way almost no other popular language does. It doesn't mean you can't write beautiful, elegant code in Java. It does mean, in my opinion, that it will never look beautiful and elegant. By analogy, notice that even people who've taught themselves Klingon don't spend a lot of time writing poetry in it. You could, but it's never going to sound as pretty as a shopping list written in Italian.
- bsder 2y ago> Oh, you want to malloc a chunk of heap, free it 8 calls deep in some random function, and then pinky swear never to touch it again? There is no default system memory allocator in Zig--this is a signficant difference between Zig and C or Rust. If you want to allocate in Zig, you have to cough up an allocator and pass it around. The downside is that a lot of things need an allocator and that makes some things more complicated (printing to console, for example). The upside is that if there is no allocator being passed, you're guaranteed to not be allocating/deallocating memory.