JavaScript is the new Perl
ocpsoft.org
ocpsoft.org
If native mobile apps end up de facto replacing the open internet, that could change, of course. But I hope the internet remains, warts and all. And as ARM chips improve, and DOM APIs are expanded, and JS engines become more efficient, and the HTTP spec is ever more optimized for web applications, I think in the end the browser will survive.
>> Perl never had a monopoly on a runtime environment with an install base of pretty much everyone who owns a computer, tablet, or smartphone. Sometimes it's not about engineering principles.
This.Mobile is just hyped. Once companies realize that people who access to the internet solely through their phone can hardly be monteized, well be back pre-iphone in the hype department.
Haven't we?
But we keep seeing a lot of PHP shops. Does this mean that PHP is better suited for "large scale projects?" I'd very much doubt that.
The ease of learning a language and it's availability are very important factors in the popularity of a language. Javascript scores well in this regard. Really, I am not too worried about Javascript's impending doom. Unlike Perl, it continues to remain a favorite "target language" making it further entrenched in most ecosystems.
- http://news.ycombinator.com/item?id=5016848
- http://news.ycombinator.com/item?id=5014218
- http://news.ycombinator.com/item?id=5020893
NB. Only the first post has comments.
On a geological scale, maybe. It appeared in the mid-nineties, which is positively ancient in computer terms.
@!&?
Now, both Perl and Javascript today - are totally different beasts they been back then. They both evolved a lot, but due no real competition in browsers Javascript have monopoly. Perl on the other hand, even having all this awesome stuff in it today, have to compete with many other platforms.
In my opinion Javascript's evolution has become a requirement more than just a story of success. It was the de facto standard language for browsers but with big lacks of performances. Browsers vendors worked to improve it and everything was only a natural consequence of the evolution of the World Wide Web.
Perl's history is completely different. Perl has always worked behind the scenes, and still does it greatly. It has a stable, rock solid, very performant and widely spread runtime.
Let's just call things with their names and use them for the purpose they are born and everything will look less confusing.
More than else, always remember: You can write FORTRAN in any Language.
How about CoffeeScript?
Also, I worked on some pretty "big" JS projects (in terms of scale, not popularity) and I found Javascript really easy to maintain, you just have to plan ahead a little, but I do agree that the syntax is a slightly bit not to my liking, but it is not horrible.
Also, what type inconstancy is he referring to?
+[[+!+[[]]]+[![]][+[[]+[]]]++] === 10
This evaluates to true. Cookie for anyone who can explain why!I hope someone figures out the rest and gets a cookie! :D
However, I knew before that Array + <something> will give you a String (with the members of that array delimited by a comma) followed by <something> cast into a String. I don't find that wat.
Also, the reason why String+Number works is because + is overridden on strings to concatenate, while - isn't. That's why you get a NaN, but you probably know that. How would you expect it to work anyway? I don't think it's that watty.
The only thing that I find wat-worthy is Object + <something>, because that truly makes little sense. There might be some ambiguous logic behind it, though.
I've yet to see compelling arguments for why it might be better in "large" projects.
The most compelling arguments regarding this matter are often in the form of personal experience working with large applications. JavaScript code bases don't scale well past around 10,000 lines of code and 2 or 3 developers at most. Languages like Java, C, C++, C# and Ada, on the other hand, can relatively easily handle software systems with millions of lines of code, worked on by hundreds or even thousands of developers spread globally.
JS certainly has its problems. I don't think its type system features all that high. Newcomers trying to make it behave like their favourite language is a much bigger problem.
Javascript's relativity 'loose' type system means that developers have to spend a lot more time ensuring parts will work well. It isn't like good code can't be written in javascript, it's just that it takes a lot more effort.
JS weaknesses are overrated: anybody can grasp all quirks within an hour and after few days you get used to them (besides there just a few and great standard libs like underscore making JS a rock-solid base) and JS' bad parts won't stand in your way anymore. Those who aim for perfection won't get shit done anyway. They look for the academically structured Rails apps (or replace with any other bloated framework) with half a second respond times and breaking after every 0.0.1 update of Rails. In my view JS is damn perfect and I can think of anything better right now. JS and its ecosystem (especially the awesome npm) gives you anything to write elegant, well maintainable code bases ten leagues higher than any script language like PHP and on the same level like Ruby or Python.
JS is not a hack written in ten days. JS is a wonderful and modern language, more innovative than most other language out there, it's a masterpiece of a language. People complain because it's different: it doesn't follow the traditional OO, there're no strict monolithic frameworks which teach them how to structure code and most are just overwhelmed with functional programming and event loops/call backs/asynchrony because they were just used to something different. This is not being arrogant it's just that people don't like change or hoping all the time for something better instead of being happy with what they have now.
You can create and maintain very large code bases in JS without any Coffee or other layers of abstraction (there enough examples out there). Most people are just not used anymore to think theirself about structuring code since there was always somebody who did the job for them (Rails, Django, etc.).
You don't need to compile to JS -- JS is also not the new assembly of the net because hundreds are building weird languages on top providing useless syntactic sugar and again old-age OO, it's already a very high level language allowing you to do ANYTHING and structuring you code exactly as want. Nothing will stand in your way.
And Javascript is so fast, you get C class performance with a dynamically typed language. No need to compile after every single change or deploys are fast and easy without sending huge binaries to the servers. There's no other language providing this speed for such little cost, no other.
To understand JS' beauty and to get the "flow" you have with other languages and you do not get with JS you have to do two things: invest time and try to forget what you learned. And if you still don't get there spend more time with JS. It's not JS which failed.
JS haters and other downvoters: not agreeing != downvoting
But, sadly, it fills a hole that nothing else does.
Sure, Javascript may not be as bad as perl or php, but it's got plenty of warts. On the server, why use javascript when you can use a language without warts?
As fast as C? Not remotely close:
http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
Usual disclaimer about micro-benchmarks applies, but I suspect the real picture is even worse. Speaking of compiling down to Javascript, languages like Coffeescript came about because of Javascripts warts, not because it's such a great language.
Again, you can program in straight Javascript, but why? Because it's all you know? I need to forget better solutions exist to like it?
Thanks, but I'll pass.
Could you explain what you consider to be wonderful and modern about it? My view is it's Just Another scripting language with a weird OO model. I'm specifically interested in the features you think it offers that other scripting languages like Ruby, Perl and Python don't have, which make it modern and wonderful.
> more innovative than most other language out there
Could you give an example of this?
> most are just overwhelmed with functional programming and event loops/call backs/asynchrony because they were just used to something different.
Javascript allows you to have a simple form of anonymous function. Is this what you mean by "functional programming"? Do you feel Javascript's implementation of this is superior to how other languages do it?
It's kind of sounding a bit like you think NodeJS invented event-driven programming...
> You can create and maintain very large code bases in JS without any Coffee or other layers of abstraction
You can do this in any language, and there are enough examples out there. That doesn't mean that it's necessarily what the language encourages. I've found Javascript considerably more difficult to organize code in than Haskell or Erlang or Perl or Objective C ... actually, harder than most things.
> Most people are just not used anymore to think theirself about structuring code since there was always somebody who did the job for them (Rails, Django, etc.).
You ... how long have you been programming for?
> it's already a very high level language allowing you to do ANYTHING and structuring you code exactly as want. Nothing will stand in your way.
I think this is definitely the first time I've understood the relationship between Javascript and ZOMBOCOM.
> And Javascript is so fast, you get C class performance with a dynamically typed language.
And it's about now that this start to sound like satire...
Time and again, the question "are there any useful ideas or features in language X that we can borrow and implement in Perl?" has been posed by prominent people in the Perl community. Which is the opposite of the "not invented here" syndrome.
http://search.cpan.org/~grichter/HTTP-Webdav-0.1.18-0.17.1/W...
What's the return value? Is there really no result? And what is cache? I can't even click that variable and see it's structure.
As a reminder, i just picked some random module. It's 2013 and not 1980. I'd like to know that kind of stuff quickly when i check for arguments and how to call stuff. I like that stuff in my editor/ide as well. Clickable. Call me lazy, but i do want to work efficiently and not trying to google all day for a simple usage example. I like to get the work done.
You're partially right about perlmonks. It's a great resource for perl! Sometimes it seems like it's the last stronghold of the perl community but it has great answers. What is not so great is that i find multiple solution (like more then 10) for a very simple problem, but that's subjective..
I am a javascript beginner. For me, it is a lot more difficult to read than Perl. I very much agree with the article, but I think that javascript is more than a new Perl, it is also a new BASIC. Like BASIC 30 year ago, it is present on every computer, almost every developer will encounter the need to learn javascript and almost anything can be coded in javascript.
But the nice things about JS - the effortless ability to go all higher-order, the flexibility, the power, the /fun/ - and much of the bad parts - the difficulty with writing clear and maintainable code, no support for strong types; if you like Javascript, you will love Perl when you get to know it.
[1] - https://metacpan.org/
[2] - http://plugins.jquery.com/ - http://jamjs.org/ - http://jsfromhell.com/
[3] - https://npmjs.org/
This dilemma is as old as programming itself and will only go away when we introduce public flogging as punishment* for wrongly applying the "laziness is a virtue" dogma.
* Developers are people too (mostly) and I don't condone public violence against them. Private violence is OK.
...
...
...
There is no php, or rails, or asp alternative here as there is with perl. Correct me if I'm wrong, but the closest thing I've found is 1. NaCl 2...?