Y
Hacker News
new
|
ask
|
show
|
jobs
by
mseepgood
844 days ago
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.
1 comments
avgcorrection
844 days ago
You struggle to imagine a programmer passing a value of the wrong type to a function?
link
bb88
844 days ago
Or passing a wrong value and the compiler allows it because the programmer trusted the compiler to "always do the right thing".
link