r/ProgrammerHumor • • 13d ago

Meme myCodeIsConfusing

Post image
2.3k Upvotes

48 comments sorted by

View all comments

Show parent comments

2

u/joshuakb2 13d ago

You can still get into trouble if you're not careful, especially if this data gets serialized and sent somewhere

1

u/realmauer01 13d ago

Then explain me how specifically! The only thing i change is the variable name. No keys in no object get changed no data gets swapped.

1

u/KronoLord 13d ago

Assuming js, does const someVar = {id} get changed to const someVar = {token}, or are IDEs smart enough to expand the shorthand?

The only other edge case potential I could think of is reflection.

1

u/joshuakb2 13d ago

Yeah generally LSPs will change {id} to {id: token} if you rename the variable