this post was submitted on 12 Feb 2025
42 points (92.0% liked)
Programming
18169 readers
396 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
view the rest of the comments
This is close, but as someone already said, an index into a list just means you are mutating the list.
Your stable "identifier" needs to be a function, ie. a reused design pattern. Compared to the list, this would be an index function which gets an element from an arbitrary list, meaning you don't have to mutate your list anymore, you just build a new one which still works with your function.
This is why languages which avoid mutation and side effects are always (to my knowledge) functional languages.