Live data from Hacker News

JavaScript is the new Perl

ocpsoft.org

21–30 of 45 posts

Re: JavaScript is the new Perl

#21
post #17

I don't really feel like being the next Perl is a bad thing, contrary to the article's premise. However, the author is making a lot of unbacked and sensational claims. I feel inclined to comment on each part. > everyone hates [Perl] because it’s “too hard to maintain” and too “strange.” I didn't know everyone hates Perl and I also didn't know those were the reason. Surely we don't want strange languages? > global var…

>How is javascript like assembly?

Their point is it is often used as a language to compile down to, not that JS is like ASM.

Re: JavaScript is the new Perl

#22
post #12

I think part of the problem with JavaScript, php, perl, etc is that is there, by default, everywhere. A great many beginners do some very ugly things with it because it's already on the system they have and there's tons of not so good examples on the Internet to cut and paste. I'd bet there are plenty of people creating web sites who aren't entirely clear on where HTML stops and JavaScript starts. Ruby, for example n…

PHP is most likely not on the system they have. I don't know about OS X but it doesn't come with any popular Linux distro and it doesn't come with Windows either. Neither does Perl.

PHP comes with every hosting provider out there for a few dollars a month. Has been the trend for a few years now :-). PHP is cheap to support for a host.

Re: JavaScript is the new Perl

#24
post #16

If you say Javascript is becoming an assembly language, you never coded in assembly language, it is not "impossible" to maintain a javascript project, if you can get pass that it is not java, people have been doing it for years and will continue to do so in the near future

at all costs sure, but why should I waste so much time?

Re: JavaScript is the new Perl

#25
post #17

I don't really feel like being the next Perl is a bad thing, contrary to the article's premise. However, the author is making a lot of unbacked and sensational claims. I feel inclined to comment on each part. > everyone hates [Perl] because it’s “too hard to maintain” and too “strange.” I didn't know everyone hates Perl and I also didn't know those were the reason. Surely we don't want strange languages? > global var…

I agree with a lot of what you said, but I can see one area where I can see what the author is trying to say. > How is javascript like assembly? You're right that JavaScript is not like assembly; it's more like bytecode. A number of different languages compile to JavaScript (CoffeeScript, TypeKit, Fay), which is then interpreted. While the intent of JavaScript is that it should be readable by humans, in practice this…

Ok, I can see that point. I guess the big difference is that not many people write in bytecode, but a lot of people (majority in my experience, which might change) write in pure Javascript

Re: JavaScript is the new Perl

#26
post #16

If you say Javascript is becoming an assembly language, you never coded in assembly language, it is not "impossible" to maintain a javascript project, if you can get pass that it is not java, people have been doing it for years and will continue to do so in the near future

Building on this point: there are more and more libraries and frameworks in javascript that follow best practices in keeping things modular, well separated and differentiating core-app code from DOM manipulation.

Re: JavaScript is the new Perl

#27
post #25

Earlier quoted context omitted.

I agree with a lot of what you said, but I can see one area where I can see what the author is trying to say. > How is javascript like assembly? You're right that JavaScript is not like assembly; it's more like bytecode. A number of different languages compile to JavaScript (CoffeeScript, TypeKit, Fay), which is then interpreted. While the intent of JavaScript is that it should be readable by humans, in practice this…

Ok, I can see that point. I guess the big difference is that not many people write in bytecode, but a lot of people (majority in my experience, which might change) write in pure Javascript

Oh, definitely. I write in JavaScript myself. I understand what the author is trying to convey, but both analogies (assembly and bytecode) are wrong in their own ways.

Re: JavaScript is the new Perl

#29
> Nobody actually does plain “JavaScript” programming for the web anymore, not really anyway. Do they use the core language? Yes. But we no longer use any of the built-in JavaScript->HTML functionality directly.

Which is sort of a shame because there's stuff in there that totally obviates the need to haphazardly traverse the dom with jQuery.

Finding the form an input element belongs to in jQuery:

    $('input').parents('form');

    // or probably
    $('input').parent().parent().parent().find('form');
Finding the same thing using the DOM API:

    document.querySelector('input').form;
You'd want to mix those two, in a real use case:

    $('input').on('click', function(evt) {
        var form = this.form;
    });
Then you don't even need jQuery to use the FormData API:

    // where `submit` uses XHR2 to make a request
    

Re: JavaScript is the new Perl

#30
post #17

I don't really feel like being the next Perl is a bad thing, contrary to the article's premise. However, the author is making a lot of unbacked and sensational claims. I feel inclined to comment on each part. > everyone hates [Perl] because it’s “too hard to maintain” and too “strange.” I didn't know everyone hates Perl and I also didn't know those were the reason. Surely we don't want strange languages? > global var…

>I didn't know everyone hates Perl and I also didn't know those were the reason. Surely we don't want strange languages?

Why the sarcasm? "Everyone", in everyday talk means "most people", and considered that Perl has long lost the spotlight it once had as a scripting language, that is a lot of people.

As for the "strange" part, yes, surely we "don't want strange languages". Strange languages have always been marginal, with C (Algol) style languages always being the most popular.

Here by strange he obviously alludes to the "syntactic noise"-likeness of the language's syntax, one of the most common complaint's about it.

>How is javascript like assembly?

In the obvious way that is used as a target language for stuff, from emscripten to coffeescript, to TypeScript, to Dart, to clojurescript, to GWT.

It's been called multiple types, including in HN, "the assembly/bytecode of the web world" in case you haven't noticed.

>Sorry, this just means you're a shitty developer and/or can't manage deadlines very well.

Which includes most of the industry, so it cannot be dismissed with an work ethic/abilities slant like that. It's common knowledge (and inspected in literature) that most IT project fail, for example. You really think it's because of "shitty developers"? Do you think Brook's team had "shitty developers"? Or the team that worked on Chandler? (read "The Mythical Man Month" and "Dreaming in Code" respectively).

Post reply on HN