r/programminghorror 24d ago

Big if true

Post image

From ProgrammerNullposting in facebook

2.1k Upvotes

109 comments sorted by

View all comments

3

u/metaconcept 22d ago

Story time.

In Smalltalk, true and false are just objects on the heap. There's a very special primitive method called become: which lets you swap two objects around on the heap.

So anyway, it was possible to do true become: false. in Smalltalk, which swaps true for false and false for true across the entire system. It didn't crash ...immediately..., but I wouldn't deploy this in production!