I have noticed a worrying trend in computer science where topics that are have surprising, non-intuitive properties are now taught as “oh, treat this as a magic black box, you will never understand it”. I hate this as people then “teach” by discouraging exploration in the space
For example, it is now commonly explained to engineers that floating point math does not behave like real-valued arithmetic. This is surprising for most new programmers and this a good topic to introduce. But it’s not done well! We say “here be dragons” but never explain *where*
The result is that I’m reading a Stack Overflow question right now (“why does sin produce different results on different computers”) and a lot of well-meaning people have responses that boil down to “you can’t really expect anything from floating point numbers”.
The answer has nothing to do with “limits of double precision” or “rounding” or “you can’t actually expect these kinds of precise results from floating point”. Just because the rules are hard to understand doesn’t mean that nothing is specified or that there aren’t guarantees
Follow

@saagar Seen a very similar thing with `this` in JS. It's not actually that hard to reason about (and takes like 5 lines to explain!) but because it is counterintuitive, it gets treated as some unpredictable magic and people will confidently pass around 'advice' telling people that it is unreliable and should not be used...

· · Web · 0 · 0 · 2
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.