Posted by Matt Savona on April 29, 2008
Last night in Theory of Programming Languages we briefly discussed nested functions and procedures. I made the point that Javascript supports this (obviously) and it facilitates object oriented design in the language, as there isn't a notion of "classes". No qualms there. But when I suggested that the same functionality permits for encapsulation, people seemed to disagree, claiming that fully qualifying calls to nested functions implies they are always publicly accessible. So, I went to my quiet place and decided to address it today in this post.
The people that suggested nested functions were public were wrong. You see, depending on ... [read more...]
