this post was submitted on 12 Feb 2025
41 points (93.6% liked)

Programming

18169 readers
359 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

It makes the code icky and hard to debug, and you can simply return new immutable objects for every state change.

EDIT: why not just create a new object and reassign variable to point to the new object

you are viewing a single comment's thread
view the rest of the comments
[–] Shanmugha@lemmy.world 6 points 3 hours ago* (last edited 3 hours ago) (1 children)

Logical and human friendly answer: mutable objects are not a problem, poorly designed code is

Personal rant: why even bother with objects, just use strings, ints, floats, arrays and hashmaps (sarcascm. I have spent hours uncovering logic of large chunks of code with no declaration of what function expects and produces what)

And also, seeing endless create-object-from-data-of-other-object several times has made me want to punch the author of that code in the face. Even bare arrays and hashmaps were less insane than that clusterfuck

[–] pupbiru@aussie.zone 1 points 29 minutes ago

strings? ints? floats, arrays, HASHMAPS? so inefficient… just directly access memory!!!!