368
codeStyle (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] jroid8@lemmy.world 14 points 6 months ago
[-] aDogCalledSpot@lemmy.zip 14 points 6 months ago

I think Rust actually is actually among the best in this regard for the simple reason that there is consistency given by the compiler. A simple cargo fmt and cargo build will fix or warn you about everything. I can read into Rust codebases so quickly. C++ was always really exhausting because most of the time you were just getting used to the code style.

[-] RustyNova@lemmy.world 9 points 6 months ago
[-] ramirezmike@programming.dev 5 points 6 months ago

I've found whenever people complain about rust code they can only point out how it's different but not why it's worse and I can usually point to a reason why it's better.

to be fair, I get sometimes it's difficult to pinpoint why something is bad and even "being different" can be a legitimate criticism on its own

[-] hansl@lemmy.world 0 points 6 months ago

People who learnt structural OOP without actually understanding typing system and their benefits really struggle with learning Rist as they try to map classes onto structs and it just doesn’t work.

Traits are not inheritance. Box is not polymorphism. Rust is not C++ with more keywords.

[-] jroid8@lemmy.world 1 points 6 months ago

It IS fine, I though the comic was referring snake_case as disgusting. I was uncomfortable too at first but I got used to it

[-] Croquette@sh.itjust.works 2 points 4 months ago

I used to be a PascalCase guy myself, but that changed recently when I had to use React (coming from embbeded C)

I am working with a C embedded framework that uses snake_case, and switching between the two, I realized that it is a lot easier to find information with snake_case for me.

[-] flashgnash@lemm.ee 8 points 6 months ago

I don't get why every language seems to have its own coding style when you'd think they'd be completely interchangeable depending on user/org/project maintainer preference

[-] RustyNova@lemmy.world 20 points 6 months ago

Having a standardized codding styles allows people to immediately recognise things, and not have a wacky case mix.

You don't need to remember the coding style of one specific project. You just need to remember the style of the language

Of course it would be better if it was standardized for every language, but that's probably never going to happen

this post was submitted on 01 Mar 2024
368 points (93.0% liked)

Programmer Humor

31990 readers
62 users here now

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

Rules:

founded 5 years ago
MODERATORS