Slashdot Mirror


Why JavaScript Is the New Perl

theodp writes "'People are thoroughly excited [about JavaScript],' writes Lincoln Baxter. 'However, I'd akin this to people discovering Perl during the advent of C and C++ (mirror). Does it work? Yes. Is it pretty? Not by a long shot.' Baxter adds, 'While I do like both languages, JavaScript [is] just waiting for the next technology to come around and make it look like Perl does today: pervasive, but lacking enterprise adoption on large applications.'"

308 of 453 comments (clear)

  1. I don't.. by Jamonek · · Score: 1

    I don't see why not keep it as the web language it is.

    --
    http://mc.jamonek.com - Minecraft Signature Generator
    1. Re:I don't.. by Anonymous Coward · · Score: 5, Insightful

      JavaScript is a horrible language.

      Even with frameworks to significantly alter it's behaviour, it is still a mess. The weird scope rules and lack of proper object/class support drive me up the wall when working on projects with ~40,000 lines of code.

      HTML5 will become a much more realistic technology the day we can use a half decent language.

    2. Re:I don't.. by Nerdfest · · Score: 5, Insightful

      It's extremely hard to create something large an keep it maintainable in JavaScript. It's not quite the 'write-only' language Perl can be, but it's not great. It seems to be a symptom of all dynamically typed languages to a degree, but JavaScript even lacks the consistency of many others. It's possible to create maintainable code, but the language fights you.

    3. Re:I don't.. by techhead79 · · Score: 5, Insightful

      . It's possible to create maintainable code, but the language fights you.

      A thousand times this!!!

      I work in a large company where we have a different GUI team that designs our screens. Increasingly over the past few years they have been building screens with more and more JavaScript requirements. Users seem to want to see everything dynamically loaded...page replaces are somehow evil and ugly...give me a fucking break already...if they had any idea how much more it costs them to build the screens they design they wouldn't be doing it.

      Pretty screens == almost impossible to maintain code. It's as simple as that and until something better comes along than JavaScript it's going to be a nightmare for most of us to deal with production issues. What's worse is when not even id's of elements on the page make sense so you wind up with id's that make the JavaScript code look even more confusing. I've built some of the most complex systems at my company that are heavy in JavaScript. We did a great job according to everyone around. But I know there are some things we can never correct because of the language we are dealing with.

    4. Re:I don't.. by Anonymous Coward · · Score: 5, Insightful

      You're confusing the API with the language. Web programs are unmaintainable because the API isn't an application programming interface by a long shot. The language itself is pretty nifty, if you understand and use its functional aspects. It wasn't designed to be used for big projects, so it lacks direct implementations of namespaces and other big project language features, but you can get around those limitations because the language is quite flexible.

    5. Re:I don't.. by K.+S.+Kyosuke · · Score: 5, Funny

      So you're saying that it's indeed a good replacement for Perl after all? ;-)

      --
      Ezekiel 23:20
    6. Re:I don't.. by Anonymous Coward · · Score: 1

      Libraries like backbone.js, and others make this possible. As with any language, it's the developer who makes it maintainable not the language

    7. Re:I don't.. by History's+Coming+To · · Score: 2

      I'm no JavaScript expert, but I can't help but wonder if it's not really designed for 40k line projects anyway? If you're taking advantage of it being run client side then you probably don't want to rely on the client having the resources for something big?

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    8. Re:I don't.. by Anonymous Coward · · Score: 1

      It seems to be a symptom of all dynamically typed languages to a degree

      That is it exactly. This is true for the same reason that there are no good IDEs for dynamically-typed languages, namely that it is impossible to know at any point what code will be called.

      I posit that this is axiomatically true, due to the Computability Problem.

    9. Re:I don't.. by AuMatar · · Score: 4, Insightful

      Namespaces are pretty trivial to get around the lack of, C programmers have done it for 40 years and there's plenty of large systems written in it. It just takes discipline- prepend your function names with the module name. If you're in namespace window and have a function getHeight, you write it as window_getHeight. It takes a little bit of discipline, but not that much.

      The real problem with web programming being unmaintainable is a combination of several factors, pretty much in this order:

      1)Web programmers tend to be lower skill programmers. This is for historical reasons- when web apps didn't do much, good programmers wanted to work on more complex problems not just write a GUI for the hundredth time. It tends to be considered an entry level job, pays less,and lacks respect among programmers. Also, the lower barriers to entry on web programming means a lot of self-taught people enter that part of the field, who never really learn CS or software engineering.

      2)There's a hack it and get it done mentality to web programmers. This comes from the quick cycle nature of web programming (which tends to be very visual based and small changes are easy to make on the fly) and the abundance of "agile" methodologies which tend to lack in design. Its made worse by how poor a markup language html/css are for what we try to make them do today and the amount of hacking that's necessary to get around browser incompatibilities.

      3)The entire AJAX and framework of web programming is wrong. It was a quick hack added so that you could make dynamic apps using existing technologies without major changes to clients. But its layered hack upon hack upon hack. We really need to scrap it all and come up with a web application programming stack- a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way), an HTTP replacement that's stateful rather than stateless, a cleaner way of sending data back and forth from the server. But if you write on top of an ugly platform, you're going to get ugly code.

      4)Language issues. Javascript was never a good language- hell, you can tell that from the fact it's very name was a blatant marketing maneuver. Lack of a good object model is a real problem. Ideally you would want to be able to use any language here- maybe it's time to start delivering apps as byte code binary so the actual app can be written in whatever the programmer thinks best.

      Unfortunately the last two of those would require fixes by the major browser vendors, the first two would take a decade of culture change to fix. So its going to continue to suck for a while.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    10. Re:I don't.. by sourcerror · · Score: 1

      The point is, every little AJAX call has to be mapped to an URL. If your web framework comes with good AJAX support then it's manageable, but if they're using a homegrown framework with barebones Prototype and JQuery, then it can become painful. You can say it's not the language, but for most users Javascript is a domain specific language.

    11. Re:I don't.. by techhead79 · · Score: 2

      It wasn't designed to be used for big projects, so it lacks direct implementations of namespaces and other big project language features, but you can get around those limitations because the language is quite flexible.

      In my most recent projects we did use Namespaces where we could. We also used JavaScripts bastardized version of OOP class syntax. Do you know how many developers in the company or on the project even understood that class syntax? Not many. Even the guy who wrote them (me myself and I) find them horrible to manage when dealing with even simple updates to POJOs in Java that then also must be reflected in the JavaScript class constructors. Poor design I'm sure you'll be claiming...but let's be clear...we had zero control over the gui requirements. There was no other alternative after considering alternatives for months...so don't pipe up claiming anyone that is a critic of JavaScript simply doesn't understand it. I understand it fine...and no JavaScript I've written or have seen written is as easily understood as any number of other languages when you get past just simple dhtml.

      The point anyone against JavaScript will make is something I don't anything could disagree with. JavaScript was not designed to do the things we are doing with it today. That is the reason why it's so difficult to maintain JavaScript. If all we were doing with it was simple math or simple DOM changes then no sweat...

    12. Re:I don't.. by dkf · · Score: 5, Interesting

      1)Web programmers tend to be lower skill programmers. ...

      2)There's a hack it and get it done mentality to web programmers. ...

      I agree with these two statements. But your next one:

      3)The entire AJAX and framework of web programming is wrong. It was a quick hack added so that you could make dynamic apps using existing technologies without major changes to clients. But its layered hack upon hack upon hack. We really need to scrap it all and come up with a web application programming stack- a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way), an HTTP replacement that's stateful rather than stateless, a cleaner way of sending data back and forth from the server. But if you write on top of an ugly platform, you're going to get ugly code.

      That's just ignorant of how nasty client programming really is. The reality is that using a stateless base layer of HTTP and building a state system on top of that (e.g., with REST) is significantly easier to make work properly in a hostile physical network environment than what you propose.

      AJAX is one heck of a lot easier to deal with though once it's been tamed with a library like jQuery, and once you've wrapped your head around asynchronous programming. Some programmers never really get async programming (I feel sorry for them, missing out on such powerful techniques) but it is really very useful for almost all network and GUI coding. There's no shame in using a library to make networking nicer; raw POSIX socket calls are horrendous from the perspective of the vast majority of application programmers...

      4)Language issues. Javascript was never a good language- hell, you can tell that from the fact it's very name was a blatant marketing maneuver. Lack of a good object model is a real problem.

      There's not much wrong with prototype-based object models; they're different, not wrong. If you were going to rag on the language design, it would be far better to grouse about the "fun" gotchas in scoping and the way one handles modularization...

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    13. Re:I don't.. by klingers48 · · Score: 1

      Tell me about it. I've been having all kinds of issues using JQuery lately on an ASP.net MVC project using Telerik tab controls and lots of other revolting dynamic calls that redraw screen elements. Making sure things are picked up by the DOM is a pain in the ass.

    14. Re:I don't.. by mcvos · · Score: 1

      I guess TFA is about node.js? We've known for ages that Javascript was a terrible language, and that hasn't stopped it from becoming huge, and being supported by every browser. Javascript on the browser isn't going away. The big question is whether we should really want it on the server too.

      I recently was at a talk by someone who used javascript and AJAX on the client, node.js at the server, and MongoDB to store javascript objects, either from client or server. I'm sure you can imagine the possible security issues for a setup like that.

    15. Re:I don't.. by Anonymous Coward · · Score: 5, Insightful

      Ah. I see your problem. Telerik.

      Their controls were all server-side .Net 1.1 controls, then they bolted on .Net 2.0, 3.5, 4.0, and now 4.5. Somewhere around the 3.5 era (the big AJAX push), they realized that more stuff needed to be client-side for that "web 2.0 feel" or whatever. So that got bolted on also. Now it's not just a steaming pile of crap, it's a steaming pile of crap with five more steaming piles of crap piled on top of it.

      Your best option at this point is to start over. Trust me on this. I've been where you are, and the best way out is to drop Telerik. The sooner the better.

      If you must have a "tab control", it's not that difficult to slap together a tiny bit of Javascript to do what those controls do for you, and then you have the power to make changes to it later, rather than begging Telerik for an update to their black-box, then being told you have to pay to upgrade.

    16. Re:I don't.. by thetoadwarrior · · Score: 4, Insightful

      It's awful for large scale projects. That's why things like GWT exist or why people have about a hundred other ways to write anything but JS and have it compile to JS.

      Some people act like that's cool and JS gets to be the web assembly but it's not cool. It's a hack job because JavaScript sucks for large projects. It wasn't intended for that and no one is willing to really improve the language or add another language that does a better job for larger tasks.

    17. Re:I don't.. by Anonymous Coward · · Score: 1

      raw POSIX socket calls are horrendous from the perspective of the vast majority of application programmers

      And yet, WebSockets exist. This tells me that some people have forgotten what a web browser is supposed to be used for. Last I checked, it was for HTTP (that's HyperText Transport Protocol) communications on a socket, not some other kind of protocol, or worse, ad-hoc protocol.

      And before the cheerleaders go all "rah rah it's great!" on me here, let me just say this: What's the point of using a socket different from the one you're already using? You already have a platform defined by the process of opening HTTP connections for two decades. Why do you need a different socket connection? What asinine protocol have you (re)invented that can't be done through HTTP? Something stateful? You mean like FTP? POP3? Yeah, those are fantastic. The statefulness in those protocols made them ever so reliable and secure. (I hope your sarcasm knives are sharpened...) Good luck in your endeavors, but I won't be supporting your code. If I ever have to "maintain" that crap, I'll recommend its retirement and write its replacement while it hobbles through its final days.

    18. Re:I don't.. by Anonymous Coward · · Score: 1

      #2 is a strange comment. I've worked on three operating system teams, compiler teams, networking teams, and a multitude of other core technologies -- and all of them at some point.... "hack it" due to pressure to meet deadlines. in terms of engineering methodology, you are not going to like this, but todays modern web teams when it comes to requirements management, product life cycle, design, test, and deployment --- will smoke most core technologies teams. In fact in Silicon Valley, most core technology teams are still stuck in a 1990's mindset (C, C++, Waterfall, Perl, Make, Emacs). Most of these teams when you talk to them about what is going on in the 00's dismiss the "web" technology as substandard and inadequate -- and often never having spent any time with the new technologies. There are a lot of questionable technologies in the "web" segment, but there are a lot of very good things going on too.

    19. Re:I don't.. by viperidaenz · · Score: 5, Insightful

      no one is willing to really improve the language or add another language that does a better job for larger tasks.

      http://code.google.com/p/dart/

      The problem isn't "no one is willing..."
      The problem is every vendor needs to support the new language/features or it is effectively useless.

    20. Re:I don't.. by viperidaenz · · Score: 1

      The language is fundamentally flawed. It is impossible to create good tools for it. IDEA Webstorm comes close but it's still a huge long shot from Java IDE's.

      That's the sole reason Google created GWT and Dart. Because decent tool support for Javascript is impossible.

    21. Re:I don't.. by viperidaenz · · Score: 2, Informative

      Web browsers are for browsing the web. http, ftp, gopher, mail, news. If they were supposed to be restricted to http, they'd be called http browsers.

      Web sockets were created because HTTP lacks efficient two-way communication. polling. long polling, comet, insert-new-buzzword-here are inefficient hacks to allow a client to be notified of a server generated event.

    22. Re:I don't.. by Anonymous Coward · · Score: 1

      Get a clue, javascript is exploding right now, and it's not going away. We have these things called standards. Javascript is a standard. Big enterprises like Google, Microsoft, Facebook have all invested heavily in Javascript. Javascript is where all the innovation is happening right now.

      I can create a web server and a real time socket server on port 80 in one line of Javascript code. Look at the most popular projects on github right now and guess what? They are overwhelmingly Javascript. It's not going away, because it is part of this thing called the Web, maybe you've heard of it.

    23. Re:I don't.. by ralphbecket · · Score: 5, Insightful

      I have coined a rule after myself. I give you, Ralph's Rule: "There is no technology so poorly conceived, so inconsistent, so aesthetically offensive, or so woefully untouched by theory that it will not see widespread adoption in the Web community."

    24. Re:I don't.. by gutnor · · Score: 1

      There is maybe nothing wrong with the prototype-based object models and I agree. However, javascript has a lot of awful hack everywhere that make the langage a bad langage (this, scope, ===/==, type consistency, ...). The only way to have fun with javascript is to avoid the minefield of half-broken feature and concentrate on the good part (there is even a book called that way).

      Another problem of javascript, is that until ECMA-5, the support for prototype-based object model was very poor. You needed to write load of low level plumbing operation even if you just wanted to stick with javascript native oo design.

      Javascript is a beta-version language, it should have been through several refinement cycles before being made public.

    25. Re:I don't.. by Will.Woodhull · · Score: 5, Insightful

      Perl is not a 'write-only' language. There are definitely 'write-only' code monkeys out there who abuse Perl and pass themselves off as knowledgeable programmers. But that is not the language's fault. If you design a language that will stay out of the way of the programmer as he develops his solution, then you of necessity have a language that assumes the programmer knows what he is doing even if he's full of shit. That's Perl's strength, and also the source of its bad rep.

      Perl is a lot like the English language, both are capable of exquisite expressions. But just as more than 90% of English prose that is written today is unmitigated biz-lingo crap, and half of the rest is no better than Harlequin romance garbage, so too most of the Perl scripts that you see are junk. But if you want a language that a Shakespeare can use, you have to put up with the trash. With one exception that I know of[1], a programmer who knows what he is doing can write excellent and easy to understand programs in any computer language. Perl actually makes it easier to do that than many languages do.

      [1]The sole exception I am aware of is Forth. That is truly a write-only language.

      --
      Will
    26. Re:I don't.. by shutdown+-p+now · · Score: 3, Interesting

      The language itself is pretty nifty, if you understand and use its functional aspects.

      Can someone explain why JS fans keep trotting this "functional aspects" bit as if it were a redeeming feature of the language? It may have been in the 90s, but we came a long way since then. All competing "scripting" / dynamic languages have the functions as first class types and function literals (even PHP!), and most of them have better, more concise syntax for them, too - e.g. Python lambda x: x*2 or Ruby {|x| x*2} vs JS function(x) { return x*2; }. Heck, even C++ has that these days! It really isn't the kind of feature that you get to show off and tell how cool it is.

      And, that aside, what else can JS boast of? Prototype-based OOP is a dubious feature at best, and everything else in the language is a mess, from magical semicolons to scoping rules for local variables and "this".

      It's more logical than PHP, though, I'll give you that.

    27. Re:I don't.. by tknd · · Score: 5, Insightful

      I'm not sure why this comment is modded so highly. The reason web programming sucked was because we have things called browsers that restricted our capabilities. Add on to that the need for everyone to agree to standards which caused progress in browser technology to slowly adopt newer technology. It is still the same problem even today.

      Think about it for a second even if you aren't a web programmer. There was a reason (not just Microsoft) for IE6 adoption: it actually, at one point, implemented more than the competition. Mozilla was around but not nearly as capable. Netscape, too, was around but clearly lacking in the quality and performance of IE at that particular point in time. But everyone would rather believe that IE6 was just flat out terrible throughout its entire existence. To that I ask, would you like to use and program for Netscape 4 or 5 for the same period IE6 was dominant? Obviously not! What we should have received is more intense competition rather than a lengthy side lawsuit about how MS abused its monopoly.

      To make a long story short, Netscape was not our savior, Microsoft was still the bad guy (honestly), and the world finally learned that monopolies sucked. The true turning point wasn't until Mozilla came around with Firefox and other companies like Apple and Google began creating their own browsers for the purpose of expanding web technology. It wasn't until Firefox, Safari, and Chrome browsers that we finally exited the lack of improvements in client browser technology.

      Any industry stuck in an old way of doing things is going to suck. It doesn't matter if you're the smartest person in the world. If you can only using a hammer, nails, and wood, you're not going to be building skyscrapers quickly or efficiently anytime soon. This is exactly what restricted the web and people that worked for the web.

      Now to address some key point presented by the parent:

      The entire AJAX and framework of web programming is wrong. It was a quick hack added so that you could make dynamic apps using existing technologies without major changes to clients. But its layered hack upon hack upon hack. We really need to scrap it all and come up with a web application programming stack- a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way), an HTTP replacement that's stateful rather than stateless, a cleaner way of sending data back and forth from the server. But if you write on top of an ugly platform, you're going to get ugly code.

      There is so much wrong with this claim that I don't know where to begin. Let's start with stateless programming since that's the key theme in this opinion. I would be curious to hear what the parent's idea of "right design" is when a service is expected to provide for millions of requests simultaneously. At some point you're going to be forced to parallelize that work. Congratulations, you've just been forced one step closer to implementing a stateless system. You see, in a stateless system, it is much easier to cut off pieces of work into bite-sized chunks to be handled out of order. When you restrict yourself to state, you're at the mercy of single threaded technology to get your work done. It is 2013, we have CPUs in our pocket phones that have 4 cores. Stateless is here to stay and it will become more pervasive even without any web interaction.

      Let's also look at how stateful systems do under latency. Just go play any online game to get a feel for this and login to some far off server that crosses an ocean or two. Your latency will suck, packets will be dropped, and the overall experience sucks. The internet was designed to be world-wide. It was designed to travel great distances where latency and reliability was a real issue. Packets are not guaranteed to arrive. This is why we have TCP and an in-your-face kind of restriction that things can time out. I mean we're sending huge amounts of data around the world for christ-sa

    28. Re:I don't.. by Alex+Belits · · Score: 2

      Anal stretching seems to comply with this rule with popularity of goatse.

      --
      Contrary to the popular belief, there indeed is no God.
    29. Re:I don't.. by TheLink · · Score: 2

      How efficient are those two-way web socket communications after the first NAT hop? Web sockets are probably more useful for malware authors :).

      Leaving a connection open to receive messages from the server is what many conventional TCP clients do. Same goes for polling. Just because it's HTTP doesn't magically make it bad.

      --
    30. Re:I don't.. by Dcnjoe60 · · Score: 1

      I work in a large company where we have a different GUI team that designs our screens. Increasingly over the past few years they have been building screens with more and more JavaScript requirements. Users seem to want to see everything dynamically loaded...page replaces are somehow evil and ugly...give me a fucking break already...if they had any idea how much more it costs them to build the screens they design they wouldn't be doing it.

      That's the problem with trying to use a thin client where the the user really needs a fat client. But today, everbody thinks that everything has to be in the browser, even if it isn't the correct solution for the problem at hand and we are forced to hack together something to give the user what they want.

    31. Re:I don't.. by Qzukk · · Score: 2

      a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way)

      Very few people want a pixel perfect rendering markup language. They just say they want one while using a table to get the content to reflow into three columns of identical height with each 33.3% of the width of the window, whatever that is or is changed to.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    32. Re:I don't.. by foniksonik · · Score: 1

      NodeJS has npm. Installing goes like this.

      npm install [library]

      It then goes and gets it, makes it available to node through a require call

      var myVar = require("[library]")
      myVar.method(arg1,arg2)

      very much like CPAN excepting syntax

      There are several hundred npm packaged libraries of high quality with full test coverage available.

      --
      A fool throws a stone into a well and a thousand sages can not remove it.
    33. Re:I don't.. by foniksonik · · Score: 1

      Nope. Can you elaborate? Node runs on the server just like Java. Same ability to secure it. JS in the client talks to the node backed server app like any other. Node and Mongo talk the same way Java and DB2 talk. Client JS never talks to Mongo, only to the webserver which passes GET or POST to a controller that talks to a model that queries the DB and returns data. The controller loads a view and merges the model data and returns a buffer to the web server along with headers and status info. Web server serves the buffer as the content type provided to the client. Rinse and repeat.

      Where are the security holes that are unique to this architecture?

      --
      A fool throws a stone into a well and a thousand sages can not remove it.
    34. Re:I don't.. by AlphaBro · · Score: 3

      If a simple tab control is all you're after JQuery UI is rather nice, as far as JavaScript goes.

    35. Re:I don't.. by Mostly+a+lurker · · Score: 1

      [1]The sole exception I am aware of is Forth. That is truly a write-only language.

      You have obviously never seen Brainfuck or any large program written in APL. They both make figuring out Forth programs seem like a breeze.

    36. Re:I don't.. by IICV · · Score: 3, Informative

      It just takes discipline- prepend your function names with the module name. If you're in namespace window and have a function getHeight, you write it as window_getHeight. It takes a little bit of discipline, but not that much.

      Whaaaaat. Why are you putting all your shit in the global scope in the first place? Use the module pattern, and none of those functions leak out of the file you're in.

    37. Re:I don't.. by Zontar+The+Mindless · · Score: 3

      The weird scope rules and lack of proper object/class support drive me up the wall...

      This tells me you don't really understand JavaScript and especially don't understand JS objects.

      But--judging from the number of people who keep trying to turn JS into something else--not many do.

      --
      Il n'y a pas de Planet B.
    38. Re:I don't.. by IICV · · Score: 5, Informative

      The weird scope rules and lack of proper object/class support drive me up the wall when working on projects with ~40,000 lines of code.

      I don't know, maybe I'm just weird myself but I don't think Javascript's scope rules are that hard to grasp, and the class support is workable but honestly most of the time you don't need to use classes at all.

      I mean, the scope is easy - are you in a function? If so, the variable is scoped to the function. If not, the variable is globally scoped. That's about it. Just wrap something like

      (function(){
      // code goes here
      }())

      around your script file, and everything will be local to that script file while still being able to see the global scope. There's some other funky stuff involving weird cases like using a locally scoped variable before it's defined, but as long as you're not writing crap on purpose it's not a huge deal.

      And as for classes - well, honestly, a lot of the time when you think "I need a class for this", what you really mean is "I've got some data that needs to travel together". In Javascript, you can just do that - you can just say:

      //here's a thing to hold my data
      var thing = {};
      //here's data to put in the thing
      thing.item1 = "something";
      //here's some more related data
      thing.item2 = {message: "I'm important!"};

      And then tada! You've got a class that carries your data around. Hooray!

      But if you really want classes, with methods and stuff like that, they're there too - but if you're writing a project large enough to actually need those sorts of tools, you really ought to be using a framework that'll handle the nitty-gritty of classes for you.

    39. Re:I don't.. by Zontar+The+Mindless · · Score: 1

      a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way)

      1. HTML is not a styling language, it's intended to provide document structure and semantics. Only. Please learn what CSS is.

      2. We do NOT want "pixel-perfect" layouts on the Web. This wasn't something we wanted in 1997 when we only had to worry about 640x480 vs 800x600 and it's something we want even less with the approximately eleventy-thousand screen sizes/resolutions in use on the ever-expanding plethora of devices people are surfing the Web on today.

      There are very, very, VERY good reasons for separating content from presentation.

      JavaScript has its little issues, but your lack of understanding of JS object prototyping is not among them.

      It is also a very good thing that you can easily view the source of so much of what comes to your browser. You contend that this is bad. I contend that you are wrong.

      --
      Il n'y a pas de Planet B.
    40. Re:I don't.. by Zontar+The+Mindless · · Score: 1

      Bravo. My kingdom for a mod point this morning.

      --
      Il n'y a pas de Planet B.
    41. Re:I don't.. by viperidaenz · · Score: 1

      The same as any other TCP connection, because after the websocket handshake, that's all it is.

      Polling has a lot of overhead. There's all the HTTP headers that get sent and received every time a poll is done. They get intercepted and modified by proxies along the way too.

    42. Re:I don't.. by TheLink · · Score: 1

      I think you miss my point. The server cannot connect to a web browser that's behind a NAT. Whether you use a web-socket or not.

      Hence the web browser leaving a http connection open to the server is more efficient than stuff not working at all.

      --
    43. Re:I don't.. by Ranx · · Score: 4, Insightful

      The problem is not JavaScript, but programmers who think "it's just a scripting language, how hard can this be". And they hit a brick wall again and again because JavaScript is a language with its own features, features that has to be learnt.

      And JavaScript is unmaintanable? It's just a programming language. It's up to the programmer to structure your code. How is that different from other languages? Of course it's possible to write maintainable large projects in JavaScript.

      I agree best practices and frameworks are still being developed and improved, but is JavaScript a horrible language? No, it isn't.

      --

      Me
    44. Re:I don't.. by LingNoi · · Score: 3, Interesting

      Web programmers tend to be lower skill programmers.

      This is a common misconception among c / c++ developers. Fact is it's simply not true, you have to deal with a multitude to complex issues that you simply don't need to deal with in native code development. I do both web and native code development and I can tell you that the tasks are just different not easier or harder.

      Your atitude in this respect reminded me of a guy that recently applied for a job position at the company I work. He was a c++ developer who wrote on his cover letter something along the lines of "I don't know any web development however because of my experience in native languages I think I will be able to easily pick it up". That's simply naive and wrong, as you can expect he wasn't selected.

      As for the rest you wrote I agree and disagree at the same time. Sure there are a lot of "make it work" attitudes however you get the same atitude in native code development too so it isn't something restricted to web development.

      a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way)

      No, no it is not. People who think like this do not understand web development, and almost no one apart from terrible developers treats it in the way you mentioned. Websites have to be designed to fit on everything from small mobile phones to big TVs. That's why everyone is trying to make their sites "responsive". Everyone is moving in the complete opposite direction to what you have mentioned in that the best way to build a site is with a css grid to make your site handle different resolutions.

      I agree that javascript is a terrible language fortunately things are improving if you look at the latest standards being developed for newer versions. I guess we can only hope that it improves to the point where it doesn't just outright suck.

    45. Re:I don't.. by trev.norris · · Score: 1

      As for another language coming along. Will never happen. The language of the web must be community driven. And the community always disagrees. You know how long it's taken to get some seemingly basic features implemented? Forever. You get Adobe, Microsoft, Mozilla and more than a dozen other companies involved and each one wants something that disagrees with the rest.

      And as for how it started? Netscape went to Brendan Eich and told him he had to write the language in 11 days. 11 days to implement the grammar, lexer, parser. Everything in 11 days. Then a bastardization version happened to be created by Microsoft, and bam. You have the language of the web.

      JavaScript might not be the best language, but when used by experienced developers (no the overnight self-taught kind) it can be awesome. But regardless it's here to stay. So I wish people would stop bitching about how bad it is and focus on helping the developer community get better.

    46. Re:I don't.. by mwvdlee · · Score: 2

      C lacks proper object/class support as well; is C a horrible language?
      JavaScript isn't a classic OO language, using it as such will not work.
      Try using JavaScript as a prototype-based language (http://en.wikipedia.org/wiki/Prototype-based_programming).
      JS has plenty of problems, there's no need to invent new ones.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    47. Re:I don't.. by shaitand · · Score: 1

      These aren't language problems they are programmer problems. Shitty coders write shitty unmaintainable code. They can do this in any language. Perl gets a bad rap because it incorporates a lot of symbols into the syntax but these are quite clear to anyone who actually knows Perl so long as the code was written and structured in a clear and consistent way.

      Perl also runs slowly if you try to write it like C code... even though Perl is implemented in C.

      The problem is twofold. First people write shitty looking code without proper commenting. Second people like to pretend that if you know one language you know them all and don't bother learning the proper way to do things in the language they are coding. Unfortunately, most languages will allow you to apply generic programming concepts in a way that does let someone just pick up a reference and apply their general knowledge and get working code. But in Perl that working code isn't going to be fast or clean. For instance, if you are writing Perl and you find yourself using many arrays and writing code for handling arrays, you are doing something wrong.

    48. Re:I don't.. by madsdyd · · Score: 1

      an HTTP replacement that's stateful rather than stateless,

      I stopped reading your post there. I take it you have never actually implemented anything non-trivial networkwise, with a stateful protocol, or you would not suggest replacing HTTP with something statefull. Its like asking for encryption directly in the IP - its just plain wrong for HTTP and its ilk. Go read up on it.

    49. Re:I don't.. by shaitand · · Score: 1

      Agreed. Except to some degree that a programmer can write excellent programs in any language. While technically true, part of that is knowing that you can't just take generic programming constructs, a reference for language x, and write everything like you write it in C/C++. Do that and you'll have ugly and slow Perl.

    50. Re:I don't.. by viperidaenz · · Score: 1

      I think you don't understand what a WebSocket is.

      It starts off as an HTTP request from the browser with an Upgrade: websocket header. If the server supports it, the existing HTTP TCP connection can then be used as a persistent bidirectional stream.

    51. Re:I don't.. by dkf · · Score: 1

      raw POSIX socket calls are horrendous from the perspective of the vast majority of application programmers

      And yet, WebSockets exist.

      I hadn't looked in depth at them before; the mix of HTTP, TCP and low-level bit-bashing is just... too depressing for Monday. I look forward to seeing someone implement websockets over BLOAT. After all, there's no problem that can't be fixed by another layer of abstraction!!!

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    52. Re:I don't.. by Archibald+Buttle · · Score: 3, Informative

      I think that the problem you have is that JavaScript doesn't match your experience and/or expectations of how a programming language should work.

      The scope rules of JavaScript are actually very straight forward. The problem is that most languages have block-based scope. JavaScript instead has function-based scope.

      As for proper "object/class" support, well, classes are just one way of doing objects, and not the only way. JavaScript has first-class support for objects. It's inheritance model however is prototype-based, rather than class-based. It's a different paradigm, but no less valid.

      Your experience and expectations of how a language should work (probably based on experience writing C++, Java, or any number of other languages) say that scope must be block-based, and object models must be class based. Those aren't the only solutions though.

    53. Re:I don't.. by mcvos · · Score: 1

      He was talking explicitly about storing javascript objects, not a mapping to simple fields. And javascript objects can contain code. I admit I don't know much about MongoDB and node.js, but it seems to me that if client and server share database objects, there's a risk that client-side objects can be used to get code executed on the server side.

      Maybe MongoDB or node.js come with special security measures to prevent that, but you do need that extra security. Java style security is not enough.

    54. Re:I don't.. by Half-pint+HAL · · Score: 1

      a new markup language that's meant to do pixel perfect rendering (HTML is not, but its used that way),

      NO!

      The point of HTML appears to be too subtle for most designers to grasp: you don't know what my screen looks like. I've got a widescreen laptop, a netbook and a smarphone. Their screens are different sizes and shapes. I don't have what you would call bad eyesight, but most websites are too small on my laptop unless I scale it up. Because the dots on my screen are smaller than the dots on the designers' 20" desktop monitors.

      The problem is bad design. A web app is destined for a non-homogenous environment and you will never know what I have or need (or someone with actually visual impairment has or needs) so you need to design with genericity in mind. That's why Java came with an abstract windowing toolkit... which was only a half-way house at best, but was still too subtle for most designers to cope with (what do they need, crayons?!?) and Java too has slid towards the "but it has to look exactly like it does on my screen" primary-school-of-design-thought.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    55. Re:I don't.. by Half-pint+HAL · · Score: 2

      the best way to build a site is with a css grid to make your site handle different resolutions

      Which is still pretty useless as it doesn't account for actual physical dimensions. A pixel is not an SI unit of size, and sites that look good on the fixed monitors I use are too small for comfortable reading on my 15" widescreen laptop. Until there's some tracking of dot pitch in the OS and browser, any attempt at designing-in sizes is doomed to failure.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    56. Re:I don't.. by K.+S.+Kyosuke · · Score: 1

      I work in a large company where we have a different GUI team that designs our screens. Increasingly over the past few years they have been building screens with more and more JavaScript requirements. Users seem to want to see everything dynamically loaded...page replaces are somehow evil and ugly...give me a fucking break already...if they had any idea how much more it costs them to build the screens they design they wouldn't be doing it. Pretty screens == almost impossible to maintain code. It's as simple as that and until something better comes along than JavaScript it's going to be a nightmare for most of us to deal with production issues. What's worse is when not even id's of elements on the page make sense so you wind up with id's that make the JavaScript code look even more confusing. I've built some of the most complex systems at my company that are heavy in JavaScript. We did a great job according to everyone around. But I know there are some things we can never correct because of the language we are dealing with.

      Well, perhaps you are doing things the wrong way. Frameworks such as Seaside have shown us that all this stuff can be neatly packaged into independent components and then composed on demand. This "if they had any idea how much more it costs them to build the screens they design they wouldn't be doing it" complaint of yours almost sounds to me like you're doing things manually that the machine could do automatically. Not to mention your element ID laments. Why would such low-level stuff should be a concern of yours?

      --
      Ezekiel 23:20
    57. Re:I don't.. by byrtolet · · Score: 1

      C lacks proper object/class support as well; is C a horrible language?

      Yes, but not because of that.

    58. Re:I don't.. by david.given · · Score: 2

      I don't know, maybe I'm just weird myself but I don't think Javascript's scope rules are that hard to grasp...

      Oh, they're not. They're just not what the syntax suggests they ought to be. Every other braces-and-blocks language on the planet uses block scope, so anyone who's been brought up on C, C++ or Java and sees code like this:

      if (b) { var i = 1; fnord(i); }

      ...will naturally assume that i is local to the block. It's not something that they think about, it's pure hindbrain reflex. I've been bitten by this loads of times. The only way I can write serviceable Javascript is to keep double-checking everything I've done to make sure I haven't done stuff like this.

      I think that Javascript is a perfectly serviceable if unexciting language --- modulo the gross insanities like the behaviour of this, inability to manipulate object prototypes, no way to hash objects, the whole business behind constructors, etc --- but it's really, badly let down by the syntax, which promises all sorts of stuff that it fails to deliver on. Block scopes, arrays (a[1] = 2 doesn't do what it looks like it does!), the fact that multiple variable declarations in the same scope aren't flagged... and semicolon insertion, shudder. It'd be so much better if it just looked different. Hence CoffeeScript, I suppose, but that's got a whole bunch of issues of its own.

    59. Re:I don't.. by marsu_k · · Score: 1

      inability to manipulate object prototypes

      Uhh, what? Care to elaborate? I'm not saying JS is perfect, far from it; strict mode helps a bit to get rid of some of the retardness. But once you wrap your head around scoping/hoisting (which is odd, granted, if coming from a language with a C-like syntax) it's not that bad, quite expressive at times even.

    60. Re:I don't.. by AuMatar · · Score: 1

      Yes we want pixel perfect rendering. Or rather, the web designers do. That's why HTML and CSS are the horrific combination they are today, and why web designers spend so much time tweaking things so they look exactly the same on all browsers. It's not what HTML and CSS were designed for, but it's how its used today. Time to move on and add a new language that uses it well.

      Viewing source in the browser has some benefits. One of the major problems it has is that the browser then has to include an interpreter, forcing the developer to use the languages the browser knows. Which basically forces them to use only javascript. Moving to byte code would allow the program to be written in any language, a HUGE gain.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    61. Re:I don't.. by david.given · · Score: 1

      You can't change the prototype of an object once it's been constructed (ignoring platform-specific extensions). I'm used to Lua, which has a much more orthogonal prototype mechanism, and have a whole stable of neat algorithms involving object prototypes... most of which require setting the prototype only after the object itself has been created.

    62. Re:I don't.. by Rufty · · Score: 1

      Real programmers can write Fortran in any language.

      --
      Red to red, black to black. Switch it on, but stand well back.
    63. Re:I don't.. by turp182 · · Score: 1

      Second that. I push Winform solutions for most in-house corporate solutions. Much richer control libraries, local storage for reference data, etc. TCP is quick as well (as I said, internal only solutions).

      Better performance, better functionality, what's not to like?

      Under no circumstance should a company's internal administration system be web based, unless it was purchased from an external vendor.

      Of course management wants everything to be a website...

      --
      BlameBillCosby.com
    64. Re:I don't.. by Hatta · · Score: 1

      "The Web" has always been http. The web metaphor comes from the network of hypertext links. It's just easier to say "the web" than it is to say "http network" or whatever. FTP, Gopher, email, and USENET all predated HTTP, and were never called "the web" until HTTP came around and people new to the internet thought everything was "the web".

      --
      Give me Classic Slashdot or give me death!
    65. Re:I don't.. by Malc · · Score: 2

      I would guess that some people find closures confusing or hard. They're pretty cool, but you do have to be careful with scope.

    66. Re:I don't.. by TheLink · · Score: 1

      You're right, my apologies. I was ignorant of what a websocket is.

      --
    67. Re:I don't.. by Luyseyal · · Score: 1

      Here's your official counterexample: Brainfuck.

      It's the exception that proves the rule, right? :)

      Cheers,
      -l

      --
      Help cure AIDS, cancer, and more. Donate your unused computer time to worldcommunitygrid.org. Join Team Slashdot!
    68. Re:I don't.. by marcosdumay · · Score: 1

      You can't change the prototype of an object once it's been constructed

      I never completely grasped that detail, but you can change the prototype of some objects after they are constructed. That's exactly what is done in "var i = {}; i.item1 = 'a';". I just don't know when you can do that, and when you can't.

      And yes, that bothers me a lot too. I'm used to lots of languages, with static and dynamic classes. No category bothers me, but that "you have to change it, except when you can't" rule of Javascript do.

    69. Re:I don't.. by marcosdumay · · Score: 1

      Closure is not to blame for the insane scoping rules of Javascript.

      (Yep, comparing it to Perl is quite apt.)

    70. Re:I don't.. by kmoser · · Score: 1

      function f() {
      x = 'WTF?';
      }

      f();

      alert( x );

    71. Re:I don't.. by MrSteveSD · · Score: 1

      The weird scope rules and lack of proper object/class support drive me up the wall when working on projects with ~40,000 lines of code.

      HAXE has has classes, static typing and all the things you probably want. Then you can just transpile it into javascript (among other languages). There are other efforts along similar lines. Increasingly it seems, due to it's unsuitability for large projects, Javascript is being treated as a sort of assembly language you compile to as a last step.

    72. Re:I don't.. by thetoadwarrior · · Score: 1

      You are right. Node has that and node is definitely handy in some cases but client javascript, imo, is still the biggest part of the JS community and as a developer I would like to see a quality repository that allows me to search for JS libraries that may or or may not be part of a framework and it would be great if they could be rated and reviewed.

    73. Re:I don't.. by Schmorgluck · · Score: 2

      Yeah, I have a background in C and C++, and I taught myself Perl with the Llama Book. While the book is pretty good at pointing the differences between Perl and C, it took me some practice to get rid of some basic C reflexes.

      Case in point, the ternary "C style" for syntax. You can guess a beginner (or a codemonkey) in Perl to the number of occurrences of it. Experienced Perl programmer only use it when there's no other convenient (and more legible) solution - i.e. almost never.

      --
      There's nothing like $HOME
    74. Re:I don't.. by IICV · · Score: 1

      That's true, it's a bit weird that Javascript will implicitly put stuff in the global scope if you don't declare it with "var"; it's a legacy behavior, and I'm pretty sure the future "use strict" semantics will throw a warning when you create a variable like that.

    75. Re:I don't.. by defcon-11 · · Score: 1

      I've used JS for many large projects. JS is vastly different from Perl in the fact that it has well defined behavior (unlike Perl 6, Javascript is based on an actual spec that you can go read) and JS is a compile target of more expressive languages. I would say the future is probably going to be transpiling to JS. A big problem with JS is no built in namespaces/modularity, but that is somewhat easily fixed with libraries like require.js. I think the lack of a decent standard library is a greater problem, because every framework out there duplicates the same stuff. Common.js is trying to solve this, but hasn't been terribly successful so far. I think people who complain about asynchronous operations and prototype based inheritance are just stuck in their ways, because these methods offer a lot of advantages over more traditional class based oop languages.

    76. Re:I don't.. by shaitand · · Score: 1

      hashes are not arrays. Unless you consider the alternative term 'associative array' to be more meaningful than the internal data representation.

    77. Re:I don't.. by techhead79 · · Score: 1

      it can be awesome.

      Are you kidding me? Just because you can do something with a language doesn't mean you should.

    78. Re:I don't.. by keith_nt4 · · Score: 1

      VBScript still works, even in HTML5-based applications. Just sayin.

      --
      "UNIX is very simple, it just needs a genius to understand its simplicity." -Dennis Ritchie
    79. Re:I don't.. by techhead79 · · Score: 1
      Yes, we are doing things the wrong way. Mainly because we're such a huge company and to even agree that we need more frameworks than the home grown JS or JQuery requires several extensive meetings, evaluations, considerations...and blah blah blah. By the time you're ready to start developing you'll either be burning money trying to decide what framework makes your code look the cutest or you'll be doing everything you can to meet your deadlines. What do you think the priority will be? And what does it say about a company when project XYZ used frameworks 1 and 2 while project ABC used frameworks 3 and 4? In large companies you don't make a lot of the decisions in what you write or what you write with. And you certainly don't get to just up and download anything you think will help you.

      On the element ID thing. Of course it is low level but what makes more sense to you?
      $('customerName').show();
      or
      $('textfield123').show();
      Do I really need to explain that? I would think it would be rather obvious.

      complaint of yours almost sounds to me like you're doing things manually that the machine could do automatically.

      Right I forgot about that built in JavaScript command that gets all of a client's past transactions without needing to worry about any data structures or ajax request and then displays it on the screen allowing the user to sort by multiple columns, edit specific fields, resubmit that data back to the server, popup a jquery modal with dynamically asigned data....seriously dood are you kidding me?

    80. Re:I don't.. by gstoddart · · Score: 1

      That's the problem with trying to use a thin client where the the user really needs a fat client. But today, everbody thinks that everything has to be in the browser

      I couldn't agree more -- back in '96 or so, a co-worker said that the web had put back human interface design by about a decade.

      Well over a decade later, everybody wants to run everything as a web app, and very often the usability of the software really suffers from it.

      I've lost track of the number of crappy web based tools I've been stuck working with.

      For a lot of things, the fat client is really the only way to go.

      --
      Lost at C:>. Found at C.
    81. Re:I don't.. by dodobh · · Score: 1

      The web is HTTP only, by definition.

      --
      I can throw myself at the ground, and miss.
    82. Re:I don't.. by trev.norris · · Score: 1

      Are you kidding me? Just because you can do something with a language doesn't mean you should.

      That's a ridiculously obscure statement. By "do something" do you mean "do anything" when it comes to JavaScript?

  2. What. The. Fuck? by Anonymous Coward · · Score: 3, Insightful

    What is this? Slasdot's daily troll story?

    capcha: manure. How appropriate.

  3. Re:What. The. Fuck? by oodaloop · · Score: 4, Funny

    Yeah, like there's only one troll story a day. You must not check very often.

    --
    Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
  4. Readability by Anonymous Coward · · Score: 3, Insightful

    One thing BASIC did right was make it easy to read, this despite being procedurally oriented and allowing for spaghetti code using multiple GOTO statements instead of using subprocedures using GOSUB/RETURN.

    Newer languages look more like obfuscated math in an OO context. Perl, JavaScript, Ruby, even Python have an element of unreadability to them--if not well commented, then I'll often need to consult an online reference or reference book to understand exactly what is going on. C++ using templates becomes just as unreadable.

    It's ridiculous, if you think about it. I don't have to consult a dictionary every few words I read or write of a sentence, so why should I have to consult a language reference for every few lines of code I am reading or writing?

    As programmers, we are telling the computer what to do. Why can't the language resemble more readable (English, or native language) rather than obfuscated math.

    And forget functional programming, that is the most obfuscated coding I have ever seen, I can't even read it except in the most trivial of cases.

    1. Re:Readability by Anonymous Coward · · Score: 5, Insightful

      One thing BASIC did right was make it easy to read, this despite being procedurally oriented and allowing for spaghetti code using multiple GOTO statements instead of using subprocedures using GOSUB/RETURN.

      LITTLE-KNOWN FUN FACT: If you write Perl correctly, it's also perfectly readable, despite all its odd quirks and allowing for spaghetti code using obscure modules and abuse of the single-character special variables.

      I know! It's hard to believe that such an amusing stereotype spread so much by programming trendwhores who don't know what they're talking about could possibly be wrong! What an impossibly weird world we live in!

    2. Re:Readability by Nerdfest · · Score: 1

      Have you ever noticed how many people write English well? On top of that, there's writing well, and writing concisely. Where one person may get an idea across clearly in two sentences, it may take another five or six. Any language will have the same problems to varying degrees; the trick is to coax people towards being concise.

    3. Re:Readability by Hentes · · Score: 5, Insightful

      For many of us, math is easier to read than human language. Language is inherently inaccurate, and terrible at describing complex algorithms. The problem with syntax isn't that it doesn't look like human language, otherwise everybody would be using Smalltalk. But when a piece of code can be written in too many ways (and there isn't a simple "obvious" way to guide programmers), it becomes hard to understand code written by someone who thinks differently. One solutions to this is to limit the language to a single style like Java does, which forces all programmers to write similar code, making it easy to understand what others have written. Now of course there are people who can write ugly code in any language, and there's no way to eliminate that, but most coders are lazy, and if a language makes it easy to write nice code and hard to write ugly code, they will choose the former. The tradeoff is that these languages are more rigid and less costumizable.

    4. Re:Readability by Alomex · · Score: 1

      Newer languages look more like obfuscated math in an OO context. Perl, JavaScript, Ruby, even Python have an element of unreadability to them--if not well commented, then I'll often need to consult an online reference or reference book to understand exactly what is going on.

      I noticed this the first time I opened the source code of a simple Python application. It was very hard to decode what was going on, even though I'm proficient in Basic, C, C++, Pascal, Algol, Perl, Lisp, ML, awk, csh, matlab, prolog, logo, Ada, Cobol, TeX/LaTeX, postscript, scheme. You'd figure that those should be enough to interpolate the meaning of any program in a reasonable language.

    5. Re:Readability by Animats · · Score: 3, Interesting

      Why can't the language resemble more readable (English, or native language) rather than obfuscated math.

      Because page after page of MULTIPLY A BY B GIVING C ON SIZE ERROR STOP RUN really sucked. put background field "name" of card n of background "data" after card field "list" wasn't much better.

      The problem with Javascript is not that you can't write good Javascript programs. Javascript has an adequate feature set, the syntax is no worse than C, and reasonably fast implementations are available. It's that the language encourages the writing of bad code, which then has to be debugged by others. Object-oriented programming was retrofitted into Javascript, and it shows. Typical bad Javascript has global variables that should be local, shared data that should be in closures, no proper objects, and no comments.

    6. Re:Readability by AuMatar · · Score: 1

      But conciseness isn't always the right goal. Take legalese- it's very concise. That's why its used. It isn't readable. Or take perl- people can do an awful lot in 1 line, but nobody can understand it without really studying it. Doing it in 5 or 6 lines instead can be much more readable, and thus maintainable.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    7. Re:Readability by Penguinisto · · Score: 1

      Hellfire; if you write .NET or even PowerShell correctly it's perfectly readable. If you comment it correctly it can be perfectly maintainable, too (well, for as long as all the parts are non-obsolete, anyway).

      But noOOoo.... everyone's gotta be the cleverest mofo in the effing room, forgetting all about the poor slob who has to maintain the damned thing 2 years later...

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    8. Re:Readability by Nerdfest · · Score: 1

      Legalese is very far from concise. That's part of the problem with it. If it was more concise and was frequently refactored, the law would be much shorter and easier for the average person to understand.

    9. Re:Readability by lattyware · · Score: 2

      Really? Python reads so much like English that it's really clear. It may be because you are an existing programmer - I have found those that come into Python from other languages tend to fight the language a lot, and are so used to conventions from other languages, they have problems with Python as it doesn't follow them.

      --
      -- Lattyware (www.lattyware.co.uk)
    10. Re:Readability by AuMatar · · Score: 1

      No, it is *VERY* concise. Specific words have an extremely specific meaning, and new concepts are defined in detail. That's why it reads the way it does. Writing it in plain english would take 5 or 6 times the amount of space to mean the same thing.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    11. Re:Readability by Nerdfest · · Score: 1

      I find it's way too open to interpretation to be described as concise. Precedent based law would not be required if it were actually concise.

    12. Re:Readability by M.+Baranczak · · Score: 5, Insightful

      Why can't the language resemble more readable (English, or native language) rather than obfuscated math.

      Because natural languages and programming languages are intended for completely different tasks. Do I really need to explain this?

    13. Re:Readability by skids · · Score: 1

      Natural languages have context. A few languages have tried to spin this in. Larry Wall being a bonafide linguist, Perl6 seems to be trying to do so further (though on the other hand it is elimiating "want"-like constructs). Problem is some people really hate context because you actually have to know the language to read the language when there is context -- it is no longer a lowest common denominator where a few educated guesses gets you from knowing PHP to being able to mostly read Perl/Python/Ruby.

      This sets up a real dichotomy -- language creators can intentionally refuse to add anything new or innovative in order to satisfy the people who only want to learn "pidgin", or they can innovate to a smaller audience.

    14. Re:Readability by RabidReindeer · · Score: 1

      No, it is *VERY* concise. Specific words have an extremely specific meaning, and new concepts are defined in detail. That's why it reads the way it does. Writing it in plain english would take 5 or 6 times the amount of space to mean the same thing.

      I've always maintained that the reason why Legal-sized paper is longer than "standard" (letter) paper is that the extra verbiage required extra space in order to fit on a single page. The legal advantage to putting stuff on a single page is that you can't surreptitiously swap out a page in a document if there's only one page to begin with.

      OK, so it's one page, front-and-back, 4-point type, in gray ink on yellow paper, but still...

    15. Re:Readability by viperidaenz · · Score: 1

      You shouldn't use a comma before the word "and".

    16. Re:Readability by Nerdfest · · Score: 1

      In many cases you should, but you're correct; not in this case.

    17. Re:Readability by Anonymous Coward · · Score: 1

      That's quite hard to do without Unicode.

    18. Re:Readability by Anonymous Coward · · Score: 1

      Really? Here's a piece of Python from a forum I frequent, with the absolute atrocity in bold. I should note I'm someone who has done extensive programming across multitudes of languages (65xxx and x86 assembly, BASIC, Perl, Lua, and other things):

      import io
      even = io.open( "even.bin", "rb" ).read()
      odd = io.open( "odd.bin", "rb" ).read()
      interleaved = "".join( i for j in zip( even, odd ) for i in j )
      io.open( "interleaved.bin", "wb" ).write( interleaved )

      I've shown this to people who actually do Python regularly (I do not). I had the pleasure of watching them stare in horror at the line in question. I myself had to ask someone else to explain what it actually equated to:

      for j in zip(even, odd):
                for i in j:
                        i

      Where the results get built up and returned (as an array) to the original join() call. Once it was written out, it made more sense.

      As much as I abhor Python, I want to be clear about my intentions: every programming language has some awful syntactical obfuscation that can occur, whether it be intentional (Perl assholes do this all the time, thinking they're being clever by flexing their proverbial ballsacks -- I completely agree this trait is very common with Perl zealots and it's depressing) or unintentional (a programmer who probably has no familiarity with what goes on under the hood or how the actual language works internally).

      If people would stop writing code that is intentionally illegible, we'd be better off. This is an especially important view/attitude to embrace if you're working on code which another human being, regardless of skill set, will see (i.e. it doesn't matter if you're writing code at work or if you're participating in an open-source project). And to be honest, this has helped *me* many times as well, where I've had to re-visit code I'd written 2-3 years in the past. "What on earth is this? {reads comment} Ahhh, makes sense".

      For example, before I left my previous job of 8 years, I had quite literally 5 or 6 Emails from employees telling me that my Perl was some of the easiest to follow and "just made sense" -- mainly because anything "hairy" was preceded by comments written in plain English (vs. mathematician style or the stereotypic "I'm fresh out of college and using CS buzzwords" style); anything obfuscated or bizarre had justifications, and in some cases those related to resource usage. I'm not saying I'm perfect or bragging per se, I'm just saying that when you write code with the above mentality in mind, other people do appreciate it.

      Ironic captcha: benign

    19. Re:Readability by lingon · · Score: 1

      It's ridiculous, if you think about it. I don't have to consult a dictionary every few words I read or write of a sentence, so why should I have to consult a language reference for every few lines of code I am reading or writing?

      As programmers, we are telling the computer what to do. Why can't the language resemble more readable (English, or native language) rather than obfuscated math.

      Because you need more information in your programming statements than English provides. The languages we use to communicate with other humans contain a lot of information in the context of the language, and we still often misunderstand oneanother. Computers need precise and unambiguous instructions, i.e. not language but math.

      What you propose is of course doable as it's just a technical problem. However, if we did it, computers would suddenly have to use ambiguous language context to interpret their instructions and you would have bugs that depended on the context of the situation. Good luck finding those. Imagine the consequences when your car misunderstands its programming when you're on the highway ...

      And forget functional programming, that is the most obfuscated coding I have ever seen, I can't even read it except in the most trivial of cases.

      Functional programming is an entirely different paradigm. You can't compare readability with imperative programming.

    20. Re:Readability by Waccoon · · Score: 1

      "We found a clever way to get around a language's limitation" is not the same thing as "It's actually a good language if you do it correctly."

      The first time I used Perl, I had a hard time understanding why I had to use a subroutine and shift an array from the default variable, rather than use a function with parameters like every other damn language.

      Now, I'm using JavaScript, and I'm wondering why it has a Perl-compatible regex engine but no formatted printing. Truly, a wonderful language to replace both Perl and C++, once you learn how to write it correctly and make code that's perfectly readable.

      Why don't we just openly admit that JavaScript is shit, but we use it anyway because every web browser has it? Is that so hard?

    21. Re:Readability by marsu_k · · Score: 1

      You shouldn't modify the built-in objects if you're building a framework or something to be used by other people; however, in my opinion modifying some of the objects is fine for internal use (not modifying the Object prototype though, that's plain evil). So to get a C#-like string formatting (nothing fancy, just replacing {0} with the first argument, {1} with the next and so on), try:

      String.prototype.format = function() {
      var formatted = this.toString();
      for (var i = 0; i < arguments.length; i++) {
      formatted = formatted.replace(new RegExp('\\{' + i + '\\}', 'g'), arguments[i]);
      }
      return formatted;
      }

      And then '{0} {1}'.format('Hello', 'world') returns... well, I'm sure you'll be able to figure it out.

    22. Re:Readability by trev.norris · · Score: 1

      Object-oriented programming was retrofitted into Javascript, and it shows. Typical bad Javascript has global variables that should be local, shared data that should be in closures, no proper objects, and no comments.

      Thank you. Every time a developer wants to turn a js project OO I want to gouge their eyes out. Once I created a cross-dependency map of all the different "classes" that were in a library I had to debug. There were a least half a dozen complex circular dependency chains. If people think JavaScript lends itself to ugly code, they haven't seen developers who try to turn it into Java.

    23. Re:Readability by maxwell+demon · · Score: 1

      Precedent-based law is not required. Most of Europe works fine without it.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    24. Re:Readability by lattyware · · Score: 3, Informative

      Of course it is possible to write unclear code in Python - preventing that would be impossible while retaining a useful language.

      The whole program sits wrongly with me - for one, the user is using io.open() instead of the open builtin - there is no good reason to do that. Next they are opening files and relying on the garbage collector to close them (not using the with statement as would be sensible), then they use string operations on data they have told us is binary data, use a nested loop in a generator expression, which yes, is ugly, instead of using itertools.chain() to flatten the iterable.

      So how would I write the same program?

      import itertools

      with open("even.bin", "rb") as even, open("odd.bin", "rb") as odd, open("interleaved.bin", "wb") as interleaved:
      for item in itertools.chain(zip(even, odd)):
      interleaved.write(data)

      itertools.chain() is the more efficient and readable way of flattening a 2-layer iterable, instead of the 'horror' you point out. This version also writes bit by bit, rather than joining in-memory, meaning that it doesn't load the entire thing into memory, meaning it will work with extremely large input files (larger than system memory). The use of the with statement means that the files will be closed even if an exception occurs. Plus, the whole thing is more readable.

      Python is much more conducive to writing legible code - note neither example involves lots of indices on a list, for example. It's not a miracle worker, but given people who have taken a bit of time to learn the language, it makes writing very readable code very easy. That's a great thing - it's not an instant fix, but trust me when I say I know Java just as well and yet I could never write more readable Java than I could Python for any given task.

      --
      -- Lattyware (www.lattyware.co.uk)
    25. Re:Readability by lattyware · · Score: 1

      Ugh, and slashdot ate my formatting, naturally, with indentation there as appropriate.

      --
      -- Lattyware (www.lattyware.co.uk)
    26. Re:Readability by Half-pint+HAL · · Score: 1

      Why can't the language resemble more readable (English, or native language) rather than obfuscated math

      Maybe in part because

      (person) | nativelanguage_person != English.

      Also, if you think that current programming languages offer too many ways of doing the same thing...

      Set A to be the sum of B and C. Take the sum of B and C and store the result in A. Add C to B and call the result A. Make A as long as long as the two items B and C placed end-to-end. etc etc ad nauseum.

      So you're going to have to restrict the set of linguistic constructs to be logically equivalent to the set of mathematical constructs in a current language of comparable functionality. From the point of view of the coder, this means that the language is going to become more pedantic, because you're writing a longer string of abitrary symbols, with much more redundancy and far more scope for error.

      I'm of the opposite view to you: I believe that the problem is that programming isn't enough like mathematics, and further, that a great many code bugs and design flaws are due to programmers being insufficiently versed in formal maths methods to produce logically consistent code.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    27. Re:Readability by K.+S.+Kyosuke · · Score: 1

      Object-oriented programming was retrofitted into Javascript, and it shows.

      For a language derived from Self (the ultimate object language), that would be quite an achievement. What are "proper objects", by the way?

      --
      Ezekiel 23:20
    28. Re:Readability by lattyware · · Score: 1

      Sorry, yeah, it was meant to be item - that's what I get for tapping out code quickly without running it.

      As to itertools, yeah, it's a bit of standard library functionality that often gets overlooked, but is massively useful, it just does a ton of common iterations tasks quickly and efficiently. As to being lazy, it's a really great thing, and in Python (especially since 3.x), lazy iterators are core to the language and, provided you don't intentionally push stuff into lists, it requires no extra thought on the part of the programmer. The I/O cost is actually very low as Python buffers file I/O by default anyway.

      with sounds a bit odd when you are not used to it, but it's massively useful when it comes down to it - it allows you to pre-write common code blocks and execute them in a finally block, without a ton of boilerplate. Otherwise, to ensure correct behaviour, every file you open has to be wrapped in a try: finally: with file.close() at the end. As we know we want this behaviour every time, we just put it in a with block and have it run when we leave the scope of that block.

      Object orientation is great where you want to think about parts of a system separately - which we almost always want to - that said, Python draws heavily from procedural and functional languages too - hence no need for a class with a main method like Java, and all the lazy stuff and list comprehensions from functional languages. Just as with all things, it can be used in the wrong context, but in the right context, OOP is a great idea.

      As to how I know, the with statement just runs the context manager you give it. I know that a file's context manager closes the file - that's in the documentation, no different to knowing that for x in file: will loop over the lines of a text file. There are other useful context managers (and ones I have written myself) to do other stuff. File closing is (by far) the most common usage however.

      As to the general distain towards memory-managed languages... they are the future. It's just so much better - so much quicker to develop in, and it makes the final code so much easier to read and so much more maintainable. Memory management is boilerplate code, it's the same stuff I want to do every time, and having the language deal with that is great.

      --
      -- Lattyware (www.lattyware.co.uk)
    29. Re:Readability by Rufty · · Score: 1

      HA! The very first basic I used was Acorn Atom Basic. Tell me that's readable.

      --
      Red to red, black to black. Switch it on, but stand well back.
    30. Re:Readability by lattyware · · Score: 1

      A lot of people don't get the benefit of it reading like English - it's not in the learning, learning a language that reads a bit like English doesn't really help, as it still doesn't write like English, the benefit is that it produces much more readable, maintainable code in the long run. If I take a ton of Python I can very quickly start updating it or modifying it (or simply checking it). It's easier to understand what is going on quickly and spot bugs. (This all, in turn, also makes it faster to write). This is of huge benefit to everyone. Yes, some programmers will need to get out of habits from other languages, but if you are a competent programmer, that's not really a huge task.

      --
      -- Lattyware (www.lattyware.co.uk)
    31. Re:Readability by lattyware · · Score: 1

      You say broken, I say fixed.

      --
      -- Lattyware (www.lattyware.co.uk)
    32. Re:Readability by lattyware · · Score: 1

      I'm a 3.x user, where zip() functions lazily. As you are correct to point out, in 2.x, you will want to use itertools.izip() to get that functionality.

      --
      -- Lattyware (www.lattyware.co.uk)
  5. A bit late for this. by Animats · · Score: 5, Funny

    It's 2013, and someone is discovering Javascript?

    1. Re:A bit late for this. by alteveer · · Score: 1

      So I guess Gmail, Facebook, and Twitter aren't large scale enterprise deployments?

    2. Re:A bit late for this. by OhANameWhatName · · Score: 1

      It's 2013, and someone is discovering Javascript?

      Let's face facts and blame Perl, it's always worked in the past

    3. Re:A bit late for this. by rwyoder · · Score: 1

      It's 2013, and someone is discovering Javascript?

      Just wait until tomorrow when they discover Livescript.

    4. Re:A bit late for this. by terjeber · · Score: 1

      Look at it from a different point of view. Enterprise applications, the ones that are typically developed in-house, that serve very specific needs of an enterprise are not like Google, Gmail, Facebook etc. In fact they are on opposite sides of the spectrum.

      The typical enterprise developer is a member of a small-ish team of developers who work day in and day out with vague specs, customers banging on his door, and a huge multitude of applications to maintain. Each enterprise developer frequently maintains 5 to 10, or even more, different apps day to day. Basically the average enterprise team is relatively small (comparatively) with a large number of apps, mostly of the type that are extensions of other apps. Integrating the CRM system with the existing billing system, merging the POS system, that is not AD enabled, with AD etc. In short, they are few developers with many, many applications.

      That is the complete opposite of the Googles and Facebooks of the world. Here you typically have vast numbers of developers working on comparatively few projects. The requirements on the two sides are also direct opposite.

      Javascript is the exact opposite of "the appropriate tool for the job" for the enterprise. If someone tells you he'll do your enterprise app in PHP and/or Javascript. Fire him and hire a CICS/COBOL engineer. The latter knows what he is doing. The PHP/Javascript dude is clueless, but he would fit in quite well at Facebook.

    5. Re:A bit late for this. by mcvos · · Score: 1

      I haven't read TFA, but I suspect they're talking about node.js. It makes sense if that's what they're talking about.

    6. Re:A bit late for this. by tibman · · Score: 1

      I suppose that depends on your definition of enterprise app? If it is something you want people to access via a browser then i'd say you should take php & js over cobol.

      --
      http://soylentnews.org/~tibman
    7. Re:A bit late for this. by viperidaenz · · Score: 1

      Your enterprise developers have doors? I've been stuck in low-wall cube farms.

      The only rooms with doors in this whole building are toilets, kitchens and meeting rooms.

    8. Re:A bit late for this. by terjeber · · Score: 1

      Maybe, but I'd take almost any other tool over PHP and JS. PHP and JS are anti-patterns by their very nature. I'd take Java, Delphi, Visual Basic (.NET) and just about any other thing over PHP. JS (minimum amount) would be unavoidable.

    9. Re:A bit late for this. by tibman · · Score: 1

      Sounds like you are personally biased against PHP more than anything else. But putting javascript in the anti-pattern group is pretty rough. I do fall into the minimal camp though. Use it lightly! To each their own : )

      --
      http://soylentnews.org/~tibman
    10. Re:A bit late for this. by terjeber · · Score: 1

      Sounds like you are personally biased against PHP more than anything else

      I am personally biased against all anti-patterns.

  6. Very Different by hibiki_r · · Score: 5, Insightful

    Perl was exciting because it provided a lot of power without having to be as low level as C. It's still a useful, albeit not all that pretty language. Javascript is used a bunch of one reason only: It's the only thing you can sensibly run in a web browser without an iffy user experience. Large chunks of the language are horrible, and while it has enough decent bits to do real work on, you won't find that many people that wouldn't wish for the languages said bits were taken from. I mean, if people actually liked the language, would we find things like Coffeescript and objective-J out there?

    1. Re:Very Different by hobarrera · · Score: 1

      It's the only thing you can run in a web browser.

      FTFY.

    2. Re:Very Different by dbialac · · Score: 1

      I've frankly seen some very pretty and very elegant perl code. I've also seen complete crap implemented in other languages, and perl doesn't force you into boxes with a battering ram like a lot of other languages (Python comes to mind). Perl can be old-school function oriented programming, modern OOP or functional. Additionally, you don't spend hours on end trying to figure out how to fix typing issues -- something you will spend far more time doing than allowing bad types to fail in development. Javascript's primary problems come from never properly implementing objects and inheritance, something that would have been fixed had Microsoft not killed the proposal to use Flex/Actionscript as the HTML5 specification.

    3. Re:Very Different by k0ldsh4d0wz · · Score: 2

      don't forget typescript http://www.typescriptlang.org/

    4. Re:Very Different by Pollardito · · Score: 1

      you won't find that many people that wouldn't wish for the languages said bits were taken from. I mean, if people actually liked the language, would we find things like Coffeescript and objective-J out there?

      The existence of alternatives like Coffeescript and Objective-J doesn't mean everybody (or even a sizable majority) hates JavaScript. It just means that at least one person hates it or even that someone decided to reinvent the wheel. That's why we have a million languages that are essentially acting as CGI replacements on the server-side: Perl, Java, ASP, Ruby, PHP, C, ...

      No language is perfect for everybody or for every job. I'm not sure JavaScript is even especially objectionable, but you're right in saying that as long as it's the only language that all browsers support you're basically stuck with it (or at least stuck compiling down to it)

    5. Re:Very Different by BenoitRen · · Score: 1

      I mean, if people actually liked the language, would we find things like Coffeescript and objective-J out there?

      Sure. There are always going to be detractors.

  7. Lacking enterprise adoption? by NoKaOi · · Score: 5, Insightful

    pervasive, but lacking enterprise adoption on large applications

    Seriously? How many enterprise level web based sites/applications are there that don't use JavaScript vs. do use JavaScript? I know, you're going to argue that the whole thing isn't entirely based on JavaScript, but seriously, wouldn't you say enterprise adoption is pretty darn high?

    1. Re:Lacking enterprise adoption? by rduke15 · · Score: 1

      Anyway, what does he mean by "enterprise adoption"? Neither Javascript nor Perl were conceived "for the enterprise".

      They were both conceived to make it easy to do simple things. One in web pages on the client, the other in anything with a CLI, even your toaster (if you have a decent toaster, which would have a CLI).

      (Perl added to the "make simple things easy" the "and difficult things possible".)

      I'm not sure what "for the enterprise" really means, but I'm pretty sure that if that is how I perceive a language, I just run away... (that may be why I never was interested in Java; it seems so boring, so "enterprisy". That may be unfair, but the perception that it is for IBM/Oracle/SomeBank employees in suits is hard to overcome)

      And anyway, the comparison is weird because there is practically no overlap in functionality between Perl and Javascript. Nobody has ever wondered whether he should solve a problem with one or the other? They live on different continents.

    2. Re:Lacking enterprise adoption? by Hentes · · Score: 1

      You might want to read that sentence again. The part you quote is about Perl, not Javascript.

    3. Re:Lacking enterprise adoption? by Tablizer · · Score: 1

      It's because you don't have a choice unless the user downloads something. Active X? A dead standard. Java applet? Versioning head-aches. Flash? Takes one out of "web world".

    4. Re:Lacking enterprise adoption? by LDAPMAN · · Score: 1

      Strange...most of the fortune 500 are running Java apps that I was involved in either writing or deploying. Those apps are critical to their business and the paid me well. I guess I should give back the money....

    5. Re:Lacking enterprise adoption? by tibman · · Score: 1

      Did you mean Javascript is not important in enterprise or Java?

      --
      http://soylentnews.org/~tibman
    6. Re:Lacking enterprise adoption? by viperidaenz · · Score: 1

      Java is the back end language of choice in the government departing I'm working at.
      Same goes for the bank I was at last year.
      And the telecommunications company I worked for a few years before that.

      The small sized company I worked at many many years ago was VB6, PHP and a bit of Excel.

    7. Re:Lacking enterprise adoption? by terjeber · · Score: 1

      Yeah, don't know why I didn't include Java, it's the language I work with the most, and I am one of the described Enterprise developers.

    8. Re:Lacking enterprise adoption? by terjeber · · Score: 1

      ... script. Java is very important-

    9. Re:Lacking enterprise adoption? by terjeber · · Score: 1

      I meant JavaScript. Java is very important in the enterprise.

    10. Re:Lacking enterprise adoption? by terjeber · · Score: 1

      Not his fault since I wrote (in one place) Java where I meant Javascript

  8. The web is just too successful by Kjella · · Score: 5, Insightful

    HTML/CSS is a fair text markup language, it's a horrible tool to design user interfaces
    JavaScript is a fair way to make small DOM scripts, it's a horrible programming language.

    But with a big enough hammer called the World Wide Web, you can make a square peg fit a round hole.

    --
    Live today, because you never know what tomorrow brings
    1. Re:The web is just too successful by Piata · · Score: 2

      As a web designer, I'm not sure I understand your gripe about HTML/CSS being a horrible tool to design user interfaces. Typically I design my interface in Photoshop and then create it using HTML/CSS, which is suprisingly good at this sort of thing and only getting better. I've designed things on multiple platforms in the past and I prefer the HTML/CSS method.

    2. Re:The web is just too successful by marsu_k · · Score: 1

      I find CSS to be quite lacking. Lack of variables for one is very irritating. Thank $DEITY for Compass.

    3. Re:The web is just too successful by maxwell+demon · · Score: 1

      Variables in CSS? Really?
      Constants I can understand. But variables? It's not as if CSS was code to be executed (not should it be).

      --
      The Tao of math: The numbers you can count are not the real numbers.
    4. Re:The web is just too successful by marsu_k · · Score: 2

      More like constants, I wasn't being clear enough. With Compass I can do something like (as a contrived example):

      $base-color: #aaa;
      $border-color: darken($base-color, 20%);
      $header-color: lighten($base-color: 20%);

      Now by adjusting $base-color border and header colors are changed as well. And this is a very trivial example - if you write CSS even semi-professionally I suggest you look into it. The documentation (as always) is not the best available, but IMHO the framework is very much worth learning/using.

    5. Re:The web is just too successful by Half-pint+HAL · · Score: 1

      HTML/CSS is a fair text markup language, it's a horrible tool to design user interfaces

      Don't underestimate what can be achieved with elements in a well-structured .

      Anything else is just aesthetics, which should be a secondary concern.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    6. Re:The web is just too successful by Half-pint+HAL · · Score: 1

      HTML/CSS is a fair text markup language, it's a horrible tool to design user interfaces

      Don't underestimate what can be achieved with elements in a well-structured .

      Anything else is just aesthetics, which should be a secondary concern.

      Should have checked the preview...

      <form> elements in a well-structured <table>....

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    7. Re:The web is just too successful by marsu_k · · Score: 1

      I know, typo on the Internet, hilarious. (comma is the correct syntax)

    8. Re:The web is just too successful by theArtificial · · Score: 1

      I, too, am a web developer and my workflow is similar to yours with respect to Photoshop. I really like the power HTML/CSS provides (especially with CSS3 transitions) when creating GUIs. Designing them in the traditional ways seems somewhat backwards when I switch gears to native development. While I know you're a web guy, check out QML if you're interesting in making some native applications. I wouldn't recommend it for enterprise level projects, but for "app" grade projects it's interesting.

      --
      Man blir trött av att gå och göra ingenting.
  9. Atwood's Law by blutfink · · Score: 2

    Atwood's Law: "Any application that can be written in JavaScript, will eventually be written in JavaScript."

  10. Modem noise by frisket · · Score: 3, Informative
    Yah. And Perl still looks like modem noise. Python is even worse. But JavaScript is like someone on acid tried to breed a zombie computer language in his basement.

    But, hey, lots of people like them, so they must be good, right? https://www.destroyallsoftware.com/talks/wat

    1. Re:Modem noise by hobarrera · · Score: 4, Informative

      I've heard many respectable criticisms of Python, but I've never heard anyone say it looks bad.
      Visually, it's probably the most elegant-looking language there is.

    2. Re:Modem noise by Concerned+Onlooker · · Score: 1

      Until you need the power of regular expressions. Then Perl starts looking pretty clean again.

      Also, it's easy to write bad looking Python. Just use the same naming convention for variables, methods and objects. That is the first thing I encountered coming on to maintain my first Python script.

      --
      http://www.rootstrikers.org/
    3. Re:Modem noise by fahrbot-bot · · Score: 1

      Yah. And Perl still looks like modem noise.

      Try programming in TECO:

      It has been observed that a TECO command sequence more closely resembles transmission line noise than readable text. One of the more entertaining games to play with TECO is to type your name in as a command line and try to guess what it does. Just about any possible typing error while talking with TECO will probably destroy your program, or even worse - introduce subtle and mysterious bugs in a once working subroutine.

      --
      It must have been something you assimilated. . . .
    4. Re:Modem noise by Anonymous Coward · · Score: 1

      Also, it's easy to write bad looking Python. Just use the same naming convention for variables, methods and objects. That is the first thing I encountered coming on to maintain my first Python script.

      You can say that about any computer language out there.

    5. Re:Modem noise by somenickname · · Score: 1

      One of the problems I frequently notice with Python is that since whitespace has syntactic meaning, it seems like many Python programmers ONLY use whitespace for syntactic purposes. The language itself isn't too bad but, I can't count the number of times I've opened up a .py file and been greeted by a gigantic wall of nearly incomprehensible code. Now, sure, you can do that in most languages but, it seems especially prevalent in Python.

    6. Re:Modem noise by dissy · · Score: 1

      Yah. And Perl still looks like modem noise.

      If you think that's bad, you should check out some BrainFuck program source!

      In BF, there are only 8 commands, each represented by a single character.
      Those commands are < > + - . , [ ]
      Any other characters are ignored as comments.

      For example, this is The Game of Life in .bf: http://pastebin.com/xCUhv9e8
      This is the de-css dvd decryption: http://pastebin.com/R75ruPRe

    7. Re:Modem noise by shutdown+-p+now · · Score: 4, Interesting

      Can you give some examples of "new language features" which don't "fit within the OOP paradigm" and which look horrible in Python?

    8. Re:Modem noise by Concerned+Onlooker · · Score: 1

      That was my point. You missed it.

      --
      http://www.rootstrikers.org/
    9. Re:Modem noise by shutdown+-p+now · · Score: 1

      Closures, Futures, and Coroutines--using the new "yield from", an extension of generators. Python's half-hearted closures need no explanation.

      I think they do. What's half-hearted about Python closures? With the addition of "nonlocal", they are full-featured. Are you, by chance, confusing lambdas (i.e. anonymous function literals) with closures? If not, then please explain what about nested defs in Python is a hack?

      Also, futures don't need "yield from", technically speaking. Guido decided to do it that way, yes, but you could just as well do syntactic sugar with plain "yield" (indeed, people have already done it before in e.g. Twisted).

      In any case, why would you care, given that futures and coroutines use implicit continuations (which are as full-featured as any closure gets), not lambdas?

      Futures look OK unless you've seen how such things can work in other languages, e.g. Go Channels or even the old Unix piping. Elegant concurrency requires more than a simple message queue with a nifty class name.

      The new futures are not a mechanism for concurrency, they are a mechanism for generalized asynchrony (which may or may not be concurrent in any given case). This is not the same thing, and one is not a substitution for another. For existing implementations of what Python is copying, see Java futures, .NET tasks, and Apple's libdispatch.

      "Yield from" coroutines are seriously hampered by the CPython implementation, and rather than fix the implementation and provide modern coroutines, they've decided to use generator trampolines. They're coroutines only in the strictest sense, and nothing like what languagessuch as Lua offer.

      The reason why it's actually better and not worse is because it is immediately compatible with any language and API that does not have true coroutines - which is the majority of them, and, most importantly, C. The way futures are defined and wrapped into "yield from" right now, any C-like API with callbacks can be immediately wrapped into them, including support for chains of C-Python-C-Python-... calls.

      All in all, you do sound very bitter particularly about the recent discussion on asynchrony and futures in Python on python-ideas, since all your objections are about it. I hoped for something more generic, especially seeing how the result of that discussion isn't even in any Python release as yet, so speaking of it as "modern Python" is premature in the extreme. Even the PEP is not final yet.

    10. Re:Modem noise by shaitand · · Score: 1

      I'd have to disagree. I mean sure it is spaced out nicely but it isn't especially readable. It all just sort of blurs together.

  11. Baxter Doesn't Know What He's Talking About by Baby+Duck · · Score: 5, Insightful

    I came here to call Baxter a troll, especially considering his "lacking enterprise adoption on large applications" comment, but I've already been beaten to the punch. He is living in the year 2000 if he doesn't understand the impact of JSON, jQuery, and Node.js. Perl never brought to the table anything remotely like these.

    Even if something surpasses Javascript, as long as we still use CSS and DOM, jQuery will live on -- just with bindings to this new language. As long as there is demand for a data exchange format that is both human-readable and easy for machines to parse, JSON will not die any more than XML will.

    --

    "Love heals scars love left." -- Henry Rollins

    1. Re:Baxter Doesn't Know What He's Talking About by Bob9113 · · Score: 5, Insightful

      JSON, jQuery, and Node.js. Perl never brought to the table anything remotely like these.

      I like both languages, and prefer others to either of them. Not trying to knock Javascript or blow sunshine up Perl's skirt, and I don't know if Baxter has a clue, but your statement is not correct. Perl's eval, CPAN, and mod_perl are the Perl equivalents, respectively. They do pretty much the exact same thing (except CPAN; it's actually *much* more extensive than jQuery, and has no equivalent in Javascript that I am familiar with). The only difference, as noted by many people already, is that the Javascript versions work consistently across web browsers, so their usage is more pervasive on the client side. Not necessarily better or worse based on that evidence alone, just more pervasive. Server side, there's a solid half decade of work ahead for Javascript to be in the same ballpark on infrastructure support as Perl.

    2. Re:Baxter Doesn't Know What He's Talking About by gl4ss · · Score: 1

      I'm pretty sure perl brought something like node.js to the table.. oh wait that's exactly what perl brought originally to the table.

      (as for the large library of code available easily through command line installer for node.js.. well that side is a copy of cpan except cpan doesn't have as much incompatible code in it)

      --
      world was created 5 seconds before this post as it is.
    3. Re:Baxter Doesn't Know What He's Talking About by viperidaenz · · Score: 1

      XML will live forever. Even if the sole reason is product vendors hate their users.

    4. Re:Baxter Doesn't Know What He's Talking About by jbolden · · Score: 1

      The two big things that Perl brought to the table

      a) The whole revolution towards dynamic languages. In particular Python and Ruby.
      b) CGI and the use of dynamic web contract in a practical way.

      Both (a) and (b) are vital for Javascript.

    5. Re:Baxter Doesn't Know What He's Talking About by dodobh · · Score: 2

      node.js is an event driven server for Javascript. A better Perl example would be POE. Of course, POE has a lot more modules and options.

      --
      I can throw myself at the ground, and miss.
    6. Re:Baxter Doesn't Know What He's Talking About by WaffleMonster · · Score: 1

      He is living in the year 2000 if he doesn't understand the impact of

      I guess people are easily impressed these days.

      JSON,

      Hey lets just take all of this javascript structure shit and...ya know fuck it just call eval(). Afterall mixing execution with data is the safest bestest way to program in the whole wide world.

      jQuery

      Hey lets take javascript write a set of useful high level APIs and then fuck the user over with as much ridiculous $ # . ()''$$ noise we can muster.

      and Node.js.

      Hey if you loved javascript on the browser wait till ... WTF... I give up ...

      Even if something surpasses Javascript

      If?

      As long as there is demand for a data exchange format that is both human-readable and easy for machines to parse, JSON will not die any more than XML will.

      Human readable is not easy for machines to parse. XML parsers are not simple not even close. Neither are dedicated JSON parsers the ones which don't simply punt to eval().

      I think overall humans are being put at a disadvantage by operating under the illusion human readable formats are necessary. They should easily be made readable with proper tools the same way IP transactions are made readable by wireshark.

      Insiting on human readabilty incurrs large opportunity costs while insuring insane amounts of bandwidth are wasted.

      TLVs are easy for machines to parse and do not waste bandwidth. XML is unusable for transport or storage of anything but trivially small datasets and JSON aint that much better either.

    7. Re:Baxter Doesn't Know What He's Talking About by Half-pint+HAL · · Score: 1

      I think overall humans are being put at a disadvantage by operating under the illusion human readable formats are necessary. They should easily be made readable with proper tools the same way IP transactions are made readable by wireshark.

      Insiting on human readabilty incurrs large opportunity costs while insuring insane amounts of bandwidth are wasted.

      There is no "illusion" involved in the idea of human readable formats, because we all know that ASCII/Unicode characters are the native machine-stored format. It's not an abstract number that is an abstraction of a series of bits with an assumption of a certain endedness, and it is certainly not a series of polarities within a magnetic medium deposited on a glass or polymer disc spinning at high velocity within a hermetically sealed box.

      No, Programmers File Editor doesn't translate abstract data into a human-readable form, it just gives me a window onto the untranslated data.

      </sarcasm>

      I agree with you entirely -- the myth of human-readability has hamstrung the power of computing environments. If I'm writing a mathematical formula that isn't going to change, why not render it to screen as a proper mathematical formula? There's no more readable notation for maths than classical mathematical notation! Entire multiline procedures can be rendered down to something that takes up a couple of lines of screen-space, and more to the point, I've then got the choice of seeing function names or function formulas when I read the code. Easy in-line substitution of functions would help debug complex problems where verifying the full logic of the procedure is required, while still leaving the option of ignoring it with a simple line of FFT(x) instead.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  12. Also by rs79 · · Score: 1

    You'll never need more than 640K.

    Sheer idiocy. Javascript won ages ago and people are only now waking up to this fact? You new here?

    It really is quite brilliant and the only language I thought was worth using since I learned C in 1976, and I've tried them all.

    It would perhaps to watch the 8 hours of Doug Crockfords videos to catch up on why this is true.

    --
    Need Mercedes parts ?
    1. Re:Also by mark-t · · Score: 1

      It really is quite brilliant and the only language I thought was worth using since I learned C in 1976, and I've tried them all.

      All?

      Really?

      Are you *SURE* about that?

    2. Re:Also by mark-t · · Score: 1

      Pointing out pedantry on slashdot? You must be new here.

      I might have already suspected it was an exaggeration, thanks. That was kind of my point.

      Oh.... and I think you may be confusing colloquial speech with hyperbole.

    3. Re:Also by rs79 · · Score: 1

      If I wasn't sure I would have said "I'm not sure but I think...". I went to Waterloo because I wanted to study computer languages and did. I've written a few 25 years ago one of which is still in use today that looks a lot like Java. You?

      I'm not saying I've used them all extensively, but I've looked at them enough to know what they're all about and found them all wanting. Once Javascript grew up a bit and stabilized I took a hard look at it. It's about the state of the art the culmination of three decades of advances in computer language design. That and the V8 engine and now node makes it a force to be reckoned with and it's only a matter of time till business figures this out. It took most of them 20 years to discover unix so this won't happen quickly but it will happen. I'd put money on it.

      --
      Need Mercedes parts ?
    4. Re:Also by mark-t · · Score: 1

      Again... "all"? I smell a needless exaggeration.

      Ever used QD, for example? Even once?

      Okay... that might be a bit unfair... that language was used by fewer than 5 people, ever... and I personally know 2 of them.

      What about less exclusive languages, like C@+?

    5. Re:Also by mark-t · · Score: 1

      But as you, yourself, are pedantically pointing out, I was being a pedantic and insufferable nerd, and were I to have not responded as such, then I wouldn't be very pedantic in the first place.

      In other words, you did nothing more than point out a tautology.

  13. I'm not worried by RedHackTea · · Score: 4, Insightful

    It's not Delphi (thank god), and VBScript should have died a long time ago, but it's still around. And if you know JavaScript, you're more than likely safe and knowledgeable enough to learn the next web browser language (which will probably be very similar to JavaScript). Every programmer knows that you learn a few different languages, and that they come and go. You just have to adapt. When I was younger, C++ was the shit. Then Java came along, and it was an easy adjustment/transition.

    I also find the "is it pretty?" question a little subjective. If someone writes bad code, it's ugly in any language. For a scripting language, JavaScript is fine and gets the job done. You don't have to worry about one line of code breaking and bringing down your entire site. Scripting languages have always been quick and dirty; that's the point. These days I personally prefer Ruby though for my scripting needs (haven't made a site with it using RoR though yet; I write Ruby scripts for my quick&dirty computer needs instead of using Bash, etc.).

    --
    The G
  14. Indeed. by CaptnCrud · · Score: 1

    I second and approve this WTF statement and I read the TFA.

    I would say PYTHON and PHP 5 have a better chance at replacing PERL and emb_perl capabilities then javascript every will.

    1. Re:Indeed. by Penguinisto · · Score: 4, Insightful

      I'm still wondering how Perl was discovered "during the advent of C and C++"
      .
      *boggles*
      .
      To wit: I sincerely doubt that Perl was around in 1969 or the early 1980's, FFS... ...that, or more likely, both submitter and editor need to look up what in the hell the word "advent" means.

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    2. Re:Indeed. by infidel_heathen · · Score: 1

      I'm still wondering how Perl was "discovered".

    3. Re:Indeed. by maxwell+demon · · Score: 1

      I'm still wondering how Perl was "discovered".

      If you figure out something which is part of the fundamental working of the universe then it's usually called a discovery,

      --
      The Tao of math: The numbers you can count are not the real numbers.
    4. Re:Indeed. by shaitand · · Score: 1

      I would say that php has already more or less replaced one place where people use Perl. Python is targeted at the same space but in practice it simply fails relative to Perl.

      I tend to disagree with the submissions assumption that we are looking for Perl to be replaced.

  15. Adoption by hobarrera · · Score: 1

    [...]but lacking enterprise adoption on large applications.'"

    Yeah, it's not like google, facebook youtube and a few other players use it for their frontend.

    1. Re:Adoption by Anonymous Coward · · Score: 1

      [...]but lacking enterprise adoption on large applications.'"

      Yeah, it's not like google, facebook youtube and a few other players use it for their frontend.

      Yeah, but Google is trying very hard to get rid of JavaScript (see: GWT and Dart). Google had to invent a whole typed javascript pre-parser using comment notations to manage the Gmail and Gmaps codebase.

      Google uses JS, yes. But only because that's the standard of browsers. If you actually listen to what Google says in pushing things like Dart, you realize that Google would really like to NOT use it. =)

  16. With respect... by fahrbot-bot · · Score: 5, Funny

    JavaScript Is the New Perl

    JavaScript, I use Perl. I know Perl. Perl is a friend of mine. JavaScript, you're no Perl.

    [ My apologies to Senator Lloyd Bentsen. ]

    --
    It must have been something you assimilated. . . .
    1. Re:With respect... by deek · · Score: 1

      I use and know both JavaScript and Perl. I am in full agreement with you.

  17. too accessible by technosaurus · · Score: 1

    It's not that its a bad language, it is just so accessible that all the worst (non)programmers write in it. Take a look at the relatively poor quality of questions with a javascript tag on stackoverflow... if you ever thought there is no such thing as a stupid question, that will almost certainly change your mind. Iirc this was the case with perl in its early years. Maybe it will change with the release of ECMASCRIPT-1.D.10.T?

  18. Re:What. The. Fuck? by Joce640k · · Score: 1

    Yep. It even has the obligatory mention of C++ to lure the little fishes in.

    (comparing a web scripting language with an adult language like C++ makes no sense anyway...)

    --
    No sig today...
  19. perl haiku by inode_buddha · · Score: 1

    fp.pl?

    (Score:5, Funny)
    by CptChipJew (301983)
    Thursday January 22 2004, @11:24PM (#8062958)

    open(heart_to_perl);
    content-type: haiku/firstpost;
    or die "i fail it";

    --
    C|N>K
  20. Coming from a PERL guy by CaptnCrud · · Score: 2, Informative

    Scenario, im new to perl. Would you consider this simple sort of subroutines human readable?:

    @s = sort mycriteria @a;
                  sub mycriteria {
                      my($aa) = $a =~ /(\d+)/;
                      my($bb) = $b =~ /(\d+)/;
                      sin($aa) sin($bb) ||
                      $aa*$aa $bb*$bb;
                  }

    I agree, that correct oop practices and not abusing special chars helps (the latter has always been rampant at every shop I ever worked at, as you said programmers are lazy), but make no mistake, the above is not readable to a beginner.

    1. Re:Coming from a PERL guy by Anonymous Coward · · Score: 1

      the above is not readable to a beginner.

      The code above, expressed in any language, would be "not readable to a beginner." Sorting using custom comparison function requires little tweaks in pretty much any language.

    2. Re:Coming from a PERL guy by Penguinisto · · Score: 2

      Err, it would be if you, like, you know... commented a little in the damned thing. ;)

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    3. Re:Coming from a PERL guy by flargleblarg · · Score: 2

      First of all, that's not even valid Perl. You can't write "sin($aa) sin($bb)" or "$aa*$aa $bb*$bb" because the space character is not an operator (in AWK, it's the string concatenation operator in certain contexts).

      Second, the assignments to $aa and $bb are confusing because you left out parentheses around the right-hand side. This is not Perl's fault; it's the author of the code's fault that it's confusing. It would be much clearer as:

      my ($aa) = ($a =~ /(\d+)/);

      Third, what the hell is this code trying to do? If you're going to take the sine of a number, why are you plucking out only the digits [0-9] from the $a and $b strings? Why are you ignoring decimal points? Are you trying to do some kind of 2D linear algebraic expression manipulation here?

    4. Re:Coming from a PERL guy by znrt · · Score: 1, Informative

      the above is not readable to a beginner.

      The code above, expressed in any language, would be "not readable to a beginner." Sorting using custom comparison function requires little tweaks in pretty much any language.

      not in javascript:
      myarray.sort(function(a,b){return b - a}) ;

    5. Re:Coming from a PERL guy by dskoll · · Score: 1

      Well, yeah, you can write obfuscated Perl (although what you wrote isn't even Perl... it's just a bunch of syntax errors.)

      You can also write obfuscated C. And you can also write maintainable large systems in Perl and C. In fact, I think comparing Perl with JS is unfair; Perl is far easier to use for maintainable, large projects than Javascript is.

    6. Re:Coming from a PERL guy by jbolden · · Score: 1

      That's readable it just involves several constructs that are complex -- assuming that your formulas have a missing symbol. Saying that is unreadable, is like saying this sentence is unreadable in English because it involves an analogy and analogies are not basic.

    7. Re:Coming from a PERL guy by fatphil · · Score: 1

      Assuming you're missing some "<=>"s (you know, you could preview), that's at least as readable as it would be in any other language. More so, if anything, as it's nice and terse.

      How would you write the same in C++, Lua, or JavaScript?

      --
      Also FatPhil on SoylentNews, id 863
    8. Re:Coming from a PERL guy by Anonymous Coward · · Score: 1

      perl equivalent:
      @myarray = sort { return $b - $a } @myarray;

    9. Re:Coming from a PERL guy by Count+Fenring · · Score: 1

      Dead on ;-)

      Side note - the $a and $b are Perl's semi-magic sort variables (they're globals that become references to the items being sorted).

    10. Re:Coming from a PERL guy by dodobh · · Score: 1

      $a and $b are "magic" variable names for sort (the function automatically assigns them values when comparing).

      --
      I can throw myself at the ground, and miss.
    11. Re:Coming from a PERL guy by shaitand · · Score: 1

      Who cares if it is readable to a beginner? The question is what is readable and maintainable BY PERL PROGRAMMERS. People who don't know Perl shouldn't be able to read and maintain Perl. They are just going to write poor Perl code.

    12. Re:Coming from a PERL guy by shaitand · · Score: 1

      Yup, despite it being broken as written and his complete lack of commenting.

      That was about as ugly as Perl gets. The ugliest Perl gets is routines involving complex data structures. A hash full of hashes filled with arrays which contain and element that is a hash of hashes for example. Perl objects aren't great (it isn't really and OO language) but in most cases they can replace these type of ugly constructs with something that is not only easier to read but easier for the programmer to follow himself.

      Other than that, there are a handful of variables that Perl uses or populates on a regular basis. These wouldn't be obvious to a non-perl programmer.

    13. Re:Coming from a PERL guy by Schmorgluck · · Score: 2

      Perl objects aren't great (it isn't really and OO language)

      Efforts are being made to improve them. Have a looke at Modern Perl and what it proposes about objects.

      Good stuff on other matters too. I even discovered there a very interesting use of goto to make a tail call elimination, something that's still unavailable in Java. Of course, this being goto, I have a psychological blockade to actually use it, even though I know that Perl's goto is far more sane than BASIC's.

      --
      There's nothing like $HOME
  21. Properly understanding javascript.. by joss · · Score: 5, Funny

    .. is just like leaving an abusive relationship, its all about getting closure.

    --
    http://rareformnewmedia.com/
  22. GWT? by slew · · Score: 2

    So the author of this article likes GWT? Is the future Java on the client side? We used to have java applet clients in the early web-days, but it didn't really go anywhere because it was a pretty much a separate environment which didn't interact with DOM. Right now GWT is really mostly yet another framework that cross-compiles into Javascript. Perhaps the best usage outside of the framework is simply enforcing a statically typed infrastructure on top of JavaScript, at worst it's usage is sort of "lint" for JavaScript.

    Although there's some marginal benefit from a statically typed regime, if this is all that the future requires to be up to snuf for enterprise usage, that's a pretty low bar for the next ECMAScript. They could just add a few checking attributes to the ECMAScript Object prototype to lock-out the dynamic nature of the object and developers could just migrate their "important" code to use this style of object that if they wanted to be "enterprise". You could even decorate these "finalized" objects somehow to hint the ECMAScript JITs to get any performance advantage you might get with statically typed languages.

    Sadly this would eliminate the dynamic type features that make dynamically typed languages more powerful than their statically typed counterparts (although Generics/Templates bridge some of that gap for static languages like Java/C++). Of course with great power comes great responsiblity, and it's possible to write unmaintainable code in nearly every language, but it seems everyone has thier golden bullet to solve the "enterprise" coding problem. I'm usually unimpressed by golden bullets.

    1. Re:GWT? by shutdown+-p+now · · Score: 1

      The problem with JS is not the lack of static typing. It is that, even as a dynamic language, it is poorly designed. Overly verbose syntax, weird scoping rules, numerous inconsistencies and non-orthogonalities etc.

      No-one knows what the future is on client side, but there are many possibilities, not just Java (if anything, that'd be pretty unlikely). We could have some language that is dynamic like JS, but better designed to begin with, and more expressive to boot. We already have like a dozen to choose from - Lua, Python, Ruby etc.

      Better yet, it could be a low-level bytecode VM. That would solve the problem nicely once and for all - with a sufficiently expressive VM, you could have any language targeting it, so it would only be up to you as a developer to decide what you want to use for any particular problem.

  23. Perl and enterprise by Anonymous Coward · · Score: 1

    A couple of months ago I started working for a large company (over $1billion per year turnover) who use Perl a lot. I am working on one of several business critical applications. The one I work on is over 400,000 lines of code including tests (and some javascript). There is a team of more than 30 perl developers.

    Before taking this job I interviewed at a number of other potential employers who also use Perl for large projects which are very much current in their business.

  24. Why is it always cool to bash Javascript?!?!? by Anonymous Coward · · Score: 1

    This is mostly due to to people not understanding the full capabilities of the language or blaming lack of DOM standards on Javascript. Javascript properly utilized can be used to create OO code which in the right hands can be maintainable in large applications, ever hear of JQuery, JQuery UI ? You can get a grid control in a few lines of code; AJAX where you can update a portion of a page instead of the whole thing, all of this occured because of people discovering the latent capabilities of Javascript. Fucking JSON, which data becomes running code and code can transform into data.

    I guarantee, no one wants a strongly typed language to write a web apps. The JS engines far outstrip any Java VM performance, where is Java now? Fucking ivory tower white elephant.

    Javascript is great because a dummy could get into it and actually make something, but I suspect because its this low learning curve is not "geeky" enough for some folks. Javascript is in the same boat with HTML, its just "too easy and loose". If that mentality had persisted, the internet would not be what it is today. We will be stuck in a geek paradise with less than 1000 websites all about the latest fork of linux but they would be happy because we are using C++ to code LOLCATS.

    1. Re:Why is it always cool to bash Javascript?!?!? by mark-t · · Score: 3, Informative

      The JS engines far outstrip any Java VM performance

      Citation please. I'll concede that modern JS engines are very good, but arguing that an engine for a dynamic interpreted language outperforms a modern VM for a statically typed compiled one sounds a bit.... suspicious.

    2. Re:Why is it always cool to bash Javascript?!?!? by someones · · Score: 1

      bytecode is also compiled into native machine code.

      or since when do CPUs excecute bytecode natively?

    3. Re:Why is it always cool to bash Javascript?!?!? by Skapare · · Score: 1

      Javascript is great because a dummy could get into it and actually make something, but I suspect because its this low learning curve is not "geeky" enough for some folks. Javascript is in the same boat with HTML, its just "too easy and loose". If that mentality had persisted, the internet would not be what it is today. We will be stuck in a geek paradise with less than 1000 websites all about the latest fork of linux but they would be happy because we are using C++ to code LOLCATS.

      That's not how I would characterize greatness. But compared to C++ I'd rather have JavaScript or Python be the language to use for web sites (no, I did not overlook Perl).

      I happen to believe we need more than one language. Let one be the easy to use language for both idiots (will never grow beyond this) and newbies (some day they will know how to really code). Let another be for serious website design. If the first is a proper subset of the second should be the big question. Leading people to believe they are doing things right (because it works) is what is wrong. But it's also hard to teach correct programming if they can't see some working progress to keep their interest.

      Sadly, the language (C) I use most is victim to this. It's quite possible for a newbie to start with C and have hello world running in an hour after reading a few chapters. The thinking that will result mis-prepares one for what C really is (an awful mess of pedantic definitions just to achieve portability ... though C++ is worse). I'd rather have something better, especially for web and mobile app design. Javascript can do it, but it would be better if a few things were fixed. I'd go with Pike or Python for serious scaled designs. There may be use for languages like Dart and Go (but I have not evaluated them).

      --
      now we need to go OSS in diesel cars
    4. Re:Why is it always cool to bash Javascript?!?!? by viperidaenz · · Score: 1

      V8 does compile to machine code. It works by creating classes for the javascript objects and compiling those. It's basically converting the Javascript into a statically typed language first. If the definition of the javascript object changes, it needs to be recompiled.

      A similar thing is done in a JIT JVM, except there is more information available to the VM to perform optimisations, since everything is already statically typed, some method calls are even statically defined, classes can be declared or inferred final and field/method scope is definable.

      Java has had JIT since before V8 was invented.

  25. I blame Node.js by MagikSlinger · · Score: 1

    I've seen far too many developers get excited by Node.js. Boggles my mind, personally, but the idea of a Javascript back-end is coming.

    --
    The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
  26. Re:What. The. Fuck? by Penguinisto · · Score: 2

    Nah - I chalk it up to incompetence this go 'round.

    If they really wanted to troll, they'd chuck in a mention of how they should use it instead of C to write the FreeBSD kernel, or say that JS is somehow going to replace .NET.

    (/me ducks and runs like hell...)

    --
    Quo usque tandem abutere, Nimbus, patientia nostra?
  27. How many javascript developers does it take? by Cryacin · · Score: 5, Funny

    How many javascript developers does it take to change a lightbulb?

    10,000. 1 to hold the bulb, and 9,999 to turn the house around.

    Replace Javascript with Perl as the situation commands.

    --
    Science advances one funeral at a time- Max Planck
    1. Re:How many javascript developers does it take? by rvw · · Score: 1

      How many javascript developers does it take to change a lightbulb?
      10,000. 1 to hold the bulb, and 9,999 to turn the house around.

      Replace Javascript with Perl as the situation commands.

      Isn't there a Javascript library that can run Perl scripts? Then we can employ another 10.000.000 developers.

    2. Re:How many javascript developers does it take? by Waldeinburg · · Score: 1

      Nah, it's three: One to hold the bulb, one to write "house.merry_go_round() = function() {...};", and one to scold the second developer for not putting that method in House.prototype in the first place.

  28. Re:Whats wrong with JS? by lattyware · · Score: 4, Interesting

    https://www.destroyallsoftware.com/talks/wat - Give that a watch - it's short and amusing, not some huge rant or dissection (begins on Ruby, moves to JS). Done watching? JS is full of that kind of horrific design that makes code do stuff you don't expect, and it lacks features that everyone needs. It just makes development harder, and that's the reverse of what you want a language to do.

    --
    -- Lattyware (www.lattyware.co.uk)
  29. I Beg to Differ... by sharksfan98 · · Score: 1

    I do not agree with this article because Perl and JavaScript are two whole different languages. I use Perl everyday to write simple scripts from everything to running Regular Expressions (while I'm not using Python). I've faintly used JavaScript when writing web applications in node.js, but I've never really needed it for anything else. Perl can do web and GUI development (in Perl/Tk and CGI), but it does way more. JavaScript only does web development, while Perl does way more. I would agree with a statement more like "Python is the new Perl", but nothing else seems to come close to Perl.

  30. Re:totally made up grammer, or what... by PPH · · Score: 1

    Its a shame we don't have some sort of error handling facility that would throw an exception in cases like this.

    --
    Have gnu, will travel.
  31. Re:We are verbing adjectives now? by mark-t · · Score: 1

    Agreed... especially since there's another verb already that conveys the exact same notion.... "liken".

  32. Re:Uhm... by mark-t · · Score: 1

    The reason that the error rate is so high with javascript on websites is because the environment in which it is most commonly used, a web page, such mistakes are generally of no real consequence, and it's pretty certain that most (if not all, but I would hesitate to make that broad a generalization) programmers are lazy

    Blaming a language for the fact that it's usually used in environments where it doesn't actually generally matter if the programmer was too lazy to write correct code is like blaming the inventor of the automobile for people who get into accidents while driving drunk.

  33. JS/HTML5/CSS Client and Java Server by Baldrson · · Score: 1
    Baxter is correct in his prediction that Java isn't going away anytime soon but otherwise he's off on his reasoning hence predictions.

    Java will dominate the server side and a lot of other places simply because Vinod Khosa made it the instructional language of India combined with the drive by the Fortune 1000 to lower programming wages regardless of quality or long-term consequences.

    Java failed on the client side. Javascript/HTML5/CSS won.

    Even in the new mobile devices, with all the weight of Google and Apple thrown behind Java and the JVM, Java will, once again, lose to Javascript/HTML5/CSS.

    Yes, Java is the new MS-DOS of the server world and if someone could actually own it by keeping secret the API (hence upward compatibility paths), the way Gates owned MS-DOS, they'd be the new richest man on Earth regardless of the fact that Java and its entire culture is basically about throwing gibbering hoards at a problem. Java is a jobs program for Indians. I suppose distributing the wealth in a jobs program has merits compared to giving a bunch of money to one guy.

    1. Re:JS/HTML5/CSS Client and Java Server by XxtraLarGe · · Score: 1

      Even in the new mobile devices, with all the weight of Google and Apple thrown behind Java and the JVM

      ???

      --
      Taking guns away from the 99% gives the 1% 100% of the power.
    2. Re:JS/HTML5/CSS Client and Java Server by shutdown+-p+now · · Score: 1

      Java is the new MS-DOS of the server world and if someone could actually own it by keeping secret the API (hence upward compatibility paths), the way Gates owned MS-DOS

      That makes no sense at all, given that DOS APIs were never secret (how exactly do you think people wrote DOS apps?).

    3. Re:JS/HTML5/CSS Client and Java Server by Baldrson · · Score: 1
      Aside from the fact that there were undocumented MS-DOS calls that were used by MS applications, MS's applications wing was able to anticipate new directions in the soon-to-be public aspects of new versions of the API.

      This rendered it impossible for competitors to write MS-DOS clones the way Phoenix wrote a clone of the IBM-PC bios.

  34. Re:Web by gl4ss · · Score: 1

    Doing pretty good as a web language.

    that's out of necessity.

    web browsers have JS intepreters so you have to use it so it does well in that. frankly I'd rather be writing java, but as it is for historical reasons the java integration and isolation into 'safe' environment like JS was never done for browsers.

    Javascript is horrible but it's still better than perl! or php for that matter.

    --
    world was created 5 seconds before this post as it is.
  35. I think it's more like an assembly language by istartedi · · Score: 1

    I think it's more like an assembly language that flies 10,000 feet over "bare metal". There are quite a few things that generate JavaScript. Guys are working on projects that target it. People program in $whatever, and target JavaScript.

    It won't get Perl'd. It'll get 386'd.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  36. Really? Ok lets do some transforming... by CaptnCrud · · Score: 1

    Perl:
    @sorted_array =
                  map { $_->[0] } # extract original list elements
                  sort { $a->[1] $b->[1] } # sort list by keys
                  map { [$_, -M $_] } # pair up list elements with keys
                  @files_array;

    Ruby:
    new_list = old_list.sort_by {|file| file.mtime }

    Yep, PERL certainly looks more readable.

    1. Re:Really? Ok lets do some transforming... by jbolden · · Score: 2

      You aren't writing the same function. Why not skip the two maps and do:

      @sorted_array = sort{ (-M $a) cmp (-M $b) } @files_array;

      ____
      and if you like the mtime rather than -M just define a 1 line subroutines.

    2. Re:Really? Ok lets do some transforming... by fatphil · · Score: 1

      You've chosen to perform a Schwarzian transform in the perl example, which may be an unnecessary optimisation. I know this, as I can read the code. (Even though you were too lazy to preview it, and submitted it mangled.)

      I have no idea if Ruby performs the same optimisation with your code. I guess that means that it's unreadable, as I certainly can't ascertain what I require to glean from just reading the code.

      --
      Also FatPhil on SoylentNews, id 863
    3. Re:Really? Ok lets do some transforming... by jbolden · · Score: 1

      I understand. The Schwartzian version invokes the -M operation N times, while the reduced version invokes in N*log(N) times, it is much slower if -M is slow. But the idea was that the Perl was less readable while comparing the efficient N-times Perl to the N*log(N)-times Ruby. I just pointed out that if you made the Perl equally inefficient the code got a lot cleaner, he wasn't doing an apples to apples comparison.

  37. Wakanda IDE by witherstaff · · Score: 2

    I was surprised to see wakanda exists. At first the thought of all client and server side being in javascript struck me as loony. But they do have some interesting demos. Honestly haven't dug into it extensively and it may not be applicable in the real world. The trials I did with it made the typical AJAX things surprisingly easy. Anyone on /. happen to use it in the real world?

  38. Node.js by Heretic2 · · Score: 2

    So... Node.js, chalked full of easy ways to leak memory (ie don't change default debug console, or use a crappy gzip library) but the ability to write code that runs/renders either on the server or on the client with the same code and low-level libraries to make the decision of the best place to render--ie render same code on server or client--makes JS on the server-side rather attractive. I run, Operations side, over 1000+ websites on a Node.js farm (talking 200-300 mbit/sec of sustained daily web-traffic), and it scales a lot better than PHP from both a templating side (many similar but different sites with inheritance based properties) and from the performance scaling side.

    From a PLT side, yea, JS ain't the best, but it's a defacto web-rendering technology and its use on the server can simplify a lot of things, not to mention that JS in V8 is pretty quick to boot, although it does have heap limitation based around the 32-bit code V8 generates.

    I leave comment readers with a wonderful link: This PLT Life

  39. The symbols where stripped out on posting. by CaptnCrud · · Score: 2, Informative

    This was ripped straight from John Klassa / Raleigh Perl Mongers / Sorting in perl.

  40. Seriously? by tjstork · · Score: 1

    JavaScript is terrible. At least Perl has a semi credible namespaces and library mechanism. If you have a big site with loads of JavaScript, you are just lost in mega page mishmash. And, JavaScript doesn't even have a native decimal or currency type, and the way JSON stores represents dates is just aweful. So, no, JavaScript is not going to take over the world.

    --
    This is my sig.
    1. Re:Seriously? by marsu_k · · Score: 1

      the way JSON stores represents dates is just aweful

      Full of awe? Anyway, as per the spec, dates are not supported as a value. Some implementations incorrectly use something like "new Date(2013, 0, 7)" to store dates, but this is officially not sanctioned and might not work as intended. But really, if you are storing dates in JSON (or anywhere else where a native date object is not available), there's only one format. You can sort by it in the string form, and get a date object simply by using new Date(isoStr).

  41. Re:Web by Anonymous Coward · · Score: 1, Insightful

    Java is horrible, plain and simple.

    Javascript (no relation to JAVA) is keeps being extended by third parties into crapful implementations. It's actually just fine and rather easy for beginners to learn, unlike Perl. Also if you learn it, things you learn from it can be applied to C.

    The problem comes along when browsers don't have the same level of implementation and performance, and then people demand things from it that it should never have been doing (eg WebGL, SVG, Sound and Music generation/Mixing) to try and turn the web browser into a multimedia platform it was never supposed to be.

    It's not the language's fault. But Java is worse (You're lucky if the host has a Java VM at all, let alone a 64bit version. Nobody has a bloody clue how to run a Java application without a OS-centric runtime.)

    JavaScript = One language, many runtimes, different performance levels, and poor/non-existant threading.
    Java = One language, one runtime, consistent performance on the same hardware, inconsistent performance on different platforms, extremely poor hardware support (worse than Javascript)

    The irony with Java is that people keep trying to do the same thing with Java that they're trying to do with Javascript, these languages are not the right tools for multimedia. Period.

    Multimedia requires a complete re-think about how media is played, and we were part way there with Macromedia Flash (Not Adobe's versions) but then Adobe went and turned it into a generic video player and people no longer make multimedia using flash. It's now sole purpose is Video advertisements.

    If we could stop this stupidity and look at why we need OpenCL, OpenGL, etc it's because these are hardware scaling issues that we can't do with C/C++/Java/Perl/PHP/Javascript/etc with how people have been taught, and might still be being taught computer science. We need a C-like language that is multimedia aware and scaleable at the compiler level.

    What we should be able to do is something like

    main()
    {

    new mediacontainer = openmedia("cateatingacheezeburger.mp4");
    mediacontainer.requirevideohardware(true);
    mediacontainer.languageselect("EN");
    new subtitles = openmedia("subtitles.csv");
    mediacontainer.overlaychildmedia(subtitles);
    mediacontainer.moveplayhead("23s");
    mediacontainer.usefullscreen(true);
    mediacontainer.play();
    }

    The underlying compiler should then link in the OS-dependant libraries to enable playback of said file as needed. If the OS lacks the libraries, then it should just STOP unless it's optional. Let the software use the underlying threaded, possible hardware support. Quit reinventing wheels.

    But no, this isn't what happens at all. What keeps happening is that people become obsessed with turning all these easy to use languages into OOP models that only they understand.

  42. Re:Whats wrong with JS? by ancientt · · Score: 1

    Actual LOL, thank you sir.

    --
    B) Eliminate all the stupid users. This is frowned upon by society.
  43. Re:Web by viperidaenz · · Score: 5, Insightful

    But your solution requires the same functionality to be implemented on every platform that behaves exactly the same, regardless of form factor, performance or architecture.

    The closest thing to that at the moment is a JVM.

  44. Re:To those that think Perl is a write-only langua by Skapare · · Score: 1

    No, it is not write-only. It can be read, too. The trouble with Perl is that between writing and reading, information is lost.

    --
    now we need to go OSS in diesel cars
  45. Re:Whats wrong with JS? by lattyware · · Score: 1

    I laugh every time without fail - extremely funny.

    --
    -- Lattyware (www.lattyware.co.uk)
  46. Perl's purpose by Darinbob · · Score: 5, Informative

    Perl wasn't an alternative to C/C++. It became popular because it was a nice replacement for all those other Unix apps, a combination of sh+awk+sed, etc.

  47. Re:Whats wrong with JS? by LesFerg · · Score: 1

    "...I found that JS became much more predictable once I learned a little more about what was going on..."

    I am sure many of us have inherited code written more on a superstition than an understanding of JavaScript. When badly written it can be hard as all hell to trace the errors. However when it is understood and used correctly it can be very powerful while providing an elegant and often very short-and-simple solution to what you are trying to achieve. I read a book recently, JavaScript The Good Parts [http://shop.oreilly.com/product/9780596517748.do] which, while it was a little dry to read, did a damned good job of pointing out the misconceptions and wrong ways to use types and classes, and pointed out the correct patterns for using the power of JavaScript correctly.

    That book, combined with the introduction of jQuery, gave JavaScript a whole new level of fun, at least for me. Of course on the down side it made me want to rip thru years of old code (which I have not been allowed to replace/delete yet) and rewrite it in a fraction of the amount of JavaScript code that is currently used to badly achieve its purpose.

    I have to wonder if those who decry JavaScript the most have the least understanding of how to use it properly - altho I have to admit, it was never intuitively apparent exactly what were the right and wrong ways of using types, functions, classes and closures.

    --
    If I had a DeLorean... I would probably only drive it from time to time.
  48. Re:Web by modmans2ndcoming · · Score: 2, Insightful

    Perl, Python, Ruby all superior languages to Javascript with none of the bloat of Java.

  49. I heard about this new application by Punto · · Score: 1

    I heard about this new application callled "NCSA Mosaic", maybe that has potential to adopt javascript and make it big.

    --

    --
    Stay tuned for some shock and awe coming right up after this messages!

  50. Re:Web by viperidaenz · · Score: 1, Insightful

    I'm sorry, I must have missed the bloat.

    Is it the high performance VM, is it the cross platform runtime libraries or has 1996 called and they want their bytecode interpreter back?

  51. Re:Whats wrong with JS? by rock_climbing_guy · · Score: 1

    I watched the video you linked to. I have been programming in JavaScript for years now. I was puzzled by the odd results that the author obtained, but having seen doesn't make me feel like JavaScript is inadequate for what I use it for. After all, why would anyone ever try to do the non-sensical calculations he asks JavaScript to do. Why would you ever ask JavaScript to do {} + []?

    --
    Wh47 d1d j00 541, 31337 15n't t3h r0xor5 ne m0r3???
  52. Perl is not a programming language... by Lord+Kano · · Score: 1

    It's a religion. Speak ill of it and you shall face the wrath of the monks.

    LK

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
  53. Re:lol it did it again. left arrow equals right ar by shutdown+-p+now · · Score: 1

    Slashdot comments are HTML (or a subset thereof), and so < and > are special characters. Either write them as HTML entities, or use <ecode> element to wrap your code snippets.

  54. Re:Why not Python by jbolden · · Score: 1

    Perl is the duct tape of computer science. Python is a good attempt to create a dynamic applications programming language. "There’s more than one way to do it" is key to Perl's whole approach and Python is just the opposite. I agree that some of what Python is a good alternative to Perl, I don't agree on replacement.

  55. Re:Uhm... by shutdown+-p+now · · Score: 1, Insightful

    I'm fond of saying that javascript is the worst language ever invented - however, that's only because I've put Perl out of my mind completely.

    Have you tried PHP?

  56. Re:Web by TheLink · · Score: 1

    Javascript is faster nowadays though. Is making a JIT (or similar) for Perl/Python/Ruby harder than for Javascript? Or is it just because enough $$$ and smart people were thrown at the problem?

    --
  57. Re:What. The. Fuck? by Ghjnut · · Score: 2

    You know what's funny? I actually enjoy seeing these submissions. The conversations that ensue tend to emphasize where this statement might be true as well as where it isn't. I actually find the majority of insight on most submissions in the comments and often completely skip the articles. Articles tend to be just a single person's stance anyway.

    --
    MouseClass extends ScrollClass, which extends TabClass, which extends SidebarClass, which extends PowerClass, w
  58. Incomprehensive garbage by drolli · · Score: 3, Interesting

    perl has a very specific scope
    js has a very specific scope

    The overlap between the two scopes is not big.

    for tasks in the center of its scope, perl is still the best - filtering some plain text file is just easy in perl. Perl never ran on any browser. but perl ran on pretty much anything else (I used it on DOS)

    And js was never used in a significant extent to filter text files.

    js in not new (so it can not be the "new" perl)

    perl was inteded as an easy to learn extension-mixture-replacemnt of shell,tcl/tk,awk,sed. It still is and it is working well. (although tcl/tk still has something going for it (robustness, easy cross-platform gui)).

    if there is on thing, which would be "the new perl" then it would be php. Most of the www things which would have been written in perl from 1995-2000 now are written in php.

    1. Re:Incomprehensive garbage by gl4ss · · Score: 1

      js can be used for console scripting just as well as perl.
      that's the point, the old specific scopes are going out of the window.

      --
      world was created 5 seconds before this post as it is.
    2. Re:Incomprehensive garbage by dkf · · Score: 1

      js can be used for console scripting just as well as perl.

      So too can PHP I hear, but of the three I'd still prefer Perl.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    3. Re:Incomprehensive garbage by drolli · · Score: 1

      Yes. A screwdriver can be uses as a drill, and a drill can be used to remove screws.

      I did not say anything in impossible. But the sheer fucking big amount of perl modules which will help you in small, handy conversion tasks between text formats, encodings, message types, etc. makes perl still the faster tool for the task. Believe it or not. Nearly twenty years of people who code in a certain direction leave some trace in some software ecosystem.

      The point is that plain-text formats and many of the old formats are partially superseded by xml or json. To process these, other choises are better than perl. Althoug i have to admit that js is not the first things which comes to my mind in that respect.....

    4. Re:Incomprehensive garbage by Inoen · · Score: 1

      Perl never ran on any browser.

      Actually, i believe it did in one of the early vesions of IE.
      Not out of the box, mind you. As far as i recall, IE at the time would run any scripts that could be executed in an interpreter that complied with MS' scripting interface (forgot the name). And there was such an interpreter for perl.

    5. Re:Incomprehensive garbage by drolli · · Score: 1

      I kind of expected a comment like this, since i actually rememberd that there have been a big number of experimental scripting interfaces in the browsers of the 90s...

      But i did no remember explicitely that perl was among these.

  59. CoffeeScript on Meteor.com by kasper_souren · · Score: 1

    I'm no fan of JS but last year I decided to give it a try anyway, first because of Node.js, phonegap and later Meteor.com. I tried CoffeeScript several times and slowly I've become a big fan and all our new code is written in CoffeeScript. Much less typing, very readable (nothing like Perl) and if you add underscorejs to the mix you get a very nice and concise language that looks and writes a bit like something between Ruby and Python - which you can use both on the server and the client!

  60. Re:What. The. Fuck? by balise · · Score: 1

    It is snide but I like the signature on this comment. May
    repeat but will attribute to oodaloop @ Slashdot. It sort of may
    be a troll, but Javascript is++

    --
    John Eadie [JE46] http://www.c-art.com `one of these days the dogs aren't going to eat the dog food' - Bill Joy
  61. Don't think, stereotype! by Anonymous Coward · · Score: 1

    I see a lot of people talking about Javascript encouraging bad behavior.

    Javascript by itself does not encourage any specific behavior.

    People relying on global shared namespaces and reimplementing classical inheritance tend to misuse language features in order to make JS look like C++ or Java. This approach sounds awesome, lets take completely different semantics for runtime, explain it as being similar to different semantics if you use a function then complain when it does not act 100% the same, awesome.

    It seems like people forget CS101, encapsulation, DRY, separation of concerns, etc. Sure blame the language when you don't even pay attention to the basics. Don't encourage people to pay attention to best practices, just rely on the language. The language.

    1. Re:Don't think, stereotype! by Elminster+Aumar · · Score: 1

      My hat is tipped, my friend.

  62. Re:Web by Anonymous Coward · · Score: 1

    Use the best tool for the task.

    Also a lot of those you listed don't do many of the things Java can do well, day 1. It's a difference of putting things in standard libs and making them ultra-configurable via files/xml/attributes instead of conventions or not at all. It's often a matter of taste and certainly can be annoying. But for those of us that do more than just simple web programming, even Java can look amazing and make Python, Perl, and Ruby look like trash.

  63. JavaScript: The Good Parts by Pelam · · Score: 1

    JavaScript: The Good Parts by Douglas Crockford shows a way to write clean, conscise and predictable code in JavaScript. (It is also very short book, which I find hilarious. Even then the most important points in the book are in the first half or so.)

    The most powerful idea IMHO is the use of function scopes as the main data structure instead of dictionaries. Another idea is avoiding or skipping completely some language features that behave in unusual ways and using simpler more fundamental constructs instead. I think the new-operator is the classic example of these.

    I recommend this book wholeheartedly for anyone learning JavaScript and having some prior programming experience.

  64. The 1990s called by Morpeth · · Score: 1

    ...they want their headline back.

    --

    'The unexamined life is not worth living' - Socrates
  65. Re:Web by MyHair · · Score: 1

    The closest thing to that at the moment is a JVM.

    Then why do I have to install two or three versions of Java on each desktop to support my enterprise apps?

    Oh, nevermind.

  66. And here I thought it was the new Beatles. by laxr5rs · · Score: 1

    Darn.

  67. Re:Web by Joce640k · · Score: 1

    What we really need is a compiler that compiles Java down to Javascript.

    All the power of Java but no Oracle, no endless update nag screens and one less source of browser exploits (JVM exploits are a big problem in practice).

    --
    No sig today...
  68. Re:Web by shaitand · · Score: 1

    High performance VM ROFL.

    You can have all the articles about how java can potentially, theoretically, in specially crafted scenerios be just as fast as C (or in some claims faster, which is a logical error, there is nothing stopping you from building an application specific tuned bytecode with dynamic optimization in C that will perform as fast or faster than the generic one used by java) but in the REAL world, large applications written in Java run slowly and use lots of ram.

    Java is nice and portable but real world performance lags far behind the highly optimized Perl the submission seems to be bashing.

  69. Hey! by Anonymous Coward · · Score: 1

    May I quote you on my sig, Sir?

    1. Re:Hey! by ralphbecket · · Score: 1

      Be my guest :-)

  70. Re:Web by gl4ss · · Score: 1

    Java has been a security hell for the last two years so...no....bad idea.

    my point about java was that it's much better language to write in and to maintain code.
    that it wasn't integrated(and isolated from os! so that people would actually keep it on) as well into browsers as javascript is the only reason javascript has foothold. speed advantages etc would be on java's side, javascript is just teh suck(even memory use would be on java's side, you could do most dom manipulation with jvm itself taking few hundred kb's of memory...).

    --
    world was created 5 seconds before this post as it is.
  71. Re:Web by viperidaenz · · Score: 1

    Perl is faster than Java? HotSpot > Parrot. There is no JIT VM for Perl.

  72. Re:Web by viperidaenz · · Score: 1

    I said closest thing, not solution.

  73. Re:Web by bmcage · · Score: 1
    Python has PyPy which has JIT, http://pypy.org/

    Unfortunately I already switched to python 3 for my own coding. They need funding to support python 3: http://pypy.org/py3donate.html so clearly money is an issue.

  74. Re:What. The. Fuck? by oodaloop · · Score: 1

    Feel free to use it without attribution. I came up with it myself, but I don't think it's so creative that no one else could have.

    --
    Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
  75. Re:Web by alihm · · Score: 2

    Please, stop saying it. JS is the only reason the web we're experiencing is shitty right now. because it's really easy to write horrible code with it, actually you have to code horribly in order to do make it work. WTH.

  76. Better JavaScript by Archibald+Buttle · · Score: 2

    I know it's a controversial opinion, but modern JavaScript is OK.

    All modern browsers support the ECMAScript 5 version of JavaScript. That includes a number of useful additions to the language.

    IMHO the most important addition is strict mode. That disables some of the most egregious features of the language, making it harder to shoot yourself in the foot. Strict mode can be enabled for a whole file, or on a function-by-function basis - you just need to include the line "use strict"; (including the quotes) at the top of the file or function. As it's just a string it will be ignored on older JS interpreters making it backward compatible too.

  77. Re:Web by Kartu · · Score: 1

    Depends on real world, I guess. In my real world, well written Java code (nothing fancy, just no stupidity) was running on par with C++ code (by "on par" I mean within 3 times slower, quite often within 1 - 1.5; int based code even tend to be slightly faster), but yeah, it needed much more memory.
    The only part that really seriously lagged behind, was math functions like sin/cos, at the time I've checked, in JVM it was a two pager C code, instead of using CPU capabilities (multi-platformness was the cause I guess).

    The major misconception is that JIT is producing code that is inherently slower than static compiler. Well, guess what, it's on the opposite. Unlike static compilers JIT compiler can gather runtime information and use it when deciding which branch to prefer etc. You got memory management, bounds checking etc that you have in Java but don't have in C++, but part of it can be switched off by jvm switches.

  78. Re:Web by 2fuf · · Score: 2

    Try Flash

  79. Re:Web by 2fuf · · Score: 1

    LOL I meant Flex, sorry

  80. It's not about the language, but the libraries by laffer1 · · Score: 1

    JavaScript has improved greatly over they years, but for serious work it's still lacking a centralized repository for libraries. Most other scripting languages have something equivalent to CPAN, even if it's not as good. CDNs are close in terms of providing libraries widely, but they don't have an elegant way to find things and use them.

    Perl is mediocre until you consider CPAN. That's the real joy of using Perl.

  81. I actually like Javascript by MrKaos · · Score: 2
    But with regular expression and string handling that perl has in abundance comparing it with javascript seems odd.

    I was forced to develop javascript and I did not like it. My approach was to apply several design patterns (Fowler/GoF) for the project I worked in and found that it was my thinking that was wrong. I adapted and I am convinced that whilst javascript has a lot of crap surrounding it, the core language is quite good, if you use it properly.

    One of the main hurdles I had, was to consider javascript as a browser event language. After a while, it flowed as nicely as C does. Ironically "Javascript; The good parts" is about the same size as K&R's "The C programming language".

    --
    My ism, it's full of beliefs.
  82. ActionScript by PortHaven · · Score: 1

    It was hear...it was superior and more intelligent than Java in many ways. Strongly typed. And could have been adapated to the HTML DOM if Adobe's CEO had half a brain. Yes, abandon Flash, but ActionScript is actually a nifty language.

    One that 98% of the complainers have never looked at. I think it's funny once a programmer actually starts looking at AS3 and exclaims "wow, that's kind of cool".

    Look what they did with Spark components in Flex. HTML5 went and created all these stupid new input types. AS3/Flex4 went the other way and reduced their input types. What's the difference between a radio button and a drop down? Nothing but presentation. Both are simply selectable lists. Checkboxes and mult-select box? Nothing. They're just a multi-select list. So Adobe went and remove the visual layer from the model and control layers. Now you just "style" the appearance as desired.

    This was the RIGHT PATH to move in Programming. And where HTML5 SHOULD HAVE GONE, but did not.

  83. Re:Web by Remus+Shepherd · · Score: 1

    Correct me if I'm wrong -- I'm not a web developer -- but aren't Perl, Python, and Ruby all run on the server-side? There's a need for client-side implementation, and Javascript is it. (The only alternative I'm aware of is ActiveX, of which the less said the better.)

    --
    Genocide Man -- Life is funny. Death is funnier. Mass murder can be hilarious.
  84. Re:Dinosaurs don't like meteorites by Blrfl · · Score: 1

    This dinosaur feels compelled to remind you, sonny, that all languages suck, including JavaScript.

  85. Re:Perl is evil by Blrfl · · Score: 1

    Do you think anything you just wrote would be anything but cryptic to someone unfamiliar with English?

    "Perl 5 provides word-oriented aliases to all of these variables, if you choose to write COBOL in Perl. Oddly, most folks don't."
                -- Larry Wall on his choice of name for Perl's "$_" variable

  86. Comparing apples with pears?! by freaker_TuC · · Score: 1

    One is client-side, the other is server-side.

    It's not because they both involve coding; they can be compared to eachother.

    --
    --- I am known for the ones who want to find me on the net. Is that a privacy risk or a privilege? One might wonder..
  87. Re:Web by shaitand · · Score: 1

    3 times slower is hardly "on par." I tend to define real world as actual large complex java projects in the real world. So things like OO or Minecraft or any of the other large complex projects put out for public consumption. I can think of java programs where speed didn't get in the way but I can't really think of anything in java that is fast and efficient.

    You:
    "Unlike static compilers JIT compiler can gather runtime information and use it when deciding which branch to prefer etc"

    Me in the post you replied to:

    "there is nothing stopping you from building an application specific tuned bytecode with dynamic optimization in C that will perform as fast or faster than the generic one used by java"

    There are no advantages to a JIT. If you actually have one of the rare use cases where it provides a significant benefit you can build a task specific solution and a parser in you statically compiled language of choice to add a dynamic capability. At the end of the day the JVM is written in a statically compiled language. It is literally impossible for it have any sort of capability that can't be implemented in a statically compiled language.

  88. Re:Web by shaitand · · Score: 1

    What does a JIT VM have to do with anything? But yes, actually there is, or something that gives the same benefits. It's called an interpreter. Internally the Perl 5 interpreter compiles to an intermediate machine independent bytecode which it then executes. You can keep that bytecode and run later just like you do with java. Outside of a few specially crafted research problems designed to show performance increases with JIT there is no reason to desire it anyway.

    There are plenty of major applications written in both Perl and Java. I can't think of the last time I noticed the performance of a Perl app. Java on the other hand is a constant nightmare. Of course there is OO.org but lately I've been playing with Minecraft and Minecraft servers. OMG what a slow memory hog that thing is! There is literally no reason for it to be either. Write the same thing in C and the memory footprint would be megs and not gigs and it would run smoothly on old low end pc's and not just high end ones. I can't think of any instance where I was impressed with the speed of a java app only cases where they didn't get in the way. Another example, look at all things android. What was Google thinking basing it on Java when they have limited cpu and memory resources?

  89. Re: Web by Anonymous Coward · · Score: 1

    JavaScript is the only reason we even *use* the web today. If developers had avoided it en mass for the failed reasoning you've outlined, we would all be using Flash or some other plugin for the majority of our "web" browsing. There is a need for a common client-side scripting language - JavaScript is that language, and you should be bloody grateful it's not something far worse.

    Also, your assertion regarding code quality is simply not true. You have a choice whether to write horrible code or not. If you really believe poor code to be a requirement of JavaScript development, you should avoid programming altogether (perhaps you are not a programmer, in which case I must apologize).

    JavaScript supports the patterns and idioms required by proper application architecture. Perhaps it is not the prettiest language when used correctly, but that doesn't make it inadequate. That makes it ready for a new version (see ECMAScript 5/6).

  90. Re:Web by viperidaenz · · Score: 1

    Bytecode is not executed, it is again interpreted. The only thing a CPU can execute is machine code. That's what a JIT VM does, it turns the bytecode into machine code then executes that and most importantly, saves it for later.

    My last experience with Perl was replacing a network monitoring system written in Perl with Java. The Perl version would fall over when presented with > 2 million events a day. The new Java code handled > 100 million with lower latency. How's that for an anecdote?

    Google was thinking effective sandboxing and excellent tool support. It's easier to sandbox code when it runs in it's own VM. It's also more portable. I guess they picked Java as the language because it has the biggest set of IDE's available and they're quite fond of Eclipse.

    By the way, the Java language and the JVM are only losely coupled. You can compile many languages to run on the JVM, like JRuby, Groovy, Jython, Clojure, Processing and Scala. That's just a small list. You can also compile Java to machine code with the help of GCJ.

    I wouldn't be surprised if Perl dropped Parrot soon now the dynamic language instruction has been added to the JVM, since that was one of their excuses for rolling their own.

  91. Re:Web by shaitand · · Score: 1

    "The only thing a CPU can execute is machine code. That's what a JIT VM does, it turns the bytecode into machine code"

    How is it that you think interpreted code gets executed without turning into the machine code that is the only thing the CPU can understand? Here is a hint. It doesn't. You can compile Perl, using the interpreter, into an intermediate platform independent bytecode that can be saved and executed (aka turned into machine code) on other platforms.

    "My last experience with Perl was replacing a network monitoring system written in Perl with Java. The Perl version would fall over when presented with > 2 million events a day. The new Java code handled > 100 million with lower latency. How's that for an anecdote?"

    I'll raise you anecdotes. My current experience with Perl is a network monitoring system written in Perl. The Perl version is currently handling well over a billion events a day with low latency. I can't speak as to its upper limit.

  92. Re:Web by viperidaenz · · Score: 1

    Have a read of what JIT is

    http://en.wikipedia.org/wiki/Just-in-time_compilation

    A plain old interpreter takes each byte code one at a time and executes code that perform the functions they're supposed to.

    One with JIT analyses the bytecodes that execute a lot and runs them through an optimising compiler
    Some of the many things that happens are:
        Removing code that has no effect
        Reordering instructions
        Converting dynamic method calls to static
        Loop unrolling
        Code in-lining

    That's why some benchmarks can show Java beating C. Because the JIT compiler can optimise the code to the specific hardware it is running on (eg: number and type of CPU's, cache sizes and memory latencies).
    There are certain optimisations that can't be done at compile time. You can't statically link to dynamic methods unless you can undo the static link at runtime if new code is loaded. You can't remove thread synchronisation code unless you know at runtime no other threads could possibly touch a variable and no method that references it can be overridden.

    If you interpret your byte code one at a time, you can't do any of that.

  93. JS sucks. Why not python? by romons · · Score: 1

    Why doesn't somebody port python into a browser as a scripting language? Seems like a much more powerful language, it is easy to read and use, and has reasonable scope rules. This is a no-brainer for a company like Google, that uses python for lots of things already. If chrome was programmable in python (with appropriate security modifications) it would destroy JS in about 20 minutes.

    (Actually, I'd prefer lisp, ala elisp, but that is simply too scary for most people to contemplate, I suppose)

    --
    Go to Heaven for the climate, Hell for the company -- Mark Twain
  94. Re:Whats wrong with JS? by lattyware · · Score: 1

    While it's possible to use JavaScript in a good way, and some of what is there is good, the language itself is a mess of poor design. Something much, much better could give the features that JS gives, without all the horrible design. It's worse than PHP, and that is impressive.

    --
    -- Lattyware (www.lattyware.co.uk)
  95. Re:Whats wrong with JS? by lattyware · · Score: 1

    Everyone makes mistakes, stuff happens you didn't intend, and a good language will either error straight out, or give reasonable, easy to spot results (null in Java, for example), that indicate an error. JS is full of stuff where if you get something wrong, the language just explodes in crazy. That's not helpful, especially given web stuff is annoying to debug at the best of times.

    --
    -- Lattyware (www.lattyware.co.uk)
  96. I agree - I think it's time to reboot the matrix by denismo · · Score: 1

    I agree with the post. Javascript is a difficult language, but makes it a horrible one is not just the language but how its used. It was not designed to be used in web application of the scale which is demanded nowadays, an as any technology/library/architecture which is used beyond what it was designed for, it sucks. It's just broken this way - the way of web applications.

    Many people say it's not broken, people just don't know how to use it. For some, the complexity of the language is not a problem. Similarly, for some the complexity of C++ is a walk in a park, but most agree that not dealing with pointers is progress.

    Ask yourself - if there are no problems in Javascript, why there are dozens of frameworks which look the same - for example, the frameworks which create classes, libraries, and other basic elements of the typical programmers toolbox. The reason for that is that Javascript lacks these things - and also lacks the ability to progress - build more complex things on top of simpler ones. It's designed to be used for writing simple things - like an event handler. And you can see how it is not suitable for other things - by the fact that most of libraries reinvent the same again and again, and there is not much reuse among them. Javascript lacks the basics of modularity.

    If there was nothing wrong with language, why there are GWT, Typescript, Dart? The first and the main reason for coming up with these is to compensate the ugliness of Javascript (and the rest of Web technologies).

    It's being discussed before - you can only patch something for so many times until you hit the limits. Either through code decay (for example, due to backwards compatibility) or mere requirement to patch within the limits - you cannot achieve the same as you would achieve by recreating something from scratch. I don't think Javascript-next is the answer because of this reason, so I also think we need a new set of technologies.

    And I'd like to emphasize that Javascript as language is alright - has pros and cons. Javascript for Web is horrible. An example is Javascript in Node.js, where it is complimented by good modularity and platform integration. And the existence of Node.js only confirms that I stated - it highlights the problems of Javascript on the web.

    On the web , it's also worsened by the HTML (try creating a sizable Java/Swing application with just one class where you are only allowed to use basic elements - text and rectangles - that's analog of DOM and HTML, a technology misused for almost 20 years without modularity and assembler like instructions), and CSS (if there are no problems in CSS - why SASS/LESS? CSS needs modularity and decent tools no less than other technologies).

    So I frankly believe it's time to reboot the matrix - why people are so afraid of new in the web, while they witness so much great invention elsewhere? And I smell conspiracy.

  97. Re:Web by modmans2ndcoming · · Score: 1

    the only thing that prevents perl/python/ruby from being used in client side web programming is the browser makers including the interpreter in their browsers. Since we are talking about what would be nice I decided to mention how much better those languages are than Javascript and Java for client side web programming.

  98. Re:Whats wrong with JS? by rock_climbing_guy · · Score: 1
    By the way, I found this the other day. You might be interested.

    http://stackoverflow.com/questions/9032856

    --
    Wh47 d1d j00 541, 31337 15n't t3h r0xor5 ne m0r3???
  99. Re:Whats wrong with JS? by lattyware · · Score: 1

    I'm not sure what the intention was of the response - but I'm not saying JavaScript isn't deterministic, it's just not a sane set of rules that define what goes on in cases like this - the length of that answer shows how poorly designed the language is. It shouldn't need such explanation.

    --
    -- Lattyware (www.lattyware.co.uk)