310
you are viewing a single comment's thread
view the rest of the comments
[-] 9point6@lemmy.world 53 points 7 months ago

Const everything by default

If you need to mutate it, you don't, you need to refactor.

[-] noli@programming.dev 45 points 7 months ago

Dogmatic statements like this lead to bad, messy code. I'm a firm believer that you should use whatever style fits the problem most.

Although I agree most code would be better if people followed this dogma, sometimes mutability is just more clean/idiomatic/efficient/...

[-] 9point6@lemmy.world 3 points 7 months ago

I agree somewhat, but I'd also say any codebase needs some level of "dogmatic" standard (ideally enforced via tooling). Otherwise you still end up with bad, messy code (I'd even say messier, as you don't even get consistency)

[-] Corbin@programming.dev 3 points 7 months ago

Define your terms before relying on platitudes. Mutability isn't cleaner if we want composition, particularly in the face of concurrency. Being idiomatic isn't good or bad, but patterned; not all patterns are universally desirable. The only one which stands up to scrutiny is efficiency, which leads to the cult of performance-at-all-costs if one is not thoughtful.

load more comments (23 replies)
this post was submitted on 21 Mar 2024
310 points (100.0% liked)

Programmer Humor

19503 readers
475 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS