3 ms·
Note the context. Joel is writing his examples in VBScript. VBScript was a dynamically typed offshot of Visual Basic, but did not originally give you the abilit
by goto11 4y ago
Note the context. Joel is writing his examples in VBScript. VBScript was a dynamically typed offshot of Visual Basic, but did not originally give you the ability to define your own types.
In any modern language you would just use a HtmlString type to wrap html, and let the compiler take care of ensuring you don't mix up encoded and unencoded strings. But absent any kind of custom types (and no HtmlString in the standard library), you had to rely on something like Hungarian notation and very carefully eyeball to code.
Making wrong code look wrong is better than nothing, but making wrong code impossible is far better.
- Banana699 4y agoYes exactly, any language with zero\low cost type definitions and natural use of custom types (they don't look second class in e.g operators) would automate what Joel calls Apps Hungarian (the original Hungarian notation). In fact, good custom types would make Apps Hungarian, the useful Hungarian notation, as useless as the Systems Hungarian. This is a natural direction is programming language research, to make as much of program constraints and custom logic automatically checkable and enforced.
- avg_dev 4y agoI definitely thought, "man this is out-of-date" when I looked at this article. I'm a big fan of analysis and linting tools to catch what the language cannot, as well. You can always disable that stuff with a magic comment when the circumstances call for it.