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.'"

453 comments

  1. Web by Anonymous Coward · · Score: 0

    Doing pretty good as a web language.

    1. 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.
    2. 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.

    3. 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.

    4. Re:Web by modmans2ndcoming · · Score: 0

      Java has been a security hell for the last two years so...no....bad idea.

    5. Re:Web by modmans2ndcoming · · Score: 2, Insightful

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

    6. 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?

    7. 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?

      --
    8. 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.

    9. 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.

    10. 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...
    11. 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.

    12. 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.
    13. Re:Web by viperidaenz · · Score: 1

      Perl is faster than Java? HotSpot > Parrot. There is no JIT VM for Perl.

    14. Re:Web by viperidaenz · · Score: 1

      I said closest thing, not solution.

    15. 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.

    16. 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.

    17. 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.

    18. Re:Web by 2fuf · · Score: 2

      Try Flash

    19. Re:Web by 2fuf · · Score: 1

      LOL I meant Flex, sorry

    20. Re:Web by Anonymous Coward · · Score: 0

      Because your enterprise apps are poorly written?

    21. 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.
    22. 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.

    23. 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?

    24. 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).

    25. 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.

    26. 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.

    27. 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.

    28. 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.

  2. 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 Anonymous Coward · · Score: 0

      Pretty much this.

      There is a huge update around the corner and that should pretty much be it set for a near versionless future in line with CSS and now HTML, outside of HUGE updates that break execution.

      A few extensions to the language to interact with external programming languages would be pretty damn handy, though.
      Since people are trying to push the whole web as a platform thing, might as well make it easier to allow JS to access external languages through a common API that is very specifically designed for communication and not some generic mess that is current APIs.

      WebGL is bringing the graphics layer there, and Canvas2D for simpler things, possibly Canvas3D, not sure what is happening there, haven't checked that for a while, but I think since WebGL has pretty much got most of those huge problems ironed out, it would be pointless to implement it.
      It would just add extra overheard where it isn't needed, even if it is tiny.

      The rest of the current testing methods are getting there pretty nicely that will make it a pretty competent language for web applications.

      However, the problem is people are terrible at JS, almost nearing levels as bad as the horrible PHP community. (Of course, PHP as a language itself is just broken, so that is a different problem altogether)
      Most people don't even understand the basics of SCOPE in JS, which are trivial, even if a few couple areas of scope are hilariously bad design choices from both prototype and classical areas, but it mostly works and works well at that.
      And with .call and .whatever the hell the other one was called again, it makes dealing with scopes incredibly easy.
      Every site that mentions scope should have these things right at the front to save so much hassle and destruction, they are 2 of the most useful methods in the damn language!

    4. 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.

    5. 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.

    6. 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
    7. 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

    8. 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.
    9. 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.

    10. 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?
    11. 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.

    12. 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...

    13. 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'!"
    14. Re:I don't.. by Anonymous Coward · · Score: 0

      Considering all the people who want to get rid of HTML and replace it with something with much cleaner syntax for starters...

    15. 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.

    16. Re:I don't.. by Anonymous Coward · · Score: 0

      You can do namespaces (sort of) just take a look at http://stackoverflow.com/questions/881515/javascript-namespace-declaration

      1) I agree there are a lot of low skill web programmers, but it's not because they are self taught, I've seen enough CS graduates writing horrible JS to know that. The main problem is that a lot just start writing JavaScript without bothering to learn it, DOM or HTTP or even how to write good code. From what I've seen most CS graduates don't seem to learn that.

      2) It's not just web developers with that mentality sadly but yes this is one of the problems.

      3) As much as I would like pixel perfect rendering and alike any attempt to do so would end up just as bad, if not worse! HTML and CSS _should_ be pixel perfect but lack of conformance causes them not to be. How do you intend to make a replacement to manage any better? It would need to be an open standard so other implementations for new OSs and devices can be made. Which means multiple implementations by various people all of which need to be 100% compatible. I can't see that working some how. In the end you would just be replacing one set of standards that sort of work with another set that might possibly work a bit better or could end up a lot worse.

      4) It's not that bad a language, it's certainly not the best but far from the worst. If you learn it, it isn't hard to write maintainable clean code. Granted most of it out there is just hacked together and only sort of works. Can you blame the language for it being misused? You also need to account for the fact that a lot of them problem is also DOM which currently any language would have to deal with too. That's like declaring C/C#/Java/C++/Python/Perl/PHP/Ruby as terrible because people like putting all their code in one function. It's not the languages fault people misuse it and write a 2000 line function.

      Personally I think the biggest problem is that people can see how bad a lot of JS code is written and assume it must be the language. If you could see how bad a lot of code is in any language you would start to realise it's not the languages fault.

    17. 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.

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

      Perhaps you'll love all this javascript. http://rallyon.com/

    19. 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.

    20. 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.

    21. Re:I don't.. by thetoadwarrior · · Score: 0

      It's worse than perl if only because it lacks namespaces. That and it lacks a CPAN. There are some lib repositories but unfortuantely the average JS lib is of questionable quality. Often you're better off writing your own code.

    22. 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.

    23. Re:I don't.. by Anonymous Coward · · Score: 0

      what about smalltalk ?

    24. 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.

    25. 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.

    26. 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.

    27. 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.

    28. 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.

    29. 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."

    30. 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.

    31. 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
    32. 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.

    33. 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

    34. 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.
    35. 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.

      --
    36. 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.

    37. 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.
    38. 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.
    39. 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.
    40. 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.

    41. 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.

    42. 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.

    43. 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.
    44. Re:I don't.. by Anonymous Coward · · Score: 0

      I give you AC's Rule: "Rules that don't use double negatives aren't too inelegant to catch on"

      TFTFY.

    45. 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.

    46. 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.
    47. Re:I don't.. by Anonymous Coward · · Score: 0

      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),

      You misunderstand what HTML is and what it's for... just like Netscape and Microsoft did.

    48. 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.
    49. 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.

    50. 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.

      --
    51. 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
    52. 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.

    53. 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.

    54. 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?
    55. 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.

    56. 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.

    57. 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.

    58. Re:I don't.. by Anonymous Coward · · Score: 0

      knockout.js + jqueryui (and jquery itself ofcourse)

    59. 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.

    60. 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'!"
    61. Re:I don't.. by Anonymous Coward · · Score: 0

      Your problem is that you're using JQuery.

      What a fantastic waste of resources.

      Here: 99% of your JQuery use without including that POS library: document.QuerySelectorAll()

      You're welcome.

      JQuery just adds bloat and complexity -- it simplifies absolutely nothing. It does not save you time. It does not save you effort. Only idiots use JQuery.

    62. Re:I don't.. by Anonymous Coward · · Score: 0

      NO! Stop!

      Classes in Javascript? OOP is retarded enough -- but to force classed-based OO into a language with prototype-based OO is fucking insane.

      Jesus. You were so good up to that point!

      but if you're writing a project large enough to actually need those sorts of tools,

      Fuck! With a large project you want modularity. OOP is clearly anti-modular! And you fucking advocate using a retarded class-based OO approach abused out of a completely different approach to OO as a way to manage complexity?!

      Christ on a cracker -- have you gone completely mad?

    63. 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.

    64. 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.

    65. 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'
    66. 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'
    67. 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
    68. 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.

    69. 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.

    70. Re:I don't.. by Anonymous Coward · · Score: 0

      The point is, every little AJAX call has to be mapped to an URL.

      But why? How about this, have one, one fcuking URL and send a command object with parameters encoded with JSON or XML to it. In your page(the URL one) you do the processing of your commands and send the response in XML/HTML/JSON/English and thats it. I mean come on man, are you for real?

    71. Re:I don't.. by Anonymous Coward · · Score: 0

      The entire AJAX and framework of web programming is wrong

      How is it wrong, its a safe HTTP socket that you dont need to poll or loop read, you just put your callback function and get your fcuking data. Get it?

    72. 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.

    73. 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?
    74. 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.

    75. 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.
    76. 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
    77. 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!
    78. Re:I don't.. by Anonymous Coward · · Score: 0

      Probably right about that it would be much easier to do this up with Knockout.js and/or datatables.net thats what I did with my MVC projects but just spend some time getting used to the objects being thrown at you in AJAX as they are quite different than most.

    79. 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.

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

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

      --
    81. 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!
    82. 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.

    83. 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.)

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

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

      f();

      alert( x );

    85. 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.

    86. 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.

    87. Re: I don't.. by Anonymous Coward · · Score: 0

      Finally, a comment from someone who actually knows how to write JavaScript.

    88. 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
    89. 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.

    90. Re:I don't.. by Anonymous Coward · · Score: 0

      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.

      Do you care to elaborate on that a bit, what is wrong with using hashes?

    91. 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.

    92. Re: I don't.. by Anonymous Coward · · Score: 0

      You mean finally, a comment from someone who knows and loves the DOM.

    93. 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.

    94. 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.

    95. Re:I don't.. by Anonymous Coward · · Score: 0

      Will - can you spell APL (for write-only languages)? I knew that you could :-)

    96. 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
    97. 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?

    98. Re:I don't.. by Anonymous Coward · · Score: 0

      All your post demonstrates is that you can copy text from the Gordon Ramsay JavaScript Cookbook. Do you have any original thoughts to share?

    99. 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.
    100. Re:I don't.. by dodobh · · Score: 1

      The web is HTTP only, by definition.

      --
      I can throw myself at the ground, and miss.
    101. 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?

    102. Re:I don't.. by Anonymous Coward · · Score: 0

      JQuery just adds bloat and complexity -- it simplifies absolutely nothing. It does not save you time. It does not save you effort. Only idiots use JQuery.

      ...said nobody, ever.

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

    What is this? Slasdot's daily troll story?

    capcha: manure. How appropriate.

  4. 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.
  5. I guess. by Anonymous Coward · · Score: 0

    But neither are suitable bases for enterprise level systems. They are good in small parts, but not the whole.

  6. 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 Anonymous Coward · · Score: 0

      Not to put too fine a point on it, but you're clearly a dunderhead.

    7. 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?
    8. Re:Readability by Anonymous Coward · · Score: 0, Troll

      Not to put too fine a point on it, but you're clearly a mewling little Python fagboi shit who can't stand anything even remotely resembling criticism of your favourite little toy.

    9. 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?
    10. 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.

    11. Re:Readability by Anonymous Coward · · Score: 0

      Nah, Alomex's comment wasn't even really criticism since criticism needs to be true for it to be worth anything. It's simply not believable that anyone who knows the number and variety of languages that Alomex claimed would have any trouble deciphering the gist of some Python code unless it was being intentionally obfuscated.

    12. 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)
    13. 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?
    14. 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.

    15. 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?

    16. Re:Readability by Anonymous Coward · · Score: 0

      So you want AppleScript.

    17. 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.

    18. 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...

    19. Re:Readability by Anonymous Coward · · Score: 0

      For many of us, math is easier to read than human language.

      I call bullshit on that one until you have rewritten that post in math.

    20. Re:Readability by Anonymous Coward · · Score: 0

      That's proof enough that Python is a broken language.

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

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

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

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

    23. Re:Readability by Anonymous Coward · · Score: 0

      We tried this already. It was (is) called COBOL.

      Good luck with that. All computer languages, except perhaps SQL and COBOL, have at their expressive roots algebraic, symbolic, mathematical notation.

      Closest to getting away from that seems to be using Boo to write Domain-Specific Lanaguages (DSLs). But well-factored code seems to achieve that as well, to a point.

      How much does one refactor code to a bunch of functions and procedures that need to be looked up to understand what they do, but said code probably resembles a DSL or more what the OP was trying to present, as opposed to having that code in-line with descriptive comments around it? I guess that's different for each one of us reading and writing the code...

    24. Re:Readability by Anonymous Coward · · Score: 0

      Not PowerShell. Fixed that for you.

      I'm not happy that PowerShell couldn't figure out when '' are redirects vs mathematical symbols. That kind of kills code readability there.

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

      That's quite hard to do without Unicode.

    26. Re:Readability by Anonymous Coward · · Score: 0

      Don't worry, you can use Perl to parse it.

    27. 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

    28. Re:Readability by Anonymous Coward · · Score: 0

      That's an atrocity? Anyone with a little functional programming under his belt should be able to grok that easily enough - especially given that the variable name is "interleaved". I'll admit that the iteration variables inside the comprehension could be named better ("j" should really be called something like "pair" and "i" should be something like "element") but that's about it.

      On a pedantic note: the argument to join() is a generator expression and so it doesn't actually build up an intermediate list - the items are materialized as join() asks for them.

    29. Re:Readability by Anonymous Coward · · Score: 0

      It sounds like you want to program in Smalltalk. It's joy, especially if it is implemented in an Image/VM, but it's a shame how history played out. It reads exactly like a well-formed sentence, complete with semicolons, periods, and nice fluent function calls. IMO, it makes Ruby and others look like a toy, and I've been writing C, C++, Lisp, Python, Ruby, Java, etc. professionally for over 30 years now.

    30. 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.

    31. 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?

    32. 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.

    33. Re:Readability by Anonymous Coward · · Score: 0

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

      That is a very funny thing to say about a language in which everything is an object.

    34. Re:Readability by Anonymous Coward · · Score: 0

      Object-oriented programming was retrofitted into Javascript

      Only if you consider a language not-object-oriented just because it doesn't use classes. Javascript, as far as I know, has always had objects but was designed to use prototypes instead of classes.

    35. Re:Readability by Anonymous Coward · · Score: 0

      Don't confuse precedent-based law with contract law (which is the main use of legalese). They're different systems. The idea behind precedent-based law is that the initial legislation is fairly vague, and the details are filled in are required (lazy evaluation, if you like), and then applied consistently thereafter.

      In contrast, contracts try to cover all eventualities in advance, and should not be open to interpretation. Indeed, there's a general principle that if there is any ambiguity in a contract, it should (usually) be resolved in favour of whoever didn't write it. Legalese is very precise language, and when you consider all its nuances, is far more concise than plain English.

    36. 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.

    37. 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.
    38. Re:Readability by Anonymous Coward · · Score: 0

      The "task" of a programming language is surely to facilitate a human to tell a computer what to do (otherwise instruct them in native machine code). It seems perfectly reasonable to me that it should be possible to come up with a language that bridges this divide effectively, reducing errors and easing maintainability while still producing efficient machine code.

    39. Re:Readability by Anonymous Coward · · Score: 0

      Object-oriented programming was retrofitted into Javascript

      No, it wasn't. You're just trying to force class-based OO in to a Prototype-based langauge.

      That's not OOP being "retrofitted" into javascript -- that's you being a total retard.

      OOP is a bad idea anyway. We have decades of research to support this. Don't be retarded. Learn what modular programming really means and why OOP -- particularly class-based OOP -- is decidedly anti-modular.

      You'd think that developers wouldn't be this stupid, but here they are...

    40. 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)
    41. Re:Readability by lattyware · · Score: 1

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

      --
      -- Lattyware (www.lattyware.co.uk)
    42. 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'
    43. Re:Readability by Anonymous Coward · · Score: 0

      Same AC here --

      Thank you for the Python code in question.

      In the last line, did you mean to write interleaved.write(item)? If not, what exactly is data?

      I completely and fully agree what you've written is significantly easier to understand in comparison, although I've never heard of the itertools module (possibly the author of the previous code hadn't either). Not loading the entire contents into memory (for working with large files) = huge plus, barring the I/O trade-off. Sounds akin to when I see folks new to Perl doing things like $foo = <FH>, or worse, @foo = <FH> (obligatory Dilbert for that one.

      The with statement in Python looks, well... bizarre. I had to read this to understand it. My own opinion is that it looks lazy -- I guess to me this stems from the strong belief (based in my experience with assembly and C) that when it comes to resources you clean up after yourself; if you open a file, close the fd when done; if you malloc(), free() when you're done. Yes, I admit with can/will do this for you, but if you ask me all it's doing is forcing the programmer to write __enter__ and __exit__ methods, which to me are completely 100% akin to constructors and destructors. I'm really against object-oriented anything, so you'll have to excuse my annoyance I guess. :-)

      Here's a question: how exactly did you know that with would actually close the fds associated with even/odd/interleaved? I don't see that implied anywhere.

    44. 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
    45. Re:Readability by Anonymous Coward · · Score: 0

      I'll never understand why people complain about things that they themselves admit to not knowing enough about.

      He knew the with would close the file objects because it's a common python idiom. It's not really unique (see C#'s using statement). As to your belief about resources - they are being cleaned up in a deterministic fashion. It's just that the programmer doesn't have to explicitly type out the call to close. It's really not the horror that you make it out to be. It just saves the programmer some typing. Plus, the try/finally ensures that resource cleanup is done in case of an exception.

      Also, __enter__ and __exit__ are not constructors/destructors. They are simply hooks for attaching some code to run. Python has constructors and, after the with, the variables are out of scope but still waiting to be collected by the GC so those special methods have nothing to do with the lifetime of the file objects - just the resources that they own.

    46. 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)
    47. 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.
    48. Re:Readability by Anonymous Coward · · Score: 0

      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.

      So the language is easy for a non-programmer to get into, but not for someone with years of actual experience. Not exactly a selling point to neither hobbyists nor professionals (or companies)

    49. Re:Readability by Anonymous Coward · · Score: 0

      Perhaps you mean "precise" instead of "concise".

    50. 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)
    51. Re:Readability by lattyware · · Score: 1

      You say broken, I say fixed.

      --
      -- Lattyware (www.lattyware.co.uk)
    52. Re:Readability by Anonymous Coward · · Score: 0

      What is writing .NET? .NET is a platform for a lot of languages that don't look very similiar (C# / F# / VB.NET / Boo / Nemerle / ...).

    53. Re:Readability by Anonymous Coward · · Score: 0

      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.

      Ah! but that language already exist! It's called COBOL. ;-)

    54. Re:Readability by Anonymous Coward · · Score: 0

      That's a hardware problem

    55. Re:Readability by Anonymous Coward · · Score: 0

      You know what is more amusing? People hinging the consistency of coding practice on fallable human beings!

      Instead, the tools they use should limit or eliminate altogether the ability to break good practice - particularly in environments where multiple people will have to touch said code over its lifetime.

      This is why I abandoned Perl over Python long ago. While not perfect, there is generally only one way to do a given thing at a primitive level in python - not so in perl. The magic here for me was I found I could do everything I needed to do - without having to remember as much extraneous cruft, and lo and behold: I can read and understand the code created by others.

    56. Re:Readability by Anonymous Coward · · Score: 0

      In this example, itertools.izip() should probably be used instead of zip(), otherwise all of even and odd will be consumed into memory at once.

    57. Re:Readability by Anonymous Coward · · Score: 0

      OK, hard to know where to begin.

      BASIC is a hideous language, it is NOT easy to read and positively encourages spaghetti code. Dijkstra once said that teaching BASIC "should be a capital offence".

      Sounds as if you'd be happiest writing COBOL, which was supposed to be English-like.

      As to "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." this is only true for imperative languages, it is certainly not true for functional languages, which you seem not to understand.

      I really don't think that the world's language designers are judging languages by whether or not YOU can understand them

    58. 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)
    59. Re:Readability by Anonymous Coward · · Score: 0

      Bad Python would be like anything else, bad. I'd argue it has genetic predisposition to encourage good style, but maybe I just drank the koolaid.

      Perl is a messy hall closet of a language. I'll never understand the brilliance behind self-transmogrifying variables like $_, as opposed to encapsulating processes in per-instance variables. Or at least automatic, per-call variables. Icky, and self-encrypting, those pesky $-whatever variables in Perl.

      I've never messed with Javascript, but Java is a heartbreaker. So many unnecessary hurdles in learning. For instance, create a jar in Netbeans. You will find no documentation how to import it into your other classes, just the cheery promise that if you correctly import it, you can use it. I know the secret, but I respect Java's privacy. I'll never tell. :-)

  7. 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 Anonymous Coward · · Score: 0

      The use of Javascript, HTML, CSS and a web browser as development enviroment or runtime environment sucks big monkeyballs. This environment has been chosen
      de facto because no client framework is standard, and not because of technical excellence. And that is the modern tragedy in IT. Now Javascript is the big revelation when the f'ing truth is that it sucks big monekeyballs (again) and has been so for a long time now.

      I can't wait for the replacement of such horrendous monster of a platform.

    3. Re:A bit late for this. by Anonymous Coward · · Score: 0

      Keep waiting, but I wouldn't hold your breath. Web based tech isn't going anywhere and there isn't any solution that even purports to compete with js. Maybe its time to let go of your old ideas and get with the times.

    4. 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

    5. 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.

    6. 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.

    7. 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.

    8. 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
    9. 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.

    10. 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.

    11. 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
    12. 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.

    13. Re:A bit late for this. by Anonymous Coward · · Score: 0

      since you seem to have defined anti-pattern as "things you don't like" congratulations on discovering the tautology!

      clap yourself on the back! good work! maybe give yourself an angry handjob later. you've earned it.

  8. 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 Anonymous Coward · · Score: 0

      I did some JS back in college and it was the first language to make me yearn for the days of GOTO hell that was BASIC. It's gotten a little bit better now, but to make up for that, you've got dependency hell where you're pulling in scripts from god knows where and pretending like you have any control over the results.

      Perl has it's issues, but it's hardly the horror that people think it is. Any language can be written in an illegible way, it's just that some are more apt than others to give good results when writing bad code.

    5. Re:Very Different by Anonymous Coward · · Score: 0

      Perl has it's issues, but it's hardly the horror that people think it is.

      No-one thinks Perl is a horror. Some people delusionally believe that it is, but such an idea is far too distant from reality to be called a "thought".

    6. 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)

    7. Re:Very Different by Anonymous Coward · · Score: 0

      I know what you mean. I also prefer to bury all memory of perl in the darkest corner of my mind.

    8. Re:Very Different by Anonymous Coward · · Score: 0

      When Google feels they need to spend resources on a javascript replacement, you know something is wrong with the language.

      Javascript has a lot of awful bits that are hard to avoid. This results in a all kinds of crazy workarounds for language defects. Try copying an object, for example. http://stackoverflow.com/questions/728360/copying-an-object-in-javascript

    9. 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.

  9. 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 Anonymous Coward · · Score: 0

      Need enterprise apps? ExtJS. Problem solved.

    4. 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".

    5. 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....

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

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

      --
      http://soylentnews.org/~tibman
    7. 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.

    8. Re:Lacking enterprise adoption? by Anonymous Coward · · Score: 0

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

      Yet, his point is still valid, even if he got the language wrong. I'm not sure what the submitter or editors were thinking. Perl lacks enterprise adoption in large applications? Seriously?

    9. Re:Lacking enterprise adoption? by Anonymous Coward · · Score: 0

      Yeah. Kronos is a piece of crap and I want my money back since you can't give me my time back.

    10. Re:Lacking enterprise adoption? by Anonymous Coward · · Score: 0

      You really should, since you don't know the difference between Java and JavaScript.

    11. 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.

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

      ... script. Java is very important-

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

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

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

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

    15. Re:Lacking enterprise adoption? by Anonymous Coward · · Score: 0

      http://venturebeat.com/2011/08/16/linkedin-node/

  10. 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 Anonymous Coward · · Score: 0

      i would agree with you if the webpage remained static. but the problem is that these days people want to design dropdowns/swipe navigation/etc using HTML/CSS in order to mimic computer applications. so you have to resort to doing things like writing javascript to loop for x amount of iterations to move a div x pixels to the left, or to fade in/out a div, etc. i doutb javsacript and html/css were originally designed to be used in this way.

      at my current job i have to implement a "swipe" interface using javascript, because people want to "swipe" at links in HTML like they do on tablet applications. it feels so hackish to do so and the code is ugly because the idea is stupid. you cant write beautiful code if the idea sucks. and building user interfaces in HTML/CSS/Javascript sucks.

    3. 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.

    4. 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.
    5. 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.

    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.

      --
      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 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'
    8. Re:The web is just too successful by Anonymous Coward · · Score: 0

      Please expound a little on your methodology here; photoshop -> html/css.

    9. Re:The web is just too successful by Anonymous Coward · · Score: 0

      These sorts of things have been added to various browsers over the last few years, actually. You just don't hear about them much, because web devs can't just target the latest browser versions. So they invent compass to solve the problem for platforms they support, while the latest browsers generally have the features they are looking for already.

      In fact, if more web-devs actually knew their craft well enough to keep on top of even last year's browser versions, they would be stunned at what they can do with modern CSS, let alone the rest of the web stack.

    10. Re:The web is just too successful by Anonymous Coward · · Score: 0

      Interesting part between *'s and bold:

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

      Frickin' ROFL.

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

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

    12. 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.
  11. Atwood's Law by blutfink · · Score: 2

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

  12. 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 Anonymous Coward · · Score: 0

      Python was easy to read 15 years ago. With the addition of all the new language features, almost none of which fit within the OOP paradigm, modern Python is a PITA.

      I'm a principal engineer at a sizable company. Daily I code in C, Perl, shell, Lua, and several other languages. Modern Python is just plain horrible to me, and I try to stay away from it. This isn't a defense of those other languages, just that I'm not inclined to go down the Python hole like I did with some of those others. (Lua, OTOH, is just amazing, thank you very much. The maintainers have resisted adding certain features specifically because they couldn't be done elegantly.)

      If Python doesn't look bad to you, then either you're not using it right, or you are using it right. Either way, you're not using some of the newer, more powerful semantics that most other languages expose much more elegantly.

      That said, if you regularly code Python, then you see past all the cruft. Just like a regular Perl programmer can look at horrendous Perl code and actually be inclined to defend it. I look at M4 or Make code and see beauty; most others just want to barf.

    6. Re:Modem noise by Anonymous Coward · · Score: 0

      Only if you are dutch

    7. 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.

    8. 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

    9. 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?

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

      That was my point. You missed it.

      --
      http://www.rootstrikers.org/
    11. Re:Modem noise by Anonymous Coward · · Score: 0

      Yeah, if I need to operate on large data sets and I'm pressed for time I turn to Perl before anything else.

    12. Re:Modem noise by Anonymous Coward · · Score: 0

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

      Python Closures simply can't be defended. They're a nasty hack. Even Perl got closures right, although the implementation had GC bugs for the better part of a decade.

      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.

      "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.

      Basically, when you see a class with a huge number of long, overly descriptive method names, you know the interface is a giant fail. You tend to see such things when complex semantics are shoe horned into the OOP box. Likewise when you need to adorn function calls, you violate the spirit of having first class functions.

    13. Re:Modem noise by Anonymous Coward · · Score: 0

      I'd argue Smalltalk looks a lot nicer as do various fringe languages I've seen. Python list comprehensions are sometimes near unreadable and I am someone that currently works in Python (also Java and C++) every day in my job.

      Honestly, Python isn't so bad to read sometimes, but the "we're all responsible adults" paradigm doesn't work at all. The standard library is incredibly inconsistent and looks like trash at times if you read the source. And even basic things are ugly as hell, for example call to a super class method:

      class Foo(Bar):
              def baz(self, arg):
                      return super(Foo, self).baz(arg)

      How is that elegant? Even Java isn't that messy looking with that kind of call.

      I feel like like Python is shell script with some nicer libs and syntax bolted on. The object oriented features are a joke. The module system makes people start creating code like visual basic. Before you say they don't know Python, I see code from Guido like this too.

      I prefer working in Python to many other languages at times, but it constantly has this feel that the author thinks he is a genius and then when people actually use what he wrote, he is constantly having to argue with them or change things. The fact Python 3 and 2 have undergone so many changes is enough evidence for me that the language is designed by an amateur, sorry. The object oriented stuff is laughable.

      Mostly, I feel the people who love Python usually come from something like PHP or Java and have never used a useful dynamic language. They are wowed by functional collection manipulation and replacing methods at runtime. The same is usually true of Ruby people. While both Ruby and Python are nice in many senses, they are both messes overall. Smalltalk also has its problems like any other language, but it's funny how much cleaner and more elegant the lower level features are despite that there are so few "built-in" parts of the language. Simplicity is sometimes power, especially when your standard lib isn't a disaster (I'm looking at you Python).

      Python - Here's a bunch of cool stuff that I slapped into one language, but it doesn't really fit together and makes excuses for things it can't do or messes that it creates.

      Ruby - I'm so awesome, but I learned nothing about language design from all the other languages I am trying to imitate. I can do a lot of cool things, and yet some very core things are a giant wtf. I also have to have so many parts of myself written in another language because I can't express myself in myself.

      PHP - Hey dude. I just learned this coding stuff.

      Lisp - I'm awesome if you can read me and love math.

      JavaScript - I hit you because I love you baby. No one understands me properly.

      Haskell - I rule, only no one knows I do because I live in my mom's basement.

      Smalltalk - I have a huge beard and I'm still waiting for someone in the corner to come play with me again. But I'll probably just be greedy and screw it up again.

      Ok I'm bored :)

    14. Re:Modem noise by Anonymous Coward · · Score: 0

      You might want to check http://nimrod-code.org, better than Python, just as pretty (or more).

    15. Re:Modem noise by Anonymous Coward · · Score: 0

      How in the hell does well structured code "look even worse." You have to WORK really hard to make python code look anything close as cryptic as good perl code, let alone make it look "worse." Troll much? Its more scary it was moderated up.

      I think the trolls have trolled the troll out of us.

      You post typifies why slashdot is generally considered a garbage site for user comments these days.

    16. Re:Modem noise by Anonymous Coward · · Score: 0

      What looks bad in Python is obviously what one can't see

    17. 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.

    18. Re:Modem noise by Anonymous Coward · · Score: 0

      > Visually, it's probably the most elegant-looking language there is.
      Sure, it looks good for "Hello, world!" program. But for complex design patterns/regex/functional programming/etc it is just awful.

    19. 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.

    20. Re:Modem noise by Anonymous Coward · · Score: 0

      Are you talking about using whitespace between sections of code? I checked out a random sampling of files from the first five Python projects on github, and all of them were clear and easy to read, with reasonable spacing between functions and even within functions.

      Python enthusiasts at least seem dedicated to writing clear code, what projects have you been looking at?

    21. Re:Modem noise by Anonymous Coward · · Score: 0

      "Yah. And Perl still looks like modem noise. Python is even worse."

      You have actually SEEN python have you?

      Unbelievable.

  13. 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 Anonymous Coward · · Score: 0

      I dunno. I see lots of %.js type projects on GitHub. A trivial search yielded 132,255 repositories.

      A similar search on Perl projects generated less thank half the results. Of course the Perl projects might be hosted in other places, but the avalanche of libraries, plugins and the like is the most exciting thing about both languages.

    6. 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.
    7. 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.

    8. Re:Baxter Doesn't Know What He's Talking About by Anonymous Coward · · Score: 0

      Quantity is, definitively, not the same as QUALITY.

    9. Re:Baxter Doesn't Know What He's Talking About by Anonymous Coward · · Score: 0

      Surely you're kidding about Node.js. Node.js a quirky little experiment, of no value whatsoever so far in real systems.

    10. 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'
    11. Re:Baxter Doesn't Know What He's Talking About by Anonymous Coward · · Score: 0

      > Hey lets just take all of this javascript structure shit and...ya know fuck it just call eval().

      Yes, calling eval is what a stupid idiot like you would do. Everyone who has only a little bit of knowledge (so not you) knows why you don't do that.

      So STFU.

  14. Troll! by Anonymous Coward · · Score: 0

    Blatent Troll!

  15. 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 Anonymous Coward · · Score: 0

      he clearly didn't LITERALLY mean "all". it's called colloquial speech. the rest of us understood what he meant. sorry you were busy being too pedantic to understand how human speech works.

      fucking nerds.

    3. 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.

    4. 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 ?
    5. Re:Also by Anonymous Coward · · Score: 0

      right, but he was using hyperbole in a very common manner - hence, colloquial speech. everyone knew what he meant. you attempting to call out his (obvious) hyperbole was just you being a pedantic, insufferable nerd.

    6. 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@+?

    7. 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.

  16. 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
  17. 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 Anonymous Coward · · Score: 0

      They probably think "advent" means "before they were born".

    3. Re:Indeed. by infidel_heathen · · Score: 1

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

    4. 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.
    5. 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.

  18. 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. =)

    2. Re:Adoption by Anonymous Coward · · Score: 0

      Google, Facebook and YouTube are not enterprise apps. They are toys used to convey advertisements.

      They have some fantastic enterprisey backend work, but at the end of the day their prime UI functionality is:

      1.) a list of search items
      2.) message boards
      3.) A video player (for which most people still experience in Flash)
      4.) Games (Flash, not HTML/JS)

    3. Re:Adoption by Anonymous Coward · · Score: 0

      I pretty sure what google really wants is native client support. That would make life a lot easier for everyone. You could for instance throw HTML and JS out the window if you wanted to. That would free web programming from the poorly designed languages and tools presently available. Dubious it's going to catch on, because you'd need at least one other browser to adopt it.

    4. Re:Adoption by Anonymous Coward · · Score: 0

      DART besides being a "super" language(I dont know why the fuck they needed to reinvent C++) can be interpreted as Google's attempt to Microsoft the web as in (VBScript, HTC etc)

  19. JavaScript isn't that bad by Anonymous Coward · · Score: 0

    No really, it isn't. Yes, there are a few bad bits to the language but nearly all languages have some bits you don't like. Just look at C++, C, C#, PHP, Python, Java and the rest, they all have bits that some people really hate.

    As for JS being ugly, it's very easy to write good clean JS code. Yes, there is a lot of bad code out there but JS is where a lot of people learn to write code so what do you expect. Personally I think it's a truly terrible languages for learning because unless you know how to write code, you will end up with a mess that looks crap.

  20. 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.

    2. Re:With respect... by Anonymous Coward · · Score: 0

      I use and love both of them in a different manner.

    3. Re:With respect... by Anonymous Coward · · Score: 0

      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. ]

      Javascript - the Dan Quayle of scripting languages. ;-)

  21. 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?

  22. 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...
  23. 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
  24. A miss understood language by Anonymous Coward · · Score: 0

    I find the JavaScript is a very miss-understood language. Because it uses C type syntax, people think it should behave like a C type language. Where as it's roots come from the functional language Scheme, rather than the procedural languages like C that most people learn to program in. Because of this most people when they first come to it try and code procedural and make a complete hash of things and then write the language off.

    The authors argument about namespacing is a case in point. Use Closures properly and it's not really an issue. As for lazy programming that's possible in all runtime languages. Use JSHint to slap you when yo start falling in to such practices.

    Whist C syntax is welcoming to people coming from C and Java, I think retrospect it was a mistake, as it give the wrong impression to what type of language it is and makes it harder to find the true potential of the language, as our instincts tell us we should be able to code like we're using Java.

  25. 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 Anonymous Coward · · Score: 0

      And Ruby has a bunch of strange Ruby specific syntax too. If I utilize that is Ruby an unreadable language?

    3. 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?
    4. 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?

    5. 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}) ;

    6. 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.

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

      I have never written a line of perl, nor read any significant amount of it. I'm going to take a stab at reading it, and you can tell me how wrong I am.

      @s is the result of sorting @a with a custom comparator. I assume $a and $b are the parameters, though I don't see where they are declared (does Perl automatically define $a through $z, like a shell script does with $0 through $9?).

      I'm not sure of the significance of the my(), but I assume those are local variable definitions, and the latter part of the assignment is obviously a regex, so this is probably extracting consecutive digits from the parameters (i.e. stripping off whitespace or alpha chars). This makes sense for passing to sin() shortly (I guess perl does implicit conversions at the drop of a hat).

      The next bit seems wrong, but I'm going to assume you didn't escape entities like < and >, so there are comparisons going on there - comparing the sin of the numbers (or their squares when the sin values are equal) to sort the values.

      I agree that none of that is readable to complete beginner, but if I'm not too far off, then it's somewhat readable to a programmer familiar with other languages.

    8. 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.

    9. 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
    10. Re:Coming from a PERL guy by Anonymous Coward · · Score: 1

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

    11. 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).

    12. 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.
    13. 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.

    14. 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.

    15. 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
  26. totally made up grammer, or what... by Anonymous Coward · · Score: 0

    "I'd akin this to"

    Really, it take your active intervention tion make something akin to something else. I don't think it works that way.

    1. 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.
  27. Properly understanding javascript.. by joss · · Score: 5, Funny

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

    --
    http://rareformnewmedia.com/
    1. Re:Properly understanding javascript.. by Anonymous Coward · · Score: 0

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

      +1 Insightful

    2. Re:Properly understanding javascript.. by Anonymous Coward · · Score: 0

      You mean clojure?

  28. 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.

  29. Dinosaurs don't like meteorites by Anonymous Coward · · Score: 0

    I'm amazed by the comments burning js as a viable language. Sure it's different, sure it's dynamic, it might be difficult for you dinosaurs to learn, but face facts here. Web based tech isn't going anywhere. There isn't another browers scripting language like js, and believe it or not, if you took the time to grok the language you might realize just how much you can do with it.

    There are MVC frameworks which allow js to create robust applications (such as backbone) which can then be delivered straight to the client in realtime. For the end user, this is far superior than downloading and installing software, which must then be updated if revisions are made.

    I understand it might be a different world for the programmers who want everything to be written in C++ and assembly, but there is a generational shift taking place, one which will most certainly embrace browser based apps. Get with the times, or get with the wanted pages.

    I'm a js developer, and I can say, while you might be correct in assuming that js can be unmaintainable, that has so much more to do with the developer than it does with the language. Don't judge a scripting language by your ignorance of it.

    1. Re:Dinosaurs don't like meteorites by Blrfl · · Score: 1

      This dinosaur feels compelled to remind you, sonny, that all languages suck, including JavaScript.

  30. Whats wrong with JS? by Anonymous Coward · · Score: 0

    Ok. I'm not a huge JS user (though I do use it sometimes). Whats wrong with the language? All I read here is that it sucks, but not why it sucks. TFA say a little about not liking how scope is handled but that's the only concrete complaint I've seen. Can some one list common /concrete/ complaints? I'm curious.

    1. 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)
    2. Re:Whats wrong with JS? by Anonymous Coward · · Score: 0

      interesting. I must say that in my limited experience I have had weird things happen to me in javascript. like array indexes suddenly becoming strings ("1" "2" ...). But I found that JS became much more predictable once I learned a little more about what was going on in terms of how types were represented and what types were actually available. (this short page explains a lot I think: http://javascript.crockford.com/survey.html)

    3. 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.
    4. Re:Whats wrong with JS? by lattyware · · Score: 1

      I laugh every time without fail - extremely funny.

      --
      -- Lattyware (www.lattyware.co.uk)
    5. 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.
    6. 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???
    7. 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)
    8. 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)
    9. 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???
    10. 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)
  31. 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.

  32. 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 Anonymous Coward · · Score: 0

      http://en.wikipedia.org/wiki/V8_(JavaScript_engine)
      "V8 compiles JavaScript to native machine code (IA-32, x86-64, ARM, or MIPS CPUs)[3][6] before executing it, instead of more traditional techniques such as executing bytecode or interpreting it."

      This is not proof but it could explain why a modern JS engine out performs a JVM if it is in fact true.

    3. 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?

    4. 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
    5. 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.

    6. Re:Why is it always cool to bash Javascript?!?!? by Anonymous Coward · · Score: 0

      That's not how I would characterize greatness.

      Thats the problem, Javascript is not trying to be great, its getting the job done. It CAN be elegant, its hard when you are coming in with preconceived notions.

  33. Bad/Good JS by Anonymous Coward · · Score: 0

    Which parts are good in Javascript (and should be kept) and which parts are bad (and should be changed or removed) ?

    Anyway from ECMAScript[Wikipedia ] Version 6:

    Harmony Work in progress. Version 6 is rumored to have support for classes, a concept long supported by languages like Java, C++ and C#, in addition to multiple new concepts and language features.

    Features under discussion

    Features under discussion for a future edition (originally "ECMAScript 4"; now ECMAScript Harmony) include:

                    Classes
                    A module system
                    Optional type annotations and static typing, probably using a structural type system
                    Generators and iterators
                    Destructuring assignment
                    Algebraic data types

  34. 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
  35. 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?
  36. We are verbing adjectives now? by Anonymous Coward · · Score: 0

    "However, I'd akin this to people discovering Perl during the advent of C and C++ (mirror)."

    Was that really necessary?

    1. 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".

    2. Re:We are verbing adjectives now? by Anonymous Coward · · Score: 0

      Adjective verbing was cromulentized a long time ago.

  37. 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.

    3. Re: How many javascript developers does it take? by Anonymous Coward · · Score: 0

      You posted a syntax error.

  38. 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.

  39. 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.

  40. 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.

  41. 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"?
  42. To those that think Perl is a write-only language. by Anonymous Coward · · Score: 0

    If you think Perl is write-only, you're an idiot and/or a bad programmer.

  43. 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 Anonymous Coward · · Score: 0

      Pretty sure the extra maps were to accomplish a Schwartzian transform - a sorting optimization when custom key computations are expensive.

    4. Re:Really? Ok lets do some transforming... by Anonymous Coward · · Score: 0

      Stop trolling, please.

      # ruby
      new_list = old_list.sort_by {|file| file.mtime }
       
      # so your ruby code has a file object that has the mtime method.
      # if we had a similar object in perl, we'd have this:
       
      # perl
      @new_list = sort { $a->mtime <=> $b->mtime } @old_list;

      The only thing justifying your silliness is that Ruby's Enumerable#sort_by does a built-in Schwartzian transform (which is a well-known idiom in Perl-land, like Lisp's decorate-sort-undecorate). This particular piece of code is inefficient without it.

    5. 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.

  44. 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?

  45. 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

  46. 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.

  47. 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 Anonymous Coward · · Score: 0

      If you want namespaces, then why not use them? There's no need to make names collide.
      If you like Java-style OOP, you can do it with functions: http://jsfiddle.net/EWvMW/1/
      You can also work with closures to protect your scope, or modify protoypes to add functions to objects.
      You can even assign anonymous objects to variables to keep that entire scope within a single variable.

      Want extensions? Assign your entire library to a single variable like jQuery does.

      I don't see why people think JS is so incapable of namespaces. If I missed something, could someone enlighten me?

    2. 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).

  48. lol it did it again. left arrow equals right arrow by CaptnCrud · · Score: 0

    Wow.

  49. JavaScript is a pure language by Sla$hPot · · Score: 0

    I'm not gonna waste my "perma-terrible-modded-down-two-submits-per-day" and add anything more to that.
    Except that most people that can only diss JavaScript, don't know how to program or think for that matter.
    Often the n00b's will compare JavaScript to type safe languages like Java and C# using lame arguments about structured programming, unit testing etc. which is absolutely ridiculous.
    It is a client side scripting language but also a prototype based and object oriented language that is meant to handle user events, work on the html dom and perform some business logic.
    The fact that it can actually do a lot of business processing on the client side and do it in a stable manner as well, is just starting to get recognized and embraced in various cloud solutions.
    I believe that a lot of those who diss JavaScript feel that they have to prove something. Perhaps they learned how to master structured programming, making lots of rigid code based on interfaces and dependency injection so they can live in a predictable world, where they can unit test everything from the data layer all the way out to the client side.
    Often they go that way because they are not very good at solving real life issues, but will rather, blindly follow well proven design patterns, because that is where the light is, so that is where we are going to spend our time looking for a solution.
    JavaScript is a simple client side language. And that is why it so successful. Because it does not try to blend with both your Episerver, Websphere or .Net backend at the same time.
    It's the other way around. If you want a nice front end you need to talk to JavaScript.
    If you need a stable, scalable, high performance backend system use C#, Java, C++ or do what ever the fuck you wanna do!
    Of cause you could also use node.js on the back end and throw in a few extra server blades in the rack :-P

    1. Re:JavaScript is a pure language by Anonymous Coward · · Score: 0

      Why was this modded down?

    2. Re:JavaScript is a pure language by Anonymous Coward · · Score: 0

      While I don't agree with the inflammatory comment at the top, the rest of this is spot-on.

      Shame it got downmodded. I suppose anything that mentions JavaScript in this light will be the subject of hate.

  50. Perl is evil by Anonymous Coward · · Score: 0

    Even written by very skilled programmers who follow good programing conventions, anything written in Perl becomes a maintenance nightmare ... even to the original developer who wrote it.

    This is why Perl is frown upon in the enterprise. While a small script may be acceptable, anything beyond a page soon becomes a nightmare to maintain ... thanks to the cryptic format of the language.

    1. 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

  51. 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
  52. Why not Python by Anonymous Coward · · Score: 0

    I think Python is much closer to be the new Perl than Javascript is... You can't do much with javascript unless you have an 'Engine' with lot of different library included in them.

    Python is much more modular like Perl is and I think a great replacement.

    Only issue Python has in my book is no support for {} insted of tab... I wish they supported both.

    1. 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.

  53. 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.

  54. Here we go again... by Anonymous Coward · · Score: 0

    Do these articles / posts ever have any purpose other than inflaming peoples' perspectives about other peoples' programming languages of choice?

    "This language sucks because of A, B, and C." ...
    "No, your language sucks because of X, Y, and Z."

    Even despite the fact that millions of websites all use JavaScript during every second of every day, you still have the most whining little babies puckering their lips about how horrible it is... I can only imagine how difficult it must be to work with these types of people...

    (Now watch one of the little bastards creep out from his rock to cry about my comment with some witty blather...)

  55. 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!

  56. Re:To those that think Perl is a write-only langua by Anonymous Coward · · Score: 0

    If you think perl is good for anything but 20-line shell scripts that get executed once then deleted, you're not even a bad programmer.

  57. 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
  58. 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.

  59. 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?

  60. 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
  61. 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.

  62. Readability for Computers by Anonymous Coward · · Score: 0

    COBOL's "English" really wrote out Machine Language instructions.
    The math "sentences" turned into Assembler commands directly, without any real grammar work.
    The later COMPUTE command required real order-of-operations processing like FORTRAN had.

    COBOL:
    MULTIPLY A BY B GIVING C.

    Assembler Pseud-code:
    load address A into register R1.
    multiply R1 by address B.
    store R1 into C.

  63. Re:To those that think Perl is a write-only langua by Anonymous Coward · · Score: 0

    Writing good code means encoding enough contextual info (e.g. comments, documentation) to adequately assist competent readers in quickly understanding its functionality & intent. This may even mean using common language syntax only, and avoiding use of special perl-only features that might throw off a non-perl programmer.

    Perl simply gives you lots of tools and enforces no standards. It assumes the programmer will decide the level of rigor necessary for each project.

    Naturally there are lots of poor-quality perl programmers out there, and lots of poor-quality code, but that in no way detracts from the power and flexibility of the language.

  64. 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!

  65. 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
  66. 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.

  67. 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.

  68. The 1990s called by Morpeth · · Score: 1

    ...they want their headline back.

    --

    'The unexamined life is not worth living' - Socrates
  69. And here I thought it was the new Beatles. by laxr5rs · · Score: 1

    Darn.

  70. Re:To those that think Perl is a write-only langua by Anonymous Coward · · Score: 0

    If you think perl is good for anything but 20-line shell scripts that get executed once then deleted, you're not even a bad programmer.

    That could be one of the most moronic things I've heard today. Nice troll!

  71. Hey! by Anonymous Coward · · Score: 1

    May I quote you on my sig, Sir?

    1. Re:Hey! by ralphbecket · · Score: 1

      Be my guest :-)

  72. 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.
  73. JavaScript is wonderful for exploits by Anonymous Coward · · Score: 0

    Because all of you lusers have your browser running all my JS.

    Get informed http://noscript.net/

  74. Try Ruby! (not Rails, Ruby!) by Anonymous Coward · · Score: 0

    You would get a kick out of Ruby I guess. It's very expressive, yet easy to read.

    BASIC is not very readable from a poweruser perspective. Contains too many words and symbols for the most basic functionality, and becomes horrible (VB) when doing expressive stuff.

  75. 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.

  76. LCDR by Anonymous Coward · · Score: 0

    Low-contrast, didn't read.

    Fuck low contrast sites, and the content on them.

  77. 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.

  78. malwarescript by Anonymous Coward · · Score: 0

    Javascript: Malware buddy edition

  79. 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.
  80. 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.

  81. 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..
  82. We lost the next generation of javascript by Anonymous Coward · · Score: 0

    It was called Actionscript and it is what Javascript needs to evolve into.

    1. Re:We lost the next generation of javascript by Anonymous Coward · · Score: 0

      ActionScript is alive and well!

  83. For Sure by Anonymous Coward · · Score: 0

    Adoption must be what makes a language great. That makes sense.

  84. Baxter Has The Language Skills of a Chimp by Anonymous Coward · · Score: 0

    I don't know whether he's trolling or not, but I clicked TFBlogpost and I couldn't get through more than a paragraph or two before giving up. If you thought the clumsy verbing of "akin" copy/pasted into the slashdot summary was bad, you ain't seen nothin' yet.

    If this guy writes code like he writes English, I pity anyone who has to work with him. He seems to be incapable of constructing sentences which mean what he intends to say. (Or which have any comprehensible meaning at all.)

  85. 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
  86. 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.

  87. troll? by Anonymous Coward · · Score: 0

    Dude are you kidding? Newer languages looking like math is a GOOD THING. That's what makes programs even remotely capable of handling complex tasks.

    Math is highly intuitive, once you get past middle school. Its all nicely nested, so all you have to do is break down expressions! Functions are greatest thing to happen to programming.... functions converted it from what looks like Harry Potter incantations to something resembling logic. At least you know its an assignment operation, without even knowing any of the other identifiers in that statement (say)

  88. btw by Anonymous Coward · · Score: 0

    ... 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).

    That bolded clause wasn't finished. Not many people who wouldn't wish for what? There isn't any meaningful verb there.... Gosh breaking it down was hard. First I actually thought my brain was too tiny to hold and analyze such a complex sentence. Then I realized it was also grammatically incorrect :D

    1. Re:btw by Anonymous Coward · · Score: 0

      It's a bit clunky, but it's grammatically correct. Most people aren't used to "said" being an adjective. Read it as:

      "You won't find that many people [who] wouldn't wish for the languages [that the aforementioned] bits were taken from."