Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming News

JavaScript Creator Talks About the Future 305

mikejuk writes "JavaScript is currently an important language — possibly the most important of all the languages at this point in time. So an impromptu talk at JSConf given by the creator of JavaScript, Brendan Eich, is not something to ignore. He seems to be a worried about the way committees define languages and wants ordinary JavaScript programmers to get involved."
This discussion has been archived. No new comments can be posted.

JavaScript Creator Talks About the Future

Comments Filter:
  • by jaymz2k4 ( 790806 ) <jaymzNO@SPAMjaymz.eu> on Saturday May 07, 2011 @05:49AM (#36055420) Homepage

    possibly the most important of all the languages at this point in time

    Not so sure I'd agree with that summary - I don't doubt the importance of JavaScript to the modern internet but I'd be more inclined to consider the C's of this world as the main foundation of the industry.

    • Re: (Score:3, Funny)

      C isn't web scale.
      • by Anonymous Coward on Saturday May 07, 2011 @06:32AM (#36055558)

        Just wait until you've had to fix your first Node.js and MongoDB disaster. I'm working with one client to get rid of such a system. It is by far one of the worst gigs I've ever had, and I've had to clean up a whole lot of stupid shit before.

        JavaScript barely works as a client-side scripting language, and even then the experience is totally shitty for developers and users alike. Slashdot is a really good example of how JavaScript can absolutely fuck up a site unnecessarily.

        But it has absolutely no place for server-side development. It's just not up to the task in any way. It's missing basic language features necessary for large-scale server-side development. Its development tools are atrocious. Its runtime performance is horrible. Node.js is fucking stupid, and that's putting it nicely. Using it to query a data store is an extremely idiotic idea. All in all, it's a massive failure.

        JavaScript "programmers" have put together some of the worst and most broken systems that I've ever dealt with, and I've been dealing with horrible systems written using languages like PHP, Visual Basic, PowerBuilder and Perl. JavaScript may be one of the biggest computing disasters of all time.

      • by VortexCortex ( 1117377 ) <VortexCortex AT ... trograde DOT com> on Saturday May 07, 2011 @06:37AM (#36055576)

        C isn't web scale.

        I'm not sure if you're going for funny or not -- Just to clarify, CGI was traditionally done via C. Apache is written in C. To this day, I still write processor intensive server side code in C or C++ (with a few C libs to support cross platform code & CGI) -- Even dinky hosing services like 1&1 offer remote SSH, have C/C++ compilers installed (G++, GCC), as well as GIT.

        I wouldn't develop on any system that doesn't at least support this minimal setup -- for web development or otherwise...

        Perhaps you mean C isn't a cross platform client side sand-boxed language?
        Neither is JavaScript:

        It's not cross platform -- The amount of conditional cruft you have to add to ATTEMPT a cross-browser solution is rediculous, so much so that there are entire libraries and frameworks for client side JS just to get most of the way there, and even then, some browsers are left behind.

        It's not sand-boxed -- Modern browsers compile JS to machine code and run that... Because the language requires features that make it slow, to do it any other way (bytecode in a VM), is terribly slow.

        I use JS, but it's not all it's cracked up to be... Most devs I know only use it as a client side language because it's available -- not because the language is so great.

        • by anonymov ( 1768712 ) on Saturday May 07, 2011 @06:53AM (#36055626)

          It's not cross platform -- The amount of conditional cruft you have to add to ATTEMPT a cross-browser solution is rediculous

          That's not the problem of javascript - that's the problem of implementation. Do you really think it would be any better if someone invented SomeBetterScript back then - and then MS made EvenBettererScript, which would be almost, but not completely, unlike the SomeBetterScript, and then Mozilla added their own extensions, and then other browsers implemented those extensions in incompatible way, adding some of their own in process, and ...

          You see what I'm talking about? JS by itself is quite nice language - web client bindings for JS is awful thanks to all the implementors.

          And yes, libraries and frameworks are good thing and they do make browser JS crossplatform - think about how AWT/Swing/SWT makes Java crossplatform and what would happen if you had to have your own bindings and workarounds.

          It's not sand-boxed -- Modern browsers compile JS to machine code and run that.

          And that's pure bullshit. "Compile to machine code and run that" has nothing to do with sandboxing - that's what all the languages that give a bit of concern about performance do, after all. Please come back when you learn the difference between "sandboxing vs non-sandboxing" and "interpreting vs JIT compiling".

          • And yes, libraries and frameworks are good thing

            I disagree. The web browser has to parse all of that JavaScript every time it loads a page with JavaScript that requires it. In most cases it's not even really necessary, as the JavaScript only uses a couple library functions that could easily be written by yourself (like XmlHttpRequest).

          • That's not the problem of javascript - that's the problem of implementation.

            The language and its implementation are not separable for practical purposes. If either one or the other is no good, the whole is no good.

      • C isn't web scale.

        Really? Then what language was your Web Browser or the Web server you connect to written with? It's most likely C/C++.

    • by jepaton ( 662235 ) on Saturday May 07, 2011 @06:03AM (#36055468)

      Virtually every device has substantial amounts of code written in C or C++. Javascript would be useless on the microcontroller I write C code for. If C and C++ were to vanish overnight we'd be back in the stone age. I won't comment on whether C and C++ belong in the stone age, but it's great that many programmers don't have to think at the lower levels of machine abstraction.

      • Re: (Score:3, Funny)

        by Anonymous Coward

        If C and C++ were to vanish overnight we'd be back in the stone age.

        Uuum, C/C++ is the stone age!
        If one would have written that stuff today instead of in the stone age, one would use the radical cool new language of today: Haskell.

      • by JamesP ( 688957 )

        Virtually every device has substantial amounts of code written in C or C++. Javascript would be useless on the microcontroller I write C code for. If C and C++ were to vanish overnight we'd be back in the stone age. I won't comment on whether C and C++ belong in the stone age, but it's great that many programmers don't have to think at the lower levels of machine abstraction.

        Well, think about this for a second.

        Of course most compilers for embedded systems and small microcontrollers are C

        However, I wouldn't put past someone to take a subset (or just core JS and some metadata) and write a compiler. And I think it would be very good.

        Of course, the processor would have to have at least some 100's of KBs of memory, but I think it would be amazing.

        Think about this: JS is already very similar to C. Add Arrays, Maps and first order functions.

        Problem: plugging pointers in JS (you could

      • by DiegoBravo ( 324012 ) on Saturday May 07, 2011 @07:50AM (#36055830) Journal

        > If C and C++ were to vanish overnight we'd be back in the stone age.

        If COBOL were to vanish overnight, C programmers wouldn't get their paychecks; that's stone age...

    • by Anonymous Coward

      JavaScript isn't even that important to the modern Internet. It's pretty isolated to the Web, and even there it's only seriously used by a small number of sites. It just gets a lot of undeserved hype.

      Indeed, C and its derivatives and related languages are in fact the main foundation of virtually all software. For every line of JavaScript in a given web site, there will be hundreds, if not thousands, of lines of C or C++ code doing the real work within the JavaScript interpreter, the web browser, the client'

      • by itsdapead ( 734413 ) on Saturday May 07, 2011 @07:33AM (#36055764)

        JavaScript isn't even that important to the modern Internet. It's pretty isolated to the Web,

        Yup, and the web isn't very important to the modern Internet at all.

        and even there it's only seriously used by a small number of sites.

        Just a few tiny, insignificant ones like Slashdot, Google (Docs/Maps/GMail) and any other website that contains anything more interactive than a form submit button. Except the ones that use Flash (but then the ActionScript language used by Flash developers is a superset of ECMAScript.) - or Java, which really is "only used seriously by a small number of sites" (for given values of "small" and "seriously").

        Its also the only game in town if you want to target iOS, Android and desktop browsers with the same codebase. Meanwhile, Java's star seems to be falling, .Net/C#/VB (however well respected) are effectively Microsoft-only.

        For every line of JavaScript in a given web site, there will be hundreds, if not thousands, of lines of C or C++ code doing the real work within the JavaScript interpreter

        Well, yes, that will be true of any "scripting" language.

        The statement in TFA that Javascript is "possibly the most important of all the languages" is flamebait, but your position is equally absurd.

        The "contest" is probably Javascript vs. Python/Ruby/Perl/PHP. ("CoffeeScript", mentioned in TFA seems to be an effort to make JavaScript look more like the first three of those to appease the haters of curly brackets - where's the campaign to make Javascript look more like PHP, I ask !? :-) ).

        • by Rhaban ( 987410 )

          where's the campaign to make Javascript look more like PHP, I ask !? :-) ).

          here: http://phpjs.org/ [phpjs.org]

      • Re: (Score:2, Flamebait)

        when I turn JS off (which is 90% of the sites I visit) I don't miss a thing. in fact, turning it off saves me from a lot of spam.

        I have zero respect for javascript and less for a creator who thought we NEEDED this junk.

    • by somersault ( 912633 ) on Saturday May 07, 2011 @06:39AM (#36055582) Homepage Journal

      "At this point in time" however, the Cs are just doing the same as what they have been doing for decades, whereas JavaScript is becoming a more and more important part of rich, highly cross platform applications. C is good for that too, of course, but it tends to just be a part of the background implementation just now. It is generally not a driving force or limiting factor in how we choose to implement high level applications, whereas JavaScript is.

      Already other comments are streaming in (dynamically via JavaScript!) pointing out how basically all devices have software written in C at some level. I know this, the submitter probably knows it, and it doesn't change which is more important right now. For example, JavaScript has done more for making Linux viable on the desktop than C or Java ever has. So many apps these days can be written as web apps, and run on any OS and any hardware, as long as they have a decent web browser. It is currently changing, and will continue to change how we use our computing devices.

      • JavaScript has done more for making Linux viable on the desktop than C or Java ever has. So many apps these days can be written as web apps, and run on any OS and any hardware, as long as they have a decent web browser.

        Most linux users I know actually use c/c++ apps instead of the "web apps". Thunderbird, pidgin, gwibber, etc all beat the pants off gmail, eBuddy, twitter, etc.

        • And that's great for them, but the fact that so much of our time is now spent on web based services is what is making it easier for people to move away from Windows if they wish, and JavaScript is the thing that is making these sites pleasant to use (perhaps not pleasant to create of course, but at least you only have to maintain one version rather than many apps), when done correctly. I like that Facebook works the same on Windows, Ubuntu and my Android devices. I much prefer the desktop version of Facebo

    • mod u up. Must have been a web developer who summarized the article. It's so irritating to me with the advent of web 2.0, that everyone is so focused on the web. Not the internet, the web. As a result i feel like innovation and creativity have been lost in a sea of AJAX, PHP scripts and social networks. I'm very sad to see the commercialization of the internet and seeing us so focused on just this one aspect of computing - which is really just the GUI to the net. I'm hoping thinks like the Kinect will stir
  • its incomplete and stupid at so many parts. i still wait for script type=text/lua or text/python
    • by Anonymous Coward

      While the JavaScript language, development environments and implementations are absolutely terrible, as I see you're well aware, those are not the worst parts of it all. By far, the community is the most atrocious thing related to JavaScript. The people are generally nice enough, but my gosh, are they ever ignorant when it comes to computing.

      JavaScript tends to drive away everyone who is even remotely a good programmer, as such people can usually see just how flawed JavaScript is, and they want nothing to d

    • I doubt that web browser developers are very inclined to put massive work on coding a python interpreter and optimize it for web. Power of JS comes from the interpreters that web browsers have today. Python framework with web browser would be a new start and interpreters of web browsers would give you more trouble than JS language gives you now. Of course in a long-run it would be better. But JS does the job, so why devs should bother if there is no apparent need for other scripting languages.
      • Standardising browser DOMs should be a much higher priority, though adding other scripting options would be nice.

  • I have a suggestion. (Score:2, Interesting)

    by mikael_j ( 106439 )

    I know this may be considered radical and groundbreaking for those who design the language but perhaps putting in some way of letting the developer decide if he/she wants to copy an object or just create a new reference to it when doing assignment?

    For those who don't know what I'm going on about:

    var myObj = new Object();
    myObj.foo = 1;
    var newObj = myObj;
    newObj.foo = 5;
    alert(myObj.foo);

    That will display a dialog with "5" in it because newObj and myObj are basically the same object which is the oppos

    • That's the way it works in object oriented programming: objects have states and objects can have multiple names.

      If you don't like that, program in a functional programming language, or just stop using "=".

  • by t2t10 ( 1909766 ) on Saturday May 07, 2011 @06:05AM (#36055480)

    While I generally don't like stuff coming out ouf technical committees, sometimes the alternative is worse... like in the case of JavaScript.

  • The problem with javascript is that it is one of the WORST languages and environments. I dare to say Brandan owes the whole industry a great big apology. If he were japanese, there is a traditional act he should perform. Javascript doesn't have types to speak of, doesn't handle numbers very well, I mean seriously "+" appends two numbers? No scope to speak of. It looks object oriented, but has no real notion of classes. No inheritance. All of the features that have made languages "safer" and "easier" to prog

    • by TheRaven64 ( 641858 ) on Saturday May 07, 2011 @06:50AM (#36055614) Journal

      It looks object oriented, but has no real notion of classes. No inheritance.

      I agree with most of your points, but not this one. Class based and object oriented are orthogonal. Simula was class based, but not object oriented. JavaScript and Self are object oriented, but not class based. And JavaScript does have inheritance, a reduced form of the same differential inheritance that Self has (only one parent, can only be assigned at construction time). New objects inherit from the object in the prototype field of the constructor object.

      • by t2t10 ( 1909766 )

        JavaScript and Self are object oriented, but not class based.

        They are "object oriented" only because they insisted on using that buzzword. It might be reasonable to call them something else.

        But whatever you call it, it doesn't work well. Prototype-based "OOP" seems conceptually simpler, but it ends up being more complicated and harder to maintain in practice. It was a good thing to try, but it's an experiment that has failed.

    • by ltmon ( 729486 )

      I really don't think you understand Javascript quite enough to be commenting this strongly on it.

      It does have types, to speak of and to use. They are in the spec, they are in the language, they work. http://bclary.com/2004/11/07/#a- [bclary.com]
      Since when has "+" appended 2 numbers? When they are strings I would imagine, which is exactly what most languages do. You might need to get your head around javascript types to stop this happening.
      Javascript has scope -- it's quite well defined.
      Object oriented does not mean clas

      • Since when has "+" appended 2 numbers?

        Two objects that have always contained numerical values, were assigned numerical values, are treated as strings. You always have to explicitly cast them as numbers. Which is bogus. Just the typing alone hurts my fingers.

        Javascript has scope -- it's quite well defined

        Yes, its well defined as being almost pointless, but, yes, you are right it has "scope."

        Object oriented does not mean classes

        Umm, yes it does. You may call them what you wish, but "object oriented" has a definition and means something. Inheritance, polymorphism, etc. Of which, javascript has not.

        Javascript may be a standard, bu

        • Wikipedia defines "Object-Oriented Programming" as

          a programming paradigm using "objects" â" data structures consisting of data fields and methods together with their interactions â" to design applications and computer programs.

          I know you probably only went to a school which taught Java, and so don't understand that object oriented programming can look like something other than Java, but, in fact, it can. Classical inheritance, polymorphism, etc, are good companions but they do not define the par

          • by Nursie ( 632944 )

            Pretty sure that inheritance is actually part of the definition of OO, in fact java is not seen as pure OO because it dissalows multiple inheritance.

            but what do I know? I'm just a C programmer...

            • Pretty sure that inheritance is actually part of the definition of OO

              It's not. It's part of definition of class-based OO, but there's also prototype-based OO (which JS belongs to), and other more exotic schemes.

              in fact java is not seen as pure OO because it dissalows multiple inheritance.

              I've no idea where you've got that one from. Java is not seen as pure OO for the sole reason that not all of its values are objects - it also has primitive types such as "int" and "float", values of which aren't objects, which do not participate in type relations etc.

              In contrast, in e.g. Python every int is an object (implementation-wise it's optimized, of course, so

        • Two objects that have always contained numerical values, were assigned numerical values, are treated as strings. You always have to explicitly cast them as numbers. Which is bogus. Just the typing alone hurts my fingers.

          Bu-u-u-llshit! Try the following

          var i = 1; var j = 2; alert ( "This is a test : " + ( i + j ) );

    • by roman_mir ( 125474 ) on Saturday May 07, 2011 @07:01AM (#36055650) Homepage Journal

      Javascript doesn't have types to speak of

      str = "10" + 2; - becomes "102"
      num = 10 + 2; - becomes 12
      num = 10 + 2 + "2"; - becomes 14

      num = "10" - 3; - becomes 7
      num = 10 / "2"; - becomes 5
      num = "2" * 4; - becomes 8

      num = 35.00;
      str = "VALUE IS: " + num; - this becomes "VALUE IS 35".

      --

      Sure, it's a bit strange, but nothing extraordinary.

      ---

      No scope to speak of

      well, it's not true really. In the following example x will have global scope and y will be local to its function:

      x=2;
      function test() {
          y = x + 3;
      }

      --

      no real notion of classes

      function Person(name, gender) {
              this.gender = gender;
              this.language;
              this.name;
              this.toString = function() {
                      return '' + this.gender + ' ' + language;
              };
      }

      Person.prototype.getName = function() {
              return this.name;
      };

      var person = new Person('Bob', 'male');
      person.language = 'English'; ...

      person.gender - this is 'male'
      person.language - this is 'English'.
      person.toString() - this is 'male English'.
      person.getName() - this is 'Bob'.
      --

      Of-course you can also just evaluate a string into a class on the fly, few language allow that:
      eval('
      var person = {
              name: "Bob",
              gender: "male",
              toString: function () {
                      return this.name + " " + this.gender;;
              }
      }
      ');

      person.name - this is 'Bob'
      person.gender - this is 'male'.
      person.toString() - this is 'Bob male'.

      No inheritance

      - well, there is the keyword "inherits" and it does allow an object to be extended and you can use the 'prototype' to have multiple inheritance.

      --
      I am not saying this language is wonderful, whatever, but saying it is lacking various features, that it clearly has, even though they look different from other languages... it's disingenuous.

      As to the question whether this language has anything that others do not, again, how about on the fly reflection via evaluation of strings into objects? When I first saw that over a decade ago, I thought it was a neat concept then, I still think it's a neat concept today.

      • by emj ( 15659 )

        num = 10 + 2 + "2"; - becomes 14

        No that becomes 122.

      • by Tetravus ( 79831 )

        No scope to speak of

        well, it's not true really. In the following example x will have global scope and y will be local to its function:

        x=2;
        function test() {

        y = x + 3;
        }

        --

        The declaration of the variable 'y' in the example is missing its keyword 'var' and will unintentionally create a globally scoped variable.
        Should be:
        var x = 2;
        function test(){
        var y;
        y = x + 3; // could also place the var statement inline with assignment operator
        }
        console.log(x); // prints 2 to the JS console
        console.log(typeof y); // prints 'undefined' to the JS console

        - well, there is the keyword "inherits" and it does allow an object to be extended and you can use the 'prototype' to have multiple inheritance.

        The prototype inheritance pattern doesn't allow for true multiple inheritance (like what C++ has). However, you can fake it by munging function

      • No scope to speak of

        well, it's not true really. In the following example x will have global scope and y will be local to its function:

        x=2; function test() { y = x + 3; }

        Have to correct you here: In JavaScript, ALL variables that are not explicitly declared with var are declared global. It's without question the worst "feature" of JavaScript. In your example, both x and y are global. The correct example code is:

        x = 2; function test() { var y = x + 3; }

        However, like almost all problems with JavaScript, running your scripts through Douglas Crockford's JSLint [jslint.com] (and strictly adhering to it) pretty much eliminates that issue. It can be run on the command line as part

    • Mod parent up some more.

      It may have some of these features, but they are a trap. People talk about it being object oriented and so on, and there are some features that make it look that way, it is a trap that leads you into programming hell.

      Then the fact that every implementation of the language is some variant or another and you need browser specific code in real world Javascript.

      All all of these libraries? They sound nice and all, but when you go to use them you quickly find yourself dropping to low level

      • by xero314 ( 722674 )

        Then the fact that every implementation of the language is some variant or another and you need browser specific code in real world Javascript.

        This is in no way a fault of JavaScript or even the browsers implementation of JavaScript. This tends to be because of the libraries you might be using through JavaScript, such as the DOM library or other built in browser functions. Those have nothing to do with the language that is JavaScript, though people confuse them a lot. This would happen with any language, as it's up to the browser implementor to implement the libraries. Try using JavaScript in a pure JS interpreter without calling out to other

        • So? It still makes Javascript a giant pain in the butt to use. I don't care who's fault the suckage is, what is important is how it affects my enjoyment of life. Up or down.

          And Javascript is a down.

    • by xero314 ( 722674 )

      Javascript doesn't have types to speak of, doesn't handle numbers very well, I mean seriously "+" appends two numbers? No scope to speak of. It looks object oriented, but has no real notion of classes. No inheritance.

      You clearly know nothing about javascript. JavaScript has types. These types are not dynamic but can be auto-cast using clearly defined rules. JavaScript is fully object oriented. All types are objects, even functions. JavaScript has very clearly defined scope (you use curly brackets to define all scope in JavaScript). With out scope there would be no possibility of closures. And of course JavaScript handles numbers just fine (excusing the standard IEEE oddities that all IEEE compliant languages have).

  • by Timmmm ( 636430 ) on Saturday May 07, 2011 @06:15AM (#36055508)

    When did it become acceptable to have the content take up only 1/4 of the page width?

  • Isn't Javascript flexible enough to let programmers define their own programming styles without the need to tinker with the language proper?

    It seems to me most of the innovation in the Javascript space is taking place in libraries/frameworks (like jQuery, Dojo, Scriptaculous, Prototype, YUI, GWT and so on), as it should.

    What will the point of some new syntax be?

  • I don't see where anyone has yet mentioned Doug Crockford's excellent videos on JavaScript. These are all on YUI theater. http://developer.yahoo.com/yui/theater/ [yahoo.com] All the criticisms mentioned here are discussed in depth. Crockford deals with the good and bad parts of JavaScript from the perspective of years of detailed research on it. And like it or no, JS is available in a useful, common subset on all modern browsers. The whole HTML, CSS, DOM, JavaScript ball of wax is a kludge that happened by the ch
  • by Animats ( 122034 ) on Saturday May 07, 2011 @10:11AM (#36056384) Homepage

    The C++ standards committee has been lost in template la-la land for the last decade. They've focused on features understood by few and used correctly in production code by fewer. Since the discovery that the C++ template system could be abused as a term-rewriting system to perform arbitrary computations at run-time, that concept has received far too much attention. It's an ugly way to program, but it's "l33t". On the other hand, they've been unable to fix any of the fundamental safety problems in the language. C++ is unique among mainstream languages in providing hiding ("abstraction") without memory safety. (C has neither, Simula, Pascal, Ada, Java, Delphi, Erlang, Haskell, Go, and all the "scripting languages" have both.) So there's an example of a committee screwing up.

    On the Python side, we have von Rossum. The problem there is that he likes features that are easy to implement in his CPython implementation, which is a naive interpreter, even if they inhibit most attempts at optimization. As a result, Python isn't much faster than it was a decade ago, and is still about 60x slower than C. Attempts to speed it up have either failed or resulted in insanely complex, yet still sluggish, implementations. So that's the "guru" approach.

NOWPRINT. NOWPRINT. Clemclone, back to the shadows again. - The Firesign Theater

Working...