Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Why JavaScript Is the New Perl

samzenpus posted about 2 years ago | from the presto-chango dept.

Perl 453

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

cancel ×

453 comments

Sorry! There are no comments related to the filter you selected.

Web (0)

Anonymous Coward | about 2 years ago | (#42498819)

Doing pretty good as a web language.

I don't.. (1)

Jamonek (1398691) | about 2 years ago | (#42498833)

I don't see why not keep it as the web language it is.

Re:I don't.. (5, Insightful)

Anonymous Coward | about 2 years ago | (#42498913)

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.

Re:I don't.. (5, Funny)

K. S. Kyosuke (729550) | about 2 years ago | (#42499121)

So you're saying that it's indeed a good replacement for Perl after all? ;-)

How many javascript developers does it take? (5, Funny)

Cryacin (657549) | about 2 years ago | (#42499381)

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.

Re:I don't.. (2)

History's Coming To (1059484) | about 2 years ago | (#42499245)

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?

Re:I don't.. (0)

Anonymous Coward | about 2 years ago | (#42499503)

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

Re:I don't.. (1)

klingers48 (968406) | about 2 years ago | (#42499537)

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.

Re:I don't.. (5, Insightful)

Nerdfest (867930) | about 2 years ago | (#42498993)

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.

Re:I don't.. (5, Insightful)

techhead79 (1517299) | about 2 years ago | (#42499049)

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

Re:I don't.. (5, Insightful)

Anonymous Coward | about 2 years ago | (#42499099)

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.

Re:I don't.. (4, Insightful)

AuMatar (183847) | about 2 years ago | (#42499297)

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.

Re:I don't.. (5, Interesting)

dkf (304284) | about 2 years ago | (#42499497)

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

Re:I don't.. (1)

sourcerror (1718066) | about 2 years ago | (#42499377)

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.

Re:I don't.. (2)

techhead79 (1517299) | about 2 years ago | (#42499451)

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

Re:I don't.. (1)

Anonymous Coward | about 2 years ago | (#42499179)

Libraries like backbone.js, and others make this possible. As with any language, it's the developer who makes it maintainable not the language

Re:I don't.. (1)

Anonymous Coward | about 2 years ago | (#42499269)

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.

Re:I don't.. (0)

Anonymous Coward | about 2 years ago | (#42499003)

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!

What. The. Fuck? (3, Insightful)

Anonymous Coward | about 2 years ago | (#42498851)

What is this? Slasdot's daily troll story?

capcha: manure. How appropriate.

Re:What. The. Fuck? (4, Funny)

oodaloop (1229816) | about 2 years ago | (#42498859)

Yeah, like there's only one troll story a day. You must not check very often.

Indeed. (2)

CaptnCrud (938493) | about 2 years ago | (#42499037)

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.

Re:Indeed. (4, Insightful)

Penguinisto (415985) | about 2 years ago | (#42499339)

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.

Re:What. The. Fuck? (1)

Joce640k (829181) | about 2 years ago | (#42499123)

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

Re:What. The. Fuck? (2)

Penguinisto (415985) | about 2 years ago | (#42499365)

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

I guess. (0)

Anonymous Coward | about 2 years ago | (#42498875)

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

Readability (3, Insightful)

Anonymous Coward | about 2 years ago | (#42498887)

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.

Re:Readability (-1)

Anonymous Coward | about 2 years ago | (#42498955)

It can become closer to the standard english, but not many speak it and on top of that, there are many contexts that can't be understood. Math is universal and will not change easily in its structure.

If you want to go as far as possible, than any language is an application of mathematics on a variety of scales. Language is an obfuscated form of math, just sloppily assembled and loosely used.

Re:Readability (5, Insightful)

Anonymous Coward | about 2 years ago | (#42499013)

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!

Coming from a PERL guy (3, Informative)

CaptnCrud (938493) | about 2 years ago | (#42499167)

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.

Re:Coming from a PERL guy (1)

Anonymous Coward | about 2 years ago | (#42499283)

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.

Re:Coming from a PERL guy (0)

Anonymous Coward | about 2 years ago | (#42499291)

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

Re:Coming from a PERL guy (2)

Penguinisto (415985) | about 2 years ago | (#42499407)

Err, it would be if you, like, you know... commented a little in the damned thing. ;)

Re:Readability (1)

Penguinisto (415985) | about 2 years ago | (#42499401)

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

Re:Readability (1)

Nerdfest (867930) | about 2 years ago | (#42499019)

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.

Re:Readability (1)

AuMatar (183847) | about 2 years ago | (#42499341)

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.

Re:Readability (1)

Nerdfest (867930) | about 2 years ago | (#42499411)

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.

Re:Readability (1)

AuMatar (183847) | about 2 years ago | (#42499461)

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.

Re:Readability (1)

Nerdfest (867930) | about 2 years ago | (#42499483)

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.

Re:Readability (5, Insightful)

Hentes (2461350) | about 2 years ago | (#42499069)

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.

Re:Readability (1)

Alomex (148003) | about 2 years ago | (#42499263)

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.

Re:Readability (0)

Anonymous Coward | about 2 years ago | (#42499309)

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

Re:Readability (0, Troll)

Anonymous Coward | about 2 years ago | (#42499389)

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.

Re:Readability (0)

Anonymous Coward | about 2 years ago | (#42499429)

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.

Re:Readability (2)

lattyware (934246) | about 2 years ago | (#42499431)

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.

Re:Readability (3, Interesting)

Animats (122034) | about 2 years ago | (#42499267)

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.

Re:Readability (5, Insightful)

M. Baranczak (726671) | about 2 years ago | (#42499547)

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?

Re:Readability (0)

Anonymous Coward | about 2 years ago | (#42499561)

So you want AppleScript.

A bit late for this. (5, Funny)

Animats (122034) | about 2 years ago | (#42498891)

It's 2013, and someone is discovering Javascript?

Re:A bit late for this. (1)

alteveer (979070) | about 2 years ago | (#42498897)

So I guess Gmail, Facebook, and Twitter aren't large scale enterprise deployments?

Re:A bit late for this. (-1)

Anonymous Coward | about 2 years ago | (#42499053)

So I guess Gmail, Facebook, and Twitter aren't large scale enterprise deployments?

Well, were they deployed by a bunch of stuffy third-generation-rich white guys in business suits over a four-martini lunch after months and months of having secretaries call each other to arrange half-hour meetings in fifty-year-old office buildings during negotiations that involved the trade of ungodly amounts of byzantine stock deals? No? Well, then it's clearly not "enterprise", is it?

Re:A bit late for this. (0)

Anonymous Coward | about 2 years ago | (#42499093)

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.

Re:A bit late for this. (0)

Anonymous Coward | about 2 years ago | (#42499203)

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.

Re:A bit late for this. (1)

OhANameWhatName (2688401) | about 2 years ago | (#42499239)

It's 2013, and someone is discovering Javascript?

Let's face facts and blame Perl, it's always worked in the past

Re:A bit late for this. (1)

rwyoder (759998) | about 2 years ago | (#42499523)

It's 2013, and someone is discovering Javascript?

Just wait until tomorrow when they discover Livescript.

Very Different (5, Insightful)

hibiki_r (649814) | about 2 years ago | (#42498903)

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?

Re:Very Different (1)

hobarrera (2008506) | about 2 years ago | (#42499045)

It's the only thing you can run in a web browser.

FTFY.

Re:Very Different (1)

dbialac (320955) | about 2 years ago | (#42499087)

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.

Re:Very Different (-1)

Anonymous Coward | about 2 years ago | (#42499419)

If you think that Python forces you into a box then you really don't know anything about Python.

Perl makes it hard to write good code. It's an attempt to create a human language as a computer language. This does not work.

JavaScripts primary issues are that it's a mess of a language. There are lots of really nice things in the language but these get run over by all the crap. Javascript is not an OO language, the faster coders get this into their heads the faster we can see the large amounts of crap Javascript die. Stop trying to force it into being something it's not an you'll start being able to properly design and code nasty JavaScript applications.

Re:Very Different (0)

Anonymous Coward | about 2 years ago | (#42499237)

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.

Re:Very Different (0)

Anonymous Coward | about 2 years ago | (#42499405)

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

Lacking enterprise adoption? (5, Insightful)

NoKaOi (1415755) | about 2 years ago | (#42498925)

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?

Re:Lacking enterprise adoption? (1)

rduke15 (721841) | about 2 years ago | (#42499061)

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.

Re:Lacking enterprise adoption? (1)

Hentes (2461350) | about 2 years ago | (#42499095)

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

The web is just too successful (5, Insightful)

Kjella (173770) | about 2 years ago | (#42498927)

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.

Atwood's Law (2)

blutfink (793915) | about 2 years ago | (#42498975)

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

Modem noise (3, Informative)

frisket (149522) | about 2 years ago | (#42498981)

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 [destroyallsoftware.com]

Re:Modem noise (4, Informative)

hobarrera (2008506) | about 2 years ago | (#42499063)

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.

Re:Modem noise (1)

Concerned Onlooker (473481) | about 2 years ago | (#42499085)

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.

Re:Modem noise (-1)

Anonymous Coward | about 2 years ago | (#42499251)

Until you need the power of regular expressions. Then Perl starts looking pretty clean again.

No. Then Python starts looking like Perl. Except that everything before and after your regex is still readable.

Perl sucks. The only thing it has going for it is that it will let you suck at everything you could ever want to suck at.

Re:Modem noise (1)

fahrbot-bot (874524) | about 2 years ago | (#42499117)

Yah. And Perl still looks like modem noise.

Try programming in TECO [wikipedia.org] :

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.

Baxter Doesn't Know What He's Talking About (5, Insightful)

Baby Duck (176251) | about 2 years ago | (#42498995)

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.

Re:Baxter Doesn't Know What He's Talking About (5, Insightful)

Bob9113 (14996) | about 2 years ago | (#42499361)

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.

Troll! (0)

Anonymous Coward | about 2 years ago | (#42499005)

Blatent Troll!

Also (1)

rs79 (71822) | about 2 years ago | (#42499023)

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.

I'm not worried (4, Insightful)

RedHackTea (2779623) | about 2 years ago | (#42499025)

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

Adoption (1)

hobarrera (2008506) | about 2 years ago | (#42499043)

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

Re:Adoption (1)

Anonymous Coward | about 2 years ago | (#42499105)

[...]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. =)

Re:Adoption (0)

Anonymous Coward | about 2 years ago | (#42499151)

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)

JavaScript isn't that bad (0)

Anonymous Coward | about 2 years ago | (#42499075)

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.

With respect... (5, Funny)

fahrbot-bot (874524) | about 2 years ago | (#42499089)

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 [wikipedia.org] . ]

too accessible (1)

technosaurus (1704630) | about 2 years ago | (#42499115)

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?

perl haiku (1)

inode_buddha (576844) | about 2 years ago | (#42499131)

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

A miss understood language (0)

Anonymous Coward | about 2 years ago | (#42499165)

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.

totally made up grammer, or what... (0)

Anonymous Coward | about 2 years ago | (#42499171)

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

Re:totally made up grammer, or what... (1)

PPH (736903) | about 2 years ago | (#42499501)

Its a shame we don't have some sort of error handling facility that would throw an exception in cases like this.

Properly understanding javascript.. (5, Funny)

joss (1346) | about 2 years ago | (#42499225)

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

GWT? (2)

slew (2918) | about 2 years ago | (#42499241)

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.

Uhm... (-1)

Anonymous Coward | about 2 years ago | (#42499243)

"People are thoroughly excited [about JavaScript]..."

I am thoroughly TICKED OFF by javascript. I suppose you could say that's a variation of 'excitement'.

"While I do like both languages..."

Sorry, if you like Perl as a language, then your opinion of javascript (or any other language) is quite suspect.

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.

I would like to see a measurement of the percentage of websites with javascript errors. I believe it's around 85% or greater. It may appear to be less, now that many browsers fail to bring the errors to your attention, but I think it's insanely high, and it's javascript's fault.

This is one case where I wish that a basic variant would have been chosen originally - it would have saved a lot of heartache on the part of millions of developers.

Dinosaurs don't like meteorites (0)

Anonymous Coward | about 2 years ago | (#42499247)

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.

Whats wrong with JS? (0)

Anonymous Coward | about 2 years ago | (#42499259)

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.

Re:Whats wrong with JS? (4, Interesting)

lattyware (934246) | about 2 years ago | (#42499447)

https://www.destroyallsoftware.com/talks/wat [destroyallsoftware.com] - 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.

Perl and enterprise (1)

Anonymous Coward | about 2 years ago | (#42499265)

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.

Why is it always cool to bash Javascript?!?!? (1)

Anonymous Coward | about 2 years ago | (#42499277)

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.

Re:Why is it always cool to bash Javascript?!?!? (3, Informative)

mark-t (151149) | about 2 years ago | (#42499507)

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.

Bad/Good JS (0)

Anonymous Coward | about 2 years ago | (#42499317)

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 blame Node.js (1)

MagikSlinger (259969) | about 2 years ago | (#42499321)

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.

We are verbing adjectives now? (0)

Anonymous Coward | about 2 years ago | (#42499369)

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

Was that really necessary?

Re:We are verbing adjectives now? (1)

mark-t (151149) | about 2 years ago | (#42499541)

Agreed... especially since there's another verb already that conveys the exact same notion.... "liken".

I Beg to Differ... (1)

sharksfan98 (2635753) | about 2 years ago | (#42499471)

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.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?