Re:Java 7 is now available
by Total_Meltdown on Friday July 29, 2011 @04:21PM
(#2823634)
Also fun: The only one of these that works when a callback removes itself from the event list in its own callback routine is C#. You get a hanging iterator in C++, and removing items from a table mid-iteration in Lua is undefined (though in practice usually works).
To make this case work properly, the place I work for has a 335 line C++ template class. This is all time that the developer could have spent actually building our product.
The C++ version could be greatly simplified by using boost::bind. It'd still be shorter and clearer than a Java equivalent that had to bung in anonymous classes and other crap to create a proper dispatch.
Your point, however, totally stands.
C++:
Lua: C#: Now, go ahead and say that choice of language doesn't matter. You might not need lambdas, or first-class functions, or event handlers, and a good programmer can make the same algorithm "work" in any language. But by choosing a more powerful and expressive language, you can get those algorithms done in a way that's more readable, maintainable, and faster to code, which in the end is what really matters.