Follow Slashdot stories on Twitter


Forgot your password?
GNOME Programming News

Gnome Goes JavaScript 387

mikejuk writes "Much to most programmers' shock and dismay Gnome has made JavaScript its main language for apps. It will still support other languages and it still supports C for libraries, but for apps it is JavaScript that rules. JavaScript seems to be a good choice for Gnome 3, as the shell UI is written in the language. It is also consistent with the use of JavaScript in WinRT, Chrome Apps, and FirefoxOS apps, and generally the rise of web apps. As you might expect, the initial reactions are of horror at the idea that JavaScript has been selected rather than the favorite language of the commenter. There is a great deal of ignorance about (and prejudice against) JavaScript, which is often regarded as an incomplete toy language rather than the elegant and sparse language that it actually is."
This discussion has been archived. No new comments can be posted.

Gnome Goes JavaScript

Comments Filter:
  • Enough rope (Score:3, Interesting)

    by Anathem ( 1983388 ) on Monday February 04, 2013 @02:29PM (#42787317)
    Javascript is fine, it just give you enough rope to hang yourself. (and a little extra, as it turns out) The language itself has some patterns that allow for terrible patterns, and ambiguity, but all in all, I don't think it's bad. Waiting for someone to disagree...
  • Re:Enough rope (Score:5, Interesting)

    by Austerity Empowers ( 669817 ) on Monday February 04, 2013 @02:36PM (#42787387)

    You could argue C gives you all the rope you need as well.

    I keep asking myself "what language should I learn that's accepted everywhere, doesn't have to be compiled for a particular processor, and has a truly cross platform UI". Javascript is it, with C coming in a heavily qualified second, Java most 3rd except for that fruit company (and I know Java, but hate it passionately).

  • by sanosuke001 ( 640243 ) on Monday February 04, 2013 @02:40PM (#42787445)
    loosely typed language without declaration requirements for methods/variables makes it such a huge pain in the ass to debug/understand/update source that I want to have nothing to do with it.
  • by Maltheus ( 248271 ) on Monday February 04, 2013 @03:04PM (#42787729)

    Javascript is fine, once you divorce it from all of the browser peculiarities, but it's an untyped language and untyped languages suck for refactoring. They should never be used for complex apps requiring maintainability. And yes, that goes for python too.

    Yeah, I know they said "apps," but even most apps quickly grow beyond the comfort zone of a script.

  • by houghi ( 78078 ) on Monday February 04, 2013 @03:25PM (#42787979)

    XFCE is the new Gnome. I hate both KDE and GNOME. Luckily there is XFCE (and LXDE).

  • by squiggleslash ( 241428 ) on Monday February 04, 2013 @03:28PM (#42788001) Homepage Journal

    It's very popular on the mobile side, and it's a tribute to Javascript's power, ease of use, and flexibility that people use it despite usually being required to use it in a sandbox where all user interaction has to be written in HTML and accessed via the DOM, two of the most ugly technologies ever designed.

    Python... heh. COBOL meets perl, they have a baby, BOOM, Python. Awesome. You were joking right? Isn't the selling point of Python that it has so many libraries and so much stuff in them you don't even need to do any programming?

  • Re:Enough rope (Score:3, Interesting)

    by rs79 ( 71822 ) <> on Monday February 04, 2013 @03:32PM (#42788073) Homepage

    I learned C when it was two years old and have touched the mimeograph Bell Labs C manual with dmr's penciled in notes (yes, I'm bragging). I did computer languages at Waterloo and have written a few at least one of which is still in use today. So I make a point of trying all these new languages that come out and I've tried them all from Snobol to Erlang. They're all fucking retarded.

    JavaScript rawks. Utterly. Among my friends I've noticed they've all quietly moved to js and node.js independently, as I have. It's really that good, so this is an obvious and wise choice.

    It's just a pity about the name, Java is so bad and JavaScript so good; ECMAscript doesn't exactly roll off the tongue though. It this point I think it would be most prudent to kill off the current Java (or rename it LarryScript) and rename Javascript as Java so Java can finally live up to it's promise.

  • by oGMo ( 379 ) on Monday February 04, 2013 @03:41PM (#42788177)

    Gnome has always been on the wrong track from day 1. It was a political response [] to KDE's use of Qt (which was QPL [] back then) and always a mishmash of libraries and utility applications rather than a fundamentally solid desktop environment. That it might have been usable at some point is more luck than anything.

    I don't use KDE (or GNOME, I prefer RiscOS On X [] because it's insanely fast and powerful), but at least KDE has had a solid vision from the get-go, if sometimes flawed.

  • Comparing Python to Javascript and saying they are both the same is just wrong - for one, Python is strongly typed, but dynamic, not weakly typed like JavaScript.

    While I agree static typing makes maintaining complex applications easier, Python does a lot to reduce the issue. The language and culture are built around code being readable and maintainable, it's strongly typed, it follows the idea that nothing should ever fail silently, which greatly reduces the chance of issues cropping up. This makes Python completely usable for a wide range of applications. Yes, in some cases, a statically typed language will be easier to manage, but that's not the case in 'anything beyond the comfort zone of a script'.

    JavaScript, on the other hand, is full of awkward stuff that makes it hard to program in. Things fail and return random values, stuff like that. Add to that a poor syntax for readability and JavaScript is pretty hard to maintain.

  • by BitZtream ( 692029 ) on Monday February 04, 2013 @04:06PM (#42788481)

    I'm one of the first C programmers and I've switched to js and node.js. it's better and faster than C.

    Then you're doing it wrong. And if you had half as much experience as you claim to have in this and your other post, you would understand that.

    Just because you've written some C, doesn't mean you know what you're doing. I've worked with plenty of 'programmers' who have been 'doing it all their life' or better yet, 'longer than you've been alive' (refering to me) and those statements universally come from people who suck and are too stupid to realize it.

    You go on to further my point about you not really knowing what you're talking about when in other posts you talk about the x86 emulator written JavaScript as if thats supposed to be something to show how awesome it is. When you make that awesome emulator there out run my copy of QEMU without kmod, then perhaps I'll give you a listen, but you've got to be absolutely retarded to actually think JavaScript as a language has a technical reason for it to be faster than compiled C in reality, you being unable to write quality C withstanding.

    Yes, decent Javascript can out run really really shitty C, but only if you stack the deck so that C doesn't have a chance first. Just because you've seen a porn, doesn't mean you know how to be a parent.

  • by hackula ( 2596247 ) on Monday February 04, 2013 @04:35PM (#42788775)
    Hmmm... javascript is pretty much the exact opposite of lock in. It is the closest a language has really come to being "write once run anywhere". Even most node.js stuff runs in the browser and vis versa with ease.
  • by Anonymous Coward on Monday February 04, 2013 @04:47PM (#42788951)

    Python... heh. COBOL meets perl, they have a baby, BOOM, Python. Awesome. You were joking right?

    These statements make it clear that you don't know very much about Python, and much of what you do know is probably wrong. That or else you are trolling.

    Python was designed by Guido van Rossum (GvR), a computer geek who was also a math geek. He designed it to be clean and regular; there aren't a lot of weird punctuation operators like in Perl. It's a lot more terse than COBOL... well, anything designed later than 1960 is. I'll just bet the reason you even mentioned COBOL is the significant whitespace thing... oh wow, you're so smart, I'm impressed, really.

    GvR based Python on a teaching language called ABC, and to some extent the C language. Regular expressions are credited as being copied from Perl but that's about it.

    The Python community agrees that this is a good summary of the philosophy of Python:

    The Zen of Python, by Tim Peters

    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!

    Perl folks are proud of saying "there's more than one way to do it" and Python explicitly rejects this philosophy.

    Isn't the selling point of Python that it has so many libraries and so much stuff in them you don't even need to do any programming?

    The Python community does say "Batteries Included"... Python has a lot of useful stuff you can use. You said the above like it's a bad thing and I'm not seeing it.

    The worst thing about Python is that it is a lot slower than other languages. I don't like Java as much as I like Python, but Java is at least fast. You can get a lot of useful work done in Python and it can even be fast, but the fastest Python is the code that relies on built-in features and C library code, so the fastest Python is the Python you didn't write.

    Python is a much cleaner design than JavaScript. There are fewer land mines for newbies to step on. I'm a Python fan, but I'm not that worked up about the GNOME guys picking JavaScript.

    But Python as a bastard offspring of COBOL and Perl? Nope.

  • by rs79 ( 71822 ) <> on Monday February 04, 2013 @05:59PM (#42789945) Homepage

    Well, the first metric I saw when when a web server written in node was faster than Apache.

    I know there's a lot of variables there, but still, when an interpreted language beats C for something like this, that's impressive.

    TO be sure, you can do the kind of I/O js does in C, but it's a real pain and usually platform dependant in some way, even the difference between linux and bsd can start the ifdefs popping up, but js brings asynchronous I/O to the 10 GOTO 10 crowd. That, and the fact the js x86 emulator not only works but runs linux under which you can edit, compile a real program no slower than unix used to be on an 11/45 and you're doing this in a browser tab.

    That's the metric I use for me to consider it fast. Obviously this is a contentious and complex topic, but as a rough approximation, I think it's fast.

    Or at least it CAN be. The loops FB makes it jump through are insane and they manage to kill any js interpreter they throw at it and even the mighty V8 is now starting to strain so something will have to change there. But if they knew what they were doing it'd be as slick as it was performance wise 3 years ago, this isn't the fault of js, just bad (or no) performance profiling and tuning in Palo Alto.

    So, while this may not mean any code you write will be fast, if you're used to real-time programming you'll love the language and the stuff you can do now with css3/html5 (gradients, css-masks) may not have the underpinnings of the next Pixar like NeXt did, there's still enough there to, say, keep the molbio crowd happy for the next decade with very fast real time renderings of molecules they can play with to cite one example.

    I agree the success of is tied to the web, but so what, that's like saying the success of C was only because of Unix.

Do not underestimate the value of print statements for debugging.