this post was submitted on 27 Jun 2023
43 points (97.8% liked)

Programmer Humor

32532 readers
431 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 25 comments
sorted by: hot top controversial new old
[–] [email protected] 22 points 1 year ago (2 children)

Who the hell would call python beautiful has never seen python code in the wild

[–] [email protected] 7 points 1 year ago

Too true, python can be beautiful and succinct or like a huge plate of spaghetti cut up with scissors

[–] [email protected] 6 points 1 year ago

Every language starts out as beautiful, then it becomes popular, a whole lot of new features get wedged into it, and everyone who's watched a 5 minute tutorial video starts coding in it.

I remember the days when Python, Java and even Perl were considered beautiful.

[–] [email protected] 15 points 1 year ago (1 children)

Once you get used to the Rust syntax, it actually makes the code look cleaner.

[–] [email protected] 7 points 1 year ago (1 children)

Ans you also learn to format it properly.

Generally any new santax looks ugly. Then when you understand why it is written like it is it starts looking good.

[–] [email protected] 7 points 1 year ago

learn to ~~format it properly~~ stop trying to correct rustfmt

FTFY

[–] [email protected] 10 points 1 year ago (1 children)

One big reason Nim never really caught on is because we've got lots of fast-ish languages with garbage collection (like Go, which sucks a lot of oxygen away from Nim IMO). Rust introduced a new concept to the mainstream that lets you program safely without a runtime hit for garbage collection.

[–] [email protected] 3 points 1 year ago (1 children)

Ada would like a word with you ;)

[–] [email protected] 3 points 1 year ago

To my knowledge, Ada doesn't have an equivalent to Rust's borrow checker. I also think I covered that base by specifying "mainstream" 😀

[–] [email protected] 9 points 1 year ago (3 children)

What are the last two? I know Python and C, but haven't seen the last two.

[–] [email protected] 20 points 1 year ago (1 children)

The third one is rust which has become a meme at this point. Programmers like it because it has almost as much performance as C but has a lot of safeguards preventing memory errors and vulnerabilities. I have no idea what the last one is tho

[–] [email protected] 7 points 1 year ago (2 children)

Did rust change it's logo? I thought it was a gear. :s

[–] [email protected] 11 points 1 year ago

It did not change logo. This is the mascot.

[–] [email protected] 2 points 1 year ago (1 children)

I think it just has two logos but idk

[–] [email protected] 3 points 1 year ago

The crab is public domain, so you can use it to advertise your own Rust project or whatever. The gear logo belongs to the Rust foundation, which sparked some controversy a while ago.

[–] [email protected] 11 points 1 year ago* (last edited 1 year ago)

Those are Rust and Nim

[–] [email protected] 4 points 1 year ago (1 children)

Crab is Rust, but the last one...

[–] [email protected] 13 points 1 year ago* (last edited 1 year ago) (2 children)

Apparently it's called nim.

https://en.m.wikipedia.org/wiki/Nim_(programming_language)

Looking at the Wikipedia article, it seems like it has some weird syntax choices. And even though it compiles to C code, I'm not convinced that it's as fast as C or Rust, since it has a garbage collector.

[–] [email protected] 9 points 1 year ago (3 children)

I'm pretty skeptical it could be as fast and safe as Rust without the added challenge. Like, even doing what Rust did was a big deal.

[–] [email protected] 3 points 1 year ago

I could be wrong, but based on the Wikipedia article it seems like it’s more trying to be a python replacement than a rust/c++/Java/etc replacement. The big thing with rust is that it’s rules allow memory safety without a garbage collector, while unless I missed something it seems like nim just uses a garbage collector. Not that that’s necessarily some huge problem or anything, but you know, different purposes

[–] potatoBoy 1 points 1 year ago (1 children)

Can compile to C which then compiles using your favourite compiler. So it can operate at the speed of C

And the new memory management system is similar to rusts system (and can be fully disabled if you want manual memory management)

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Can compile to C which then compiles using your favourite compiler. So it can operate at the speed of C

Technically, it all compiles to assembly, but Python is still a lot slower than C or Rust. Speed is lost along the way through those layers of abstraction.

And the new memory management system is similar to rusts system (and can be fully disabled if you want manual memory management)

So it doesn't have a garbage collector? I'm going to have to actually look into this myself.

[–] [email protected] -1 points 1 year ago

I think it transpiles to C so theoretically it could be quite fast, but I doubt the generated C is as fast as manually written C or Rust.

[–] [email protected] 1 points 1 year ago

OH… NIM NIM NIM NIM NIM FUCKING NIM

[–] [email protected] 2 points 1 year ago

you forgot zig

load more comments
view more: next ›