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.'"
Doing pretty good as a web language.
I don't see why not keep it as the web language it is.
http://mc.jamonek.com - Minecraft Signature Generator
What is this? Slasdot's daily troll story?
capcha: manure. How appropriate.
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.
But neither are suitable bases for enterprise level systems. They are good in small parts, but not the whole.
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.
It's 2013, and someone is discovering Javascript?
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?
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?
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
Atwood's Law: "Any application that can be written in JavaScript, will eventually be written in JavaScript."
But, hey, lots of people like them, so they must be good, right? https://www.destroyallsoftware.com/talks/wat
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
Blatent Troll!
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 ?
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
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.
[...]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.
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.
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. . . .
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?
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...
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
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.
Scenario, im new to perl. Would you consider this simple sort of subroutines human readable?:
@s = sort mycriteria @a; /(\d+)/; /(\d+)/;
sub mycriteria {
my($aa) = $a =~
my($bb) = $b =~
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.
"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.
.. is just like leaving an abusive relationship, its all about getting closure.
http://rareformnewmedia.com/
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.
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.
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.
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.
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.
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
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
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?
"However, I'd akin this to people discovering Perl during the advent of C and C++ (mirror)."
Was that really necessary?
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
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.
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.
File under 'M' for 'Manic ranting'
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.
Seastead this.
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"?
If you think Perl is write-only, you're an idiot and/or a bad programmer.
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.
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?
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
This was ripped straight from John Klassa / Raleigh Perl Mongers / Sorting in perl.
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.
Wow.
I'm not gonna waste my "perma-terrible-modded-down-two-submits-per-day" and add anything more to that. .Net backend at the same time. :-P
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
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
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.
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
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.
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.
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...)
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!
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.
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
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.
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?
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
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.
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.
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.
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!
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
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.
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.
...they want their headline back.
'The unexamined life is not worth living' - Socrates
Darn.
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!
May I quote you on my sig, Sir?
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.
Because all of you lusers have your browser running all my JS.
Get informed http://noscript.net/
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.
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.
Low-contrast, didn't read.
Fuck low contrast sites, and the content on them.
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.
MidnightBSD: The BSD for Everyone
Javascript: Malware buddy edition
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.
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.
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..
It was called Actionscript and it is what Javascript needs to evolve into.
Adoption must be what makes a language great. That makes sense.
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.)
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
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.
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)
... 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