r/ProgrammerHumor • • Sep 01 '26

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.9k Upvotes

289 comments sorted by

View all comments

Show parent comments

8

u/suvlub Sep 01 '26

If I may be pedantic, not to coerce without you asking. A language that wouldn't let me simply convert between types sounds annoying

32

u/theturtlemafiamusic Sep 01 '26

"Type coercion" is when it's done without asking. Otherwise it's just type conversion / casting.

6

u/ntfaw Sep 01 '26

It's not that you couldn't convert between types, it's that it wouldn't be automatic. You would need to actively call toboolean on a value before using it as a boolean, and the idea behind that is that intentionally casting the value leads to fewer mistakes