TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JavaScript is the new Perl

32 pointsby ctover 12 years ago

13 comments

trimboover 12 years ago
Is he trying to say that everything we write today in Javascript will probably be rewritten like everything we wrote in Perl in the 90s got rewritten? That's probably true, but it doesn't mean "Javascript is the new Perl"<p>Perl had zero corporate investment from a application development perspective. Java had an enormous amount -- and still does. Now take a look at Javascript. Javascript is the first language since Java to have gotten this much investment across a lot of enterprises. Google, Microsoft, of course, but also the rise of startups like Meteor. For Javascript to go away the way Perl did for app development will require too much retooling.
kalmsover 12 years ago
Seems like a weird comparison. JavaScript is obligatory and available in all common browsers. It's fairly easy to get started, and even easier to actually accomplish something with it. Not sure if Perl is as accommodating (haven't tried it though).<p>When all is said and done JavaScript is a very popular language. When you leave a company, having build something fairly complex - If you did your job properly, documented your code and followed common sense, the project will probably live on.<p>The author also speaks off everyone hating Perl. Is JavaScript really as hated? I don't get that impression at all.
评论 #5017411 未加载
jfbover 12 years ago
I don't think that people's problems with perl &#60; 5.0 was it's lack of "object oriented" features. Perl's object system is quite interesting, but orthogonal to the perceived ickiness of perl the language.
noonespecialover 12 years ago
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.<p>Ruby, for example not only has to be installed on most older systems, you'd have to know that you wanted ruby in the first place. This alone acts as a giant filter. Anyone who knows they want to use ruby is already going to produce better code.<p>Edit: Please s/ruby//g with anything slightly more obscure than perl/php like python, go, object-pascal, etc. I'm not trying to be a ruby elitist here. It was just an example.
评论 #5017239 未加载
评论 #5017315 未加载
评论 #5017255 未加载
评论 #5017223 未加载
FuzzyDunlopover 12 years ago
&#62; 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-&#62;HTML functionality directly.<p>Which is sort of a shame because there's stuff in there that totally obviates the need to haphazardly traverse the dom with jQuery.<p>Finding the form an input element belongs to in jQuery:<p><pre><code> $('input').parents('form'); // or probably $('input').parent().parent().parent().find('form'); </code></pre> Finding the same thing using the DOM API:<p><pre><code> document.querySelector('input').form; </code></pre> You'd want to mix those two, in a real use case:<p><pre><code> $('input').on('click', function(evt) { var form = this.form; }); </code></pre> Then you don't even need jQuery to use the FormData API:<p><pre><code> // where `submit` uses XHR2 to make a request &#60;input type="submit" onclick="submit(this.form)"&#62;</code></pre>
评论 #5017772 未加载
arnorhsover 12 years ago
I don't really feel like being the next Perl is a bad thing, contrary to the article's premise.<p>However, the author is making a lot of unbacked and sensational claims. I feel inclined to comment on each part.<p><i>&#62; everyone hates [Perl] because it’s “too hard to maintain” and too “strange.”</i><p>I didn't know <i>everyone</i> hates Perl and I also didn't know those were the reason. Surely we don't want strange languages? &#60;/sarcasm&#62;<p><i>&#62; global variables in JavaScript have been at the root of nearly every client-side security exploit to date.</i><p>Where does this information come from?<p><i>&#62; In the mean time, to work around some of these issues, JavaScript is still being used much like an Assembly language.</i><p>How is javascript like assembly?<p><i>&#62; We are seeing a similar explosion of packages (libraries), like Perl did, which led to the development of CPAN (you could akin this to the jQuery plugin ecosystem, which is neither as formal, reliable, nor as convenient or automated.)</i><p>Also worth mentioning is node's NPM, in which case the above argument is not true. And also, github and great search engines did not exist at the time that CPAN came out, and it's hard to imagine it would have gained the same amount of traction, because it's simply not necessary for the most part.<p><i>&#62; There’s a similar explosion of JavaScript implementations on server side and in other languages, leading to issues with compatibility and runtime bugs.</i><p>What is this based on? I haven't seen many problems with compatibility and runtime bugs in the Node ecosystem at all. However I've never used Rhino, and perhaps that's what he's talking about. Does the author have any experience with Node?<p><i>&#62; Still don’t believe that JavaScript is the new Perl? Compare jQuery to Perl CGI. 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-&#62;HTML functionality directly.</i><p>Only holds limited truth for browser development. Everybody using jquery is using plain Javascript. They are interfacing with the DOM API through jQuery and using the jQuery library. But the comparison is like saying anybody who uses a 3rd party library in Java is not using the real language. A language is not the API that you're using.<p><i>&#62; jQuery is the glue that holds together the JavaScript ecosystem, provides browser compatibility, and it admittedly does a pretty good job.</i><p>what?<p><i>&#62; however, sooner or later, the lack of language constructs like truly enforceable namespace boundaries, and the general mess created when teams get a little bit bigger is going to set in.</i><p>Name spacing is easily solved using module loaders and proper scoping.<p><i>&#62; This is seen over and over as the new wave of developers comes into corporate life: Larger companies try it out, then decide it’s costing measurably, then switch back.</i><p>It would be interesting to know which large companies have been trying it out and then deciding it's costing them too much money and switching back.<p><i>&#62; We ARE inherently lazy and most of us will ignore nearly any best practice or principle once “that deadline” gets too close.</i><p>Sorry, this just means you're a shitty developer and/or can't manage deadlines very well.<p><i>&#62; Still, you don’t see that many big Python and Ruby shops either (Google is an exception,)</i><p>His exception is a pretty large one. And besides that, which companies has the author studied?<p>I'm not going to comment on any of the Java claims, since I don't have that much experience with Java.<p>All in all this article is incredibly biased towards Java and affected by large amount of disinformation about Javascript in general.
评论 #5017391 未加载
评论 #5017753 未加载
评论 #5017430 未加载
评论 #5017937 未加载
评论 #5017733 未加载
jarjouraover 12 years ago
Point 1: There is no other way to write client-side browser applications.<p>Point 2: Node.js allows a team of 1-2 quickly get a server-side app up and running. Once a project takes off and needs to scale to a larger team, it's extremely easy to switch to and write C++ components.<p>Point 3: Who cares if history is repeating itself or not. It's an impressive technology stack with huge corporate backers. Besides, Perl is still used and although nowhere near as cool, still works great for writing shell scripts.
ojrover 12 years ago
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
评论 #5017470 未加载
评论 #5017449 未加载
staticsafeover 12 years ago
Site seems to be timing out here.
评论 #5017143 未加载
评论 #5017639 未加载
smosherover 12 years ago
<i>Perl was never as popular as JavaScript has become lately,</i><p>I don't know what to say.<p>Spoiler: apparently ES6 is going to kill ES5. Personally I'm shocked.
评论 #5017426 未加载
ctekover 12 years ago
We have an extensive JavaScript codebase at the large corporation I work at and by simply enforcing the use of ECMAScript 5 Strict Mode and verifying with JSLint we are able to catch most potential issues but then again, nobody there is writing large systems in JavaScript, only flourishes of browser-side interactivity...
评论 #5017766 未加载
dotborgover 12 years ago
There was much more "magic" in CGI/Perl. The only "magic" in JS in fact is caused by browser vendors and have nothing to do with language itself.
azakaiover 12 years ago
&#62; a stack that is resilient enough to withstand sloppy code.<p>There is no such magic stack that withstands sloppy code.