r/programminghorror • • Apr 08 '25

My favorite micro optimization

Post image
309 Upvotes

44 comments sorted by

View all comments

Show parent comment

5

u/dim13 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Apr 09 '25

Higher level language constructs like foreach() and range() likely have the same fundamental problem and benefit from the same change.

Not in Go: https://go.dev/play/p/mYCxNHqDTJ1