this post was submitted on 04 Apr 2024
252 points (96.3% liked)

Programmer Humor

31214 readers
589 users here now

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

Rules:

founded 4 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] force 3 points 2 months ago* (last edited 2 months ago) (1 children)

That said, with how few expressions are return values, I do wonder why semicolons are the default rather than adding a special character to indicate return values.

you mean like return/break/etc.?

because Rust was designed to remind you of functional programming despite not being very functional, and because semicolons allow way better syntax rules in Rust and are generally pretty vital for good, readable lowish-level code. it also allows Rust programmers to use newlines/indents and stuff to pretty up their code a lot without littering it with random \ and |> and begin end and such everywhere, which, given how dense Rust code can be and how much it uses iterators and weird trait magic, is a big plus for readability