this post was submitted on 29 Apr 2026
21 points (95.7% liked)

Programming

26803 readers
269 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
you are viewing a single comment's thread
view the rest of the comments
[–] eager_eagle@lemmy.world 5 points 6 days ago* (last edited 6 days ago) (1 children)

this sounds like a pretty bad reason to justify ugly code today

any readability gain will greatly outweight resources in most situations

[–] argv_minus_one@mastodon.sdf.org 1 points 6 days ago (1 children)

@eager_eagle

That might have been a reasonable statement 3 years ago, but today there is a global crisis caused by extremely high RAM prices. Optimize your blasted code.

[–] eager_eagle@lemmy.world 4 points 6 days ago (1 children)

Agreed, optimize it. Where it matters. Reducing the number of functions to save space on the stack when the heap has 99% of the data is nonsense.

[–] argv_minus_one@mastodon.sdf.org 0 points 6 days ago (1 children)

@eager_eagle

I'm talking about the *code* wasting memory. In JavaScript each function is a heap object and its source code is another heap object. Even if a JIT compiler inlines them, the original non-inlined functions keep sitting there wasting perfectly good bytes.

[–] eager_eagle@lemmy.world 4 points 6 days ago

and again, you end up sacrificing readability to address what, a fraction of a percent in memory use? If that matters in your program, maybe don't use JS.