Subj : Re: ECMAScript standards committee To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Sat Oct 09 2004 01:05 pm Shanti Rao wrote: > As the language gets more complicated, Not the language, but the compiler / interpreter become more complicated. If you do not use difficult language features then YOUR language remains as simple as YOU wrote it. But if otheres need additional patterns of abstraction and JavaScript does not provide them to those that need them, they will leave JavaScript and look for alternatives. #2, Why should JavaScript 2.0 less stable than JavaScript 1.5? #3, and #7 become imperiled. JavaScript is not easy to learn. There are too many differences at least inside the last 4 years of JavaScript 1.5, where implementation details changed very often, which sometimes cause script incompatibilities within core JavaScript 1.5, when running with different old implementations. JavaScript is only easy as long as you do only trivial scripting. JavaScript 2.0 does not decrease readibility. > C#'s strengths are its backing, development environment, and Windows > integration, not its technical merits as a language. Compared to JavaScript 2.0 C#s advantage is much less but compared to JavaScript 1.5 it has much more language benefits. But C# compared to C++ you are right, there it is only the environment not realy the language, because C++ is much more rich than C#. The most important conceptional flaw of JavaScript 2.0 is not to implement overloading nor implementing multiple equal named functions with different parametrization. sample: ------- function banana() { // first banana } function banana(len: Double) { // second banana } function banana(len: Double, taste: Integer) { // third banana } In the actual concept the second banana replaces the first one and the third replaces the second, but there is no need to do that. If banana is implemented as an extended function object, then the three implementation variants (first, second and third banana) might be reachable for the call method and similiar non beginneres functionalities e.g. in following way: banana.functions[0].call(myObj); or banana.functions[''].call(myObj); and banana.functions[1].call(myObj, 12.34); or banana.functions['Double'].call(myObj); and banana.functions[2].call(myObj, 12.34, 99); or banana.functions['Double,Interger'].call(myObj, 12.34, 9); and to let auto detect the best fitting implementation just do it as known... banana.call(myObj); banana.call(myObj, 12.34); banana.call(myObj, 12.34, 9); and expect an exception, when auto detection can not decide which implementation variant fits best. This would dramatically reduce the number of symbols and therefore increases readibility. It is absolutely confusing, if I need multiple symbols with each time the same meaning but only different types they are dealing with. This confuses beginners and has absolutely no advantage to anybody. There should be also a more localy scoped variable declaration (e.g. written Var instead of var) to allow variable hiding like known from C and C++ for(Var i = 10; --i;) { for(Var i = 10; --i;) { alert('inner i: ' + i); } alert('outer i: ' + i); } but now the classical endless loop... for(var i = 10; --i;) { for(var i = 10; --i;) { alert('outer i: ' + i); } alert('outer i: ' + i); } -- Georg Maaß - bioshop.de D-76227 Karlsruhe, Westmarkstraße 82 HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net - The ultimate DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .