Javascript: The Good Parts is a great book. Often I find myself reading passages like the following from the perspective of a language designer:
undefined
andNaN
are not constants. They are global variables, and you can change their values. This should not be possible, and yet it is. Don't do it.
Takeaways:
- Don't change the value of
undefined
in my Javascript code. - When designing a language, make its equivalent of
undefined
immutable.
A different more subtle example would be "for in
shouldn't enumerate over prototype properties".
I want a book at talks about these issues of language design outside of the context of a particular language.
If you were trying to design the "perfect" OO language, what books would you read for guidance?