2 ms·
I'd hope the article would present something that scaled better than users needing to remember what to do with u/s-prefixed variables. Response handlers needing
by mattgreenrocks 4y ago
I'd hope the article would present something that scaled better than users needing to remember what to do with u/s-prefixed variables. Response handlers needing to worry about unsafe/safe strings lowers their cohesion and hurts readability. Newtypes are an obvious solution, or a DSL that sits above the actual Response API would also be good.
Luckily, since this was written, most web frameworks use some sort of templating system which probably eliminates 99% of the ad-hoc HTML from response handlers.
On Hungarian notation:
> Somebody, somewhere, read Simonyi’s paper, where he used the word “type,” and thought he meant type, like class, like in a type system, like the type checking that the compiler does. He did not. He explained very carefully exactly what he meant by the word “type,” but it didn’t help. The damage was done.
This is the pop culture of programming: insightful advice stripped of nuance, elevated to Best Practice, and blindly repeated with the source material completely forgotten about. Said practice eventually rots away because it isn't as universal as once touted.