Quote:
Originally Posted by Shoe Lace
I wouldn't really say it's dumb. Overloading is pretty common in every language. I think that's the only time he does it in express too.
I think it was more important to keep app.verb() working consistently while also keeping the typical get/set syntax familiar for properties on app itself. If you stick with Express you'll see that a lot of decisions he makes is for the sake of keeping the api easy to use while keeping productivity at a maximum.
Also you don't need fancy libs to do inheritance in JS. You have a few options. Don't forget since node is running on v8 you have guaranteed access to all of ES5's features. So using the "new Object(x)" features is fine. There's also the good old prototype based inheritance which works out of the box, I prefer this way but with JS there's usually 100 ways to do anything so it's rarely a case of one way being better than the other.
I read up on all those different types of doing inheritance, and everyone seems to have a different solution for stuff like deep copying, performance, and adding properties that are or aren't enumerable, etc. Every time I found a method that was supposed to work, somewhere in the comments there was some major drawback. I think I'd just rather let the framework figure that out for me.
Also what do you use to make JSON calls to a REST back end server? Do I have to write my own JSON get method?