3 ms·
That was a well-written article that has a pattern that should work well for a lot of people. But I think it can be improved. One cool fact is that Javascript
by Xcelerate 14y ago
That was a well-written article that has a pattern that should work well for a lot of people. But I think it can be improved.
One cool fact is that Javascript has first class functions. This means you can bring a lot of development patterns from the functional realm into your web development.
There is a trend of languages moving away from the concept of mutable state. The article does a good job with the first steps (by wrapping everything in its own function scope), but Javascript lets us go further. The article seems like it attempts to shoe-horn the concepts of classes and sub-type polymorphism into a language that has better options.
- alttab 14y agoOne time I saw a some code where the author re-implemented haskell in javascript. Needless to say reading that code was nearly impossible!