Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mseepgood
· 2y ago · 0 comments
Can you explain the thought process of a developer when they write 'performOperation(2)'? What do they believe '2' signifies in this context? I struggle to believe that this could occur by accident.
Comments
[–]
avgcorrection
2y ago
You struggle to imagine a programmer passing a value of the wrong type to a function?
[–]
bb88
2y ago
Or passing a wrong value and the compiler allows it because the programmer trusted the compiler to "always do the right thing".