News for hackers. Stuff that matters.
Re:GNU ease.js by astral303 on Wednesday March 26, 2014 @06:31PM (#7477116)
Why would you introduce that distinction into what is an inherently dynamic language? "virtual" keyword in C++ is an option to avoid paying the cost for a polymorphic call (so it can be inlined at compile time and/or no extra pointer dereference is done). It's a compromise to allow incremental cost of language features--but in JavaScript?
Re:GNU ease.js by mikegerwitz on Friday March 28, 2014 @09:45AM (#7487153)
There are certain optimizations that I am able to perform by knowing if a function is virtual or not---this is especially important in the Trait implementation.

However, the original intent is based on compelling rationale from C#. I cannot find the original article where the article explains the rationale, but aside from optimization benefits and self-documenting code, he makes the point that virtual methods are essentially callbacks/hooks into existing code; you therefore need to put careful thought into how to handle those virtual methods properly and expose the proper APIs.

Re:GNU ease.js by mantrax3 on Wednesday March 26, 2014 @07:30PM (#7477458)
That's probably the one part that really didn't make sense. But maybe he did it for sport.