this post was submitted on 21 Mar 2024
2 points (100.0% liked)

Programmer Humor

19471 readers
1393 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] 9point6@lemmy.world 1 points 7 months ago (6 children)

Const everything by default

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

[–] noli@programming.dev 2 points 7 months ago (1 children)

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/...

[–] Corbin@programming.dev -1 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 (4 replies)