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!

Trying To Bust JavaScript Out of the Browser

timothy posted more than 4 years ago | from the first-disable-the-guard dept.

Programming 531

eldavojohn writes "If you think JavaScript is a crime against humanity, you might want to skip this article, because Ars is reporting on efforts to take JavaScript to the next level. With the new ECMAScript 5 draft proposal, the article points out a lot of positive things that have happened in the world of JavaScript. The article does a good job of citing some of the major problems with JavaScript and how a reborn library called CommonJS (formerly ServerJS) is addressing each of those problems. No one can deny JavaScript's usefulness on the front end of the web, but if you're a developer do you support the efforts to move it beyond that?"

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

javascript is good (1)

runyonave (1482739) | more than 4 years ago | (#30284260)

it's just sometimes, it's a resource hog.

Re:javascript is good (1)

binarylarry (1338699) | more than 4 years ago | (#30284330)

"javascript" is essentially just a language specification, how it manages memory and other resources is implementation dependant.

A javascript program could be interpreted as has been in many web browsers, JIT compiled to native code like Java (which is getting more popular) or even be fully compiled to native code ahead of time.

Re:javascript is good (0)

Anonymous Coward | more than 4 years ago | (#30284546)

"javascript" is essentially just a language specification, how it manages memory and other resources is implementation dependant.

A javascript program could be interpreted as has been in many web browsers, JIT compiled to native code like Java (which is getting more popular) or even be fully compiled to native code ahead of time.

when an app is written in JS it is more likely to be a resource hog than the same app written in compiled C. what causes it, why it causes it, how it got there, and why it's associated with JS is utterly unimportant to the user. so until and unless major browsers start implementing things like JIT compilation, by default and for all Web sites that ask it to run JS, it's a moot point and you just come across like a fanboy who needs to stick up for the object of his fandom. sorry but it's the hard truth that the answer you gave is not nearly so useful as you may have thought it would be. you can come to understand why and learn from that if you so choose.

WELL (-1, Offtopic)

Anonymous Coward | more than 4 years ago | (#30284794)

Here is a GOOD SOLID WORK-AROUND, CALLED A HOSTS FILE!

(It works for more speed online, AND SECURITY ESPECIALLY... Also, it works for your money, because you pay for your linetime out of pocket most likely as I do, you can get back your speed, AND, gain security easily, & from a single easily edited file & a file eats no CPU cycles like a local DNS server can (& are not as security vulnerable either if you protect write access to a HOSTS file also)... Anyhow/anyways - Here goes:

SO - "that all said & aside"? Well, per your reply??

Hey - NO PROBLEM, 110% agreement here on that account... & more (like more speed online AND more security, via a SINGLE EASILY EDITED + POPULATED FILE, called a HOSTS file):

I use a custom HOSTS file, in addition to the tools others here in this thread have noted (which MANY like FF addons only really function for FireFox/Mozilla products, but don't extend globally to all other webbound applications, & that is part of what HOSTS files give you above the methods you extoll + utilize: "GLOBAL COVERAGE", & of ALL webbound apps, not just FireFox/Mozilla ones via the addons you noted + use yourself...).

HOSTS files can be used to blockout KNOWN "bad" adserves, maliciously coded sites or adbanners, and "botnet C&C servers" too!

You can obtain reliable HOSTS files from reputable lists for more security online, but also for speed!

(More on that later & WHY/HOW (I use reliable lists for that, such as these HOSTS @ Wikipedia.com -> http://en.wikipedia.org/wiki/Hosts_file [wikipedia.org] or those from mvps.org (a good one this one))

I also further populate & keep current my custom HOSTS file with up to date information in regards to all of those threats, via:

----

A.) Spybot "Search & Destroy" updates (populates HOSTS and browser block lists)

B.) Sites like ZDNet's Mr. Dancho Danchev's blog -> http://ddanchev.blogspot.com/ [blogspot.com]

C.) Sites like FireEye -> http://blog.fireeye.com/ [fireeye.com]

D.) SRI -> http://mtc.sri.com/ [sri.com]

----

My HOSTS file incorporates ALL of the entries from the HOSTS files shown @ wikipedia as well... gaining me speed online (by blocking adbanners, which have been compromised many times the past few years now by malscripted exploits (examples below)).

(I combined ALL reputable HOSTS files with one of my own (30,000 entries), & I removed duplicates removed via a Borland Delphi app I wrote to do so called "APK HOSTS File Grinder 4.0++". That program also functions to change the default larger & SLOWER 127.0.0.1 blocking 'loopback adapter' IP address to either 0.0.0.0 (for VISTA/Windows Server 2008/Windows 7, smaller & thus faster than 127.0.0.1 default) or the smallest & fastest 0 "blocking 'IP ADDRESS'" (for Windows 2000/XP/Server 2003 which can STILL use it (& it was added in a service pack on Windows 2000, only on 12/09/2008 MS patch tuesday was it removed for VISTA onwards (& now all these "phunny little bugs" are showing up as FLAWS in this new NDIS6 approach via WFP as well in the firewall, which ROOTKIT.COM has stated (with code too no less on how it is done) -> http://www.rootkit.com/newsread.php?newsid=952 [rootkit.com] [rootkit.com] that it is EASIER TO UNHOOK (than was the design used in Windows 2000/XP/Server 2003))

Another EXCELLENT benefit of HOSTS file usage? More speed online, & also more security + reliability (especially in the case of DNS servers today, per folks like Dan Kaminsky &/or Moxie Marlinspike finding various security vulnerabilities in them the past couple years now)...

SO, to "CIRCUMVENT" THAT WHICH YOU NOTE & to get more speed online (besides/above potentially hijacked adbanners etc. et al)?

WELL - I use another "technique" called "hardcoding" an IP address to domainname/hostname in my HOSTS files, for my FAVORITE websites:

This allows me to FIRST bypass any remote/external DNS lookups, which also would in theory @ least, make me "proofed" vs. DNS request logs by my ISP/BSP also.

(Especially since I use external DNS servers too, OpenDNS ones to be specific, that go beyond my hardcoded favs in my HOSTS file because I can't ping & resolve the ENTIRE internet after all)

This also makes it harder for others to track me...

(Sure, they could do a "reverse DNS lookup" via pings &/or traceroutes & the top level domain that does nothing BUT cache reverse DNS lookups does the rest, but that is harder to do, than looking up my URL requests via a log on a DNS server))

ALSO, AS ANOTHER "BONUS" in HOSTS FILES (can't stress it enough, & especially above + beyond adbanner blocking): It speeds you up, or can!

E.G.-> A buddy of mine named Jack says it has (verbatim quote) "DOUBLED MY SPEED ONLINE, BUT I VALUE THE SECURITY PART MORE", because he used to get over 200++ viruses a week, now? Only maybe 2 a year IF THAT lately, & he is convinced it is largely due to the HOSTS file I send him weekly (he is my "lab rat #1" due to his previous infestation rate), & if that "anecdotal evidence" is not enough? See this then, from a published security guru on a respected site for it:

====

RESURRECTING THE KILLFILE:

(by Mr. Oliver Day)

http://www.securityfocus.com/columnists/491 [securityfocus.com]

PERTINENT EXCERPTS/QUOTES:

"The host file on my day-to-day laptop is now over 16,000 lines long. Accessing the Internet particularly browsing the Web is actually faster now."

"From what I have seen in my research, major efforts to share lists of unwanted hosts began gaining serious momentum earlier this decade. The most popular appear to have started as a means to block advertising and as a way to avoid being tracked by sites that use cookies to gather data on the user across Web properties. More recently, projects like Spybot Search and Destroy offer lists of known malicious servers to add a layer of defense against trojans and other forms of malware."

====

(A nice bonus beyond blocking adbanners via HOSTS too, because these have been shown to harbor malscripted content too & more than just a few times the past 4-5 yrs now no less such as is noted here in my PS below, several examples thereof no less), because you don't waste between 30-N ms calling out to an external DNS!

(Again, and a DNS server that MAY be poisoned per Dan Kaminsky the past few years now & others also noting it)

Thus, you can STILL GET TO YOUR FAV. SITES IF HARDCODED in your HOSTS FILE (a good thing, but one you may have to periodically alter, easily, via notepad.exe edits of your HOSTS file & a ping to update their new address (sites change hosting providers due to better services or prices, rare, but they do & MOST let you know they are about to do so anyhow, so you can amend a HOSTS file)).

NICEST PART IS, THOUGH, PER YOUR STATEMENT (in addition to the benefits of HOSTS file I note above, alongside others like Mr. Oliver Day of SECURITYFOCUS.COM)?

I will STILL get to where it is that I WANT TO GO, not the router's onboard DNS server doing hostname/domainname resolutions or potential hijacked redirects... in theory @ least, because I am controlling the hostname/dommainname resolutions @ AN OS + IP STACK LEVEL, not via my routers' onboard DNS server...

APK

P.S.=> Evidences as to WHY you'd want to add on the "extra layered security protection" of a HOSTS file, which extends global security coverage to your webbound apps, AND, allows for a great deal of added extra speed as well? Ok, here are some documented reasons why like:

a.) DNS servers vulnerable, under attack, failing or being "DNS poisoned" misdirected & more

b.) Security suites failing vs. modern "blended threats" online

c.) javascript being used to do most of this via apps)

d.) adbanners being maliciously coded also...

(Here we go with documented proofs/examples:)

POISONED MALSCRIPTED ADBANNERS

The Next Ad You Click May Be a Virus:

http://it.slashdot.org/article.pl?sid=09/06/15/2056219 [slashdot.org]

----

Attackers Infect Ads With Old Adobe Vulnerability:

http://it.slashdot.org/article.pl?sid=09/02/25/024211 [slashdot.org]

----

Hackers Use Banner Ads on Major Sites to Hijack Your PC:

http://www.wired.com/techbiz/media/news/2007/11/doubleclick [wired.com]

----

Adobe Flash Ads Launching Clipboard Hijack Attacks:

http://it.slashdot.org/article.pl?sid=08/08/20/0029220&from=rss [slashdot.org]

----

Slashdot | Americans Don't Want Targeted Ads:

http://yro.slashdot.org/article.pl?sid=09/10/01/1854214 [slashdot.org]

====

DNS PROBLEMS:

Number of Rogue DNS Servers on the Rise:

http://tech.slashdot.org/article.pl?no_d2=1&sid=08/02/15/2118212 [slashdot.org]

----

Security Researcher Kaminsky Pushes DNS Patching:

http://it.slashdot.org/article.pl?sid=09/02/19/2322231 [slashdot.org]

----

Ten Percent of DNS Servers Still Vulnerable:

http://tech.slashdot.org/article.pl?no_d2=1&sid=05/08/04/1525235 [slashdot.org]

----

TimeWarner DNS Hijacking:

http://tech.slashdot.org/article.pl?sid=07/07/23/2140208 [slashdot.org]

----

Another DNS Flaw Found:

http://tech.slashdot.org/article.pl?sid=09/01/09/2348240 [slashdot.org]

----

Attack Code Published For DNS Vulnerability:

http://it.slashdot.org/article.pl?no_d2=1&sid=08/07/23/231254 [slashdot.org]

----

BIND Still Susceptible To DNS Cache Poisoning:

http://tech.slashdot.org/article.pl?no_d2=1&sid=08/08/09/123222 [slashdot.org]

----

DDoS Attacks Via DNS Recursion:

http://it.slashdot.org/article.pl?no_d2=1&sid=06/03/16/1658209 [slashdot.org]

----

DNS Poisoning Hits One of China's Biggest ISPs:

http://it.slashdot.org/article.pl?no_d2=1&sid=08/08/21/2343250 [slashdot.org]

----

DNS Root Servers Attacked:

http://it.slashdot.org/article.pl?no_d2=1&sid=07/02/06/2238225 [slashdot.org]

----

DNS Problem Linked To DDoS Attacks Gets Worse:

http://tech.slashdot.org/comments.pl?sid=1444354&cid=30109858 [slashdot.org]

----

Are your servers vulnerable to DNS attacks?

http://www.networkworld.com/news/2007/111907-dns-attacks.html [networkworld.com]

----

Kaminsky On DNS Bugs a Year Later and DNSSEC:

http://it.slashdot.org/story/09/06/25/1354212/Kaminsky-On-DNS-Bugs-a-Year-Later-and-DNSSEC [slashdot.org]

----

DNS users put higher premium on security:

http://news.techworld.com/networking/10690/dns-users-put-higher-premium-on-security/ [techworld.com]

----

BIND, the Buggy Internet Name Daemon:

http://cr.yp.to/djbdns/blurb/unbind.html [cr.yp.to]

(Where djbdns was found to have flaw, though it was alleged invulnerable, they paid out $10,000 reward)

----

DNS Dan Kaminsky DNS SPOOF ATTACK EXPLAINED HOW IT IS DONE:

http://blogs.zdnet.com/security/?p=1520 [zdnet.com]

----

DNS REBINDING ATTACKS: MultiPinning Browser JavaScript Vulnerability (how to protect yourself):

http://crypto.stanford.edu/dns/ [stanford.edu]

----

Hackers hijack DNS records of high profile New Zealand sites:

http://blogs.zdnet.com/security/?p=3185 [zdnet.com]

====

SECURITY SUITE PROGRAMS FAILING:

AntiVirus Products Fail to Find Simple IE Malware:

http://tech.slashdot.org/article.pl?sid=07/10/29/1747237 [slashdot.org]

----

Most Security Products Fail To Perform:

http://hardware.slashdot.org/comments.pl?sid=1445302&threshold=-1&commentsort=0&mode=thread&pid=30114652 [slashdot.org]

----

TOP SECURITY SUITES FAIL 64/300 THREATS in 2008 AT SECUNIA.COM:

http://secunia.com/blog/29/ [secunia.com]

----

Top security suites fail exploit tests:

http://www.computerworld.com/s/article/9117042/Top_security_suites_fail_exploit_tests?intsrc=news_ts_head [computerworld.com]

----

Antivirus is 'completely wasted money': Cisco CSO: News - Security - ZDNet Australia:

http://www.zdnet.com.au/news/security/soa/Antivirus-is-completely-wasted-money-Cisco-CSO/0,130061744,339289122,00.htm?feed=pt_auscert [zdnet.com.au]

----

Are Routers the Next Big Target for Hackers?

http://blogs.zdnet.com/security/?p=919 [zdnet.com]

----

Software Firewalls: Made of Straw? Part 1 of 2:

http://www.securityfocus.com/infocus/1839 [securityfocus.com]

Software Firewalls: Made of Straw? Part 2 of 2:

http://www.securityfocus.com/infocus/1840/2 [securityfocus.com]

----

Brief study shows difficulty in detecting malware (2008):

http://www.securityfocus.com/brief/858 [securityfocus.com]

----

2007 - Browser vulnerabilities and attacks will continue to mount:

http://www.infoworld.com/d/security-central/browser-vulnerabilities-and-attacks-will-continue-mount-679 [infoworld.com]

----

Bug exposes Cisco switches to attacks:

http://news.cnet.com/Bug-exposes-Cisco-switches+to+attacks/2110-7349_3-5902897.html?part=rss&tag=5902897&subj=news [cnet.com]

&

CISCO "COMES CLEAN" ON EXTENT OF IOS FLAW:

http://www.eweek.com/c/a/Security/Cisco-Comes-Clean-on-Extent-of-IOS-Flaw/ [eweek.com]

&

Cisco PIX and ASA Time-To-Live Denial of Service Vulnerability:

http://secunia.com/advisories/28625/ [secunia.com]

+

Computer routers face hijack risk - study:

http://www.cbc.ca/technology/story/2007/02/16/tech-routervulnerabilty-20070216.html?ref=rss [www.cbc.ca]

Slashdot Technology Story | Will Mainstream Media Embrace Adblockers?

http://tech.slashdot.org/story/09/08/06/1442243/Will-Mainstream-Media-Embrace-Adblockers [slashdot.org]

----

Congress May Require ISPs To Block Certain Fraud Sites:

http://yro.slashdot.org/comments.pl?sid=1432514&cid=30024078 [slashdot.org]

====

JAVASCRIPT PROBLEMS:

Slashdot | Adobe Confirms PDF Zero-Day, Says Kill JavaScript:

http://it.slashdot.org/article.pl?sid=09/04/29/1823234 [slashdot.org]

----

Adobe Flash Zero-Day Attack Underway:

http://it.slashdot.org/article.pl?sid=08/05/28/0138247&from=rss [slashdot.org]

----

JavaScript flaw reported in Adobe Reader (4th or 5th time already, if not more):

http://www.securityfocus.com/brief/953 [securityfocus.com]

----

Another malware pulls an Italian job via JAVASCRIPT:

http://blog.trendmicro.com/another-malware-pulls-an-italian-job/ [trendmicro.com]

----

JavaScript opens doors to browser-based attacks | CNET News.com:

http://news.com.com/JavaScript+opens+doors+to+browser-based+attacks/2100-7349_3-6099891.html?part=rss&tag=6099891&subj=news [com.com]

----

Mozilla Firefox Javascript Garbage Collector Vulnerability - Advisories - Secunia

http://secunia.com/advisories/29787/ [secunia.com]

----

New script outstrips all other drive-by download risks:

http://www.theregister.co.uk/2009/05/15/script_menace/ [theregister.co.uk]

----

Researcher to demonstrate attack code for Intel chips via Javascript:

http://www.infoworld.com/d/security-central/researcher-demonstrate-attack-code-intel-chips-036 [infoworld.com]

----

Researcher: JavaScript Attacks Get Slicker:

http://www.eweek.com/c/a/Security/Researcher-JavaScript-Attacks-Get-Slicker/ [eweek.com]

----

Rise Of The PDF Exploits:

http://www.trustedsource.org/blog/153/Rise-Of-The-PDF-Exploits [trustedsource.org]

----

ADOBE NEW FLAW DOES USE JAVASCRIPT PROOF:

http://www.shadowserver.org/wiki/pmwiki.php?n=Calendar.20090219 [shadowserver.org]

----

AJAX Poses Security, Performance Risks:

http://www.eweek.com/article2/0,1895,1916673,00.asp [eweek.com]

----

Web 2.0 Threats and Risks for Financial Services:

http://www.net-security.org/article.php?id=1004&p=1 [net-security.org]

http://www.cbronline.com/news/web_20_is_vulnerable_to_attack [cbronline.com]

----

Cross Site Scripting (GOOGLE) and WHY TO TURN OFF JAVASCRIPT:

http://www.cgisecurity.com/xss-faq.html [cgisecurity.com]

----

Why the FBI Director Doesn't Bank Online

http://it.slashdot.org/article.pl?sid=09/10/08/0327240 [slashdot.org]

====

MAJOR ATTACKS (only a small sample) of WHY LAYERED SECURITY IS NEEDED

Is the Botnet Battle Already Lost?

http://www.eweek.com/article2/0,1895,2029720,00.asp [eweek.com]

----

IT Pros Say They Can't Stop Data Breaches:

http://www.eweek.com/article2/0,1895,2010325,00.asp?kc=EWNAVEMNL083106EOAD [eweek.com]

----

Cyber Attacks On US Military Jump Sharply In 2009

http://tech.slashdot.org/comments.pl?sid=1452358&threshold=-1&commentsort=0&mode=thread&cid=30185742 [slashdot.org]

----

Bots Found Inside Many Big Companies:

http://blogs.baselinemag.com/security/content001/cybercrime/bots_found_inside_many_big_companies.html [baselinemag.com]

----

Bot master owns up to 250,000 zombie PCs:

http://www.securityfocus.com/news/11495 [securityfocus.com]

----

Bots surge ahead (2007):

http://www.securityfocus.com/brief/466 [securityfocus.com]

----

Chinese Hackers Hit Commerce Department:

http://www.informationweek.com/news/security/government/showArticle.jhtml?articleID=193105227 [informationweek.com]

----

CIA Admits Cyberattacks Blacked Out Cities:

http://www.informationweek.com/news/internet/showArticle.jhtml?articleID=205901631 [informationweek.com]

----

Compromised Banks and Investment sites list 2006:

http://it.slashdot.org/comments.pl?sid=233921&cid=19035679 [slashdot.org]

----

Dancho Danchev's Blog - Mind Streams of Information Security Knowledge: Massive IFRAME SEO Poisoning Attack Continuing:

http://ddanchev.blogspot.com/2008/03/massive-iframe-seo-poisoning-attack.html [blogspot.com]

----

Data at Bank of America, Wachovia, others compromised - May. 23, 2005:

http://money.cnn.com/2005/05/23/news/fortune500/bank_info/index.htm [cnn.com]

----

Fresh Security Breaches at Los Alamos:

http://www.msnbc.msn.com/id/19418769/site/newsweek/print/1/displaymode/1098/ [msn.com]

----

Infected job search sites lead to info theft for 46,000:

http://www.computerworld.com/s/article/9031139/Infected_job_search_sites_lead_to_info_theft_for_46_000 [computerworld.com]

----

New Mega-Botnet Discovered:

http://it.slashdot.org/article.pl?sid=09/04/22/2223214 [slashdot.org]

----

I think THAT list ought to "enlighten" ANYONE, as to why "layered security" is & has been considered largely to be "THE WAY TO GO", vs. that list above (which is only a SMALL %-age of what I can come up with in regards to threats online + their causes)... HOSTS files help protect vs. those, on several levels - DO consider their usage!

apk

Re:c++ is good (0, Flamebait)

Rik Sweeney (471717) | more than 4 years ago | (#30284554)

it's just sometimes, it's a resource hog.

A bad workman always blames his tools

Why bother? (0, Flamebait)

ickleberry (864871) | more than 4 years ago | (#30284314)

I actually wish JavaScript and other client-side browser scripting would be done away with completely, but JS is not a particularly 'good' language. The only advantage I can see is that thousands of Web developers can now write desktop applications. Is that necessarily a good thing? or will it just lead to more inefficient crapware?

Re:Why bother? (1)

causality (777677) | more than 4 years ago | (#30284570)

I actually wish JavaScript and other client-side browser scripting would be done away with completely, but JS is not a particularly 'good' language. The only advantage I can see is that thousands of Web developers can now write desktop applications. Is that necessarily a good thing? or will it just lead to more inefficient crapware?

I'm guessing there will be a few really good, well-written apps and all of the rest will either be blocked with NoScript or special tools/addons will be created for the sole purpose of selectively blocking (or whitelisting) them.

Re:Why bother? (5, Informative)

jellomizer (103300) | more than 4 years ago | (#30284702)

Yes lets put all the work on the server. The server should handle all formatting and every single error check and lets wait for the server to respond and reload the entire page to say something is wrong. Lets not have the ability to hide or move objects, because we need to reload the page over and over and over again... Never mind CPUs are Really fast and the standard Desktop has ton of memory. Lets fill up the slower bandwidth with reloading the same information over again.

Sorry your post is screaming, I am not comfortable with JavaScript and it is effecting my 7337 status. So I will insult it so I can seem like I am skilled programmer.

Re:Why bother? (4, Insightful)

Anonymous Coward | more than 4 years ago | (#30284980)

Mod parent up. Javascript, or ECMAscript gets a bad rap because a lot of code-pounders don't really know how to use it beyond defining a few c-style functions. It's a fairly powerful language once you understand the grammar. IE6 shoulders most of the blame for fucking it up - things that should work but need a bunch of ridiculous if(ie) incantations chase away most programmers from understanding the fundamentals of the language better. Once you realize that it's *even more* object oriented than Java(sun) then you begin to understand.

Re:Why bother? (4, Insightful)

SanityInAnarchy (655584) | more than 4 years ago | (#30284828)

I actually wish JavaScript and other client-side browser scripting would be done away with completely,

Why?

JS is not a particularly 'good' language.

People who say this very often don't know Javascript well at all. It's Lisp in C's clothing. It's actually a surprisingly elegant language -- it has a few warts, but they are almost certainly not what you're thinking of.

Google Douglas Crockford.

Re:Why bother? (5, Insightful)

ThatMegathronDude (1189203) | more than 4 years ago | (#30284914)

A-friggin-men. JavaScript is one of the few popular languages with first-class functions. How many JS-bashers have actually written something more than document.write() rubbish?

Javascript is actually a great language (5, Interesting)

BadAnalogyGuy (945258) | more than 4 years ago | (#30284318)

Dynamically typed, object-oriented, with features like lexical closures that are usually only found in advanced programming languages like Lisp, Javascript is really a great language that has gotten a bad rap.

It reminds me of the lowly tomato, a member of the poisonous nightshade family of plants, which for years was considered to be inedible. These days you can't get a salad without it. Things change when you realize how useful something actually is.

Re:Javascript is actually a great language (1)

pasadena (78404) | more than 4 years ago | (#30284408)

I never eat salad with tomatoes, and I avoid programming in JS where I can.

Re:Javascript is actually a great language (0)

Anonymous Coward | more than 4 years ago | (#30284414)

It reminds me of the lowly tomato, a member of the poisonous nightshade family of plants, which for years was considered to be inedible. These days you can't get a pizza without it.

Now get on your sockpuppet and give us all a good analogy.

Re:Javascript is actually a great language (0)

Anonymous Coward | more than 4 years ago | (#30284924)

Which years?

Re:Javascript is actually a great language (5, Insightful)

iamacat (583406) | more than 4 years ago | (#30284452)

Perhaps it's a great language, but it reduced modern Core i7 computers to performance of a 486, negating 15 years of computing revolution. Inability to perform CPU-intensive computations due to these dynamic types of yours, lack of threading or any other explicit or implicit parallelism support, no library facilities to modern 2D/3D graphics libraries. Javascript is a nice experimental language like so many others but it shouldn't be running 90% of mission-critical applications.

Re:Javascript is actually a great language (1)

TooMuchToDo (882796) | more than 4 years ago | (#30284596)

Javascript is a nice experimental language like so many others but it shouldn't be running 90% of mission-critical applications.

But alas, it's driving a majority of the web.

Re:Javascript is actually a great language (0)

Anonymous Coward | more than 4 years ago | (#30284906)

But alas, it's driving a majority of the web.

And we all know that "majority" == "good", right?

Re:Javascript is actually a great language (4, Interesting)

sydneyfong (410107) | more than 4 years ago | (#30284690)

- The speed issue is largely due to the crappy implementations of Javascript, which are improving due to competition among browsers. Javascript can be JIT-ed. What you probably can't do is compile it to native code and expect it to have the speed of C/C++. But then would *you* run arbitrary native binary code off the web? Sandboxing makes things slow again.

- I'll give you the lack of threading.

- 2D/3D libraries - C doesn't have one in its standard, C++ doesn't have one, in fact most don't. But you're free to implement one. It just doesn't make too much sense having a full fledged 2D/3D library in the browser, since that's where most javascript code are used in.

- experimental language, as in first appearing in 1995, used extensively for almost 15 years. Of course most people never really utilize its full power, but it's not the fault of the language

- And you use a "mission-critical application" written in Javascript running inside a web browser?

Don't ditch the language due to poor implementation and crappy users.

Re:Javascript is actually a great language (1, Interesting)

Anonymous Coward | more than 4 years ago | (#30284872)

Adding to performance issues comment: Javascript actually becomes *faster* if you make your variable names short... 'cause everytime you do a.x it actually does a['x'], or the fact that there are no "arrays"; a[1] does a['1'], or something similarly silly. Recently tried writing a 3d animation thingie [canvas], and it's painfully slow---stuff that shouldn't be slow [and isn't in something like plain-old Java].

I really really like Javascript itself [I'm a Perl coder, and *much* of javascript reminds me of Perl]; It's very flexible, and you can prototype and conceptualize anything in it with relative ease... but they've made quite a few stupid design decisions to make performance a major issue.

Re:Javascript is actually a great language (3, Interesting)

Ed Avis (5917) | more than 4 years ago | (#30284880)

1. Of course the CPU-intensive parts of an app (compression, encryption, database things like DBM or SQLite) are still in native code and Javascript is just a wrapper. 2. The new generation of Javascript engines (Google's V8, Mozilla's Tracemonkey, etc) are one or two orders of magnitude faster than the Javascript interpreters of a few years ago. Not nearly as fast as native code, of course, but certainly good enough for a lot of applications. 3. You're right that threading and parallelism is missing. And also it's true that there aren't enough language bindings to good graphics libraries, though of course the browser itself is a powerful 2D engine for many tasks. Also, have you looked at WebGL, a Javascript binding to OpenGL?

Re:Javascript is actually a great language (1, Interesting)

Anonymous Coward | more than 4 years ago | (#30284954)

Perhaps it's a great language, but it reduced modern Core i7 computers to performance of a 486, negating 15 years of computing revolution.

Actually of the scripting languages, JavaScript is one of the most optimizable. In particular everything-is-float lets interpreters and JITs have a simple fallback mode when they don't know if the value is an int or if it will overflow. They can also use fpu registers to store values, and interleave fpu and int operations.

For instance if you have like in Python an int32, unlimited precision decimals, complex, float that's 4 completely separate representations for 16 combinations of interactions for most math operators, which basically means a vtable-style indirect function call that can't be avoided unless all the types are known in advance. It also means in a complex formula changing any variable's type means the actual machine code has to change, whereas javascript can just convert the type to a float beforehand and use the same compiled code.

Re:Javascript is actually a great language (2, Insightful)

OverlordQ (264228) | more than 4 years ago | (#30284460)

Or maybe more like Oxygen, poisonous in high concentrations (re: pressures).

Re:Javascript is actually a great language (1)

XxtraLarGe (551297) | more than 4 years ago | (#30284466)

It reminds me of the lowly tomato, a member of the poisonous nightshade family of plants, which for years was considered to be inedible. These days you can't get a salad without it.

Javascript reminds you of tomatoes? My favorite salad [google.com] seldom seems to have tomatoes. I see how you got your nick name ;-)

What what most sites use Javascript for... (1, Insightful)

Viol8 (599362) | more than 4 years ago | (#30284476)

... the browser might just as well support GWBasic. However fancy javascript may be , it doesn't take the worlds most advanced scripting language to to do pop up windows ,mouseover events and selective loading.

Instead of trying to makd the browser a cut down OS as both MS and Firefox coders seem to be headed for, they should go back to basics and make the browser a simple reliable graphics display program with some user I/O thrown in. Not some bloated monstrosity that has all the reliability of a 20 year old unserviced Trabant. Having to support an ever more complex OO interpreted language doesn't help this reliability.

Re:Javascript is actually a great language (4, Interesting)

maraist (68387) | more than 4 years ago | (#30284482)

With no feature-set testing capability coupled with the intent of handing off raw code to 3rd party virtual engines. With no 'reference' platform to validate code (with such simple things as which string functions are supported) and no useful error messages when making language library mistakes (nor any type-safety to determine it out of the box). And with respect to dynamicity, no equivalent 'perl -c foo.pl', 'use strict', or '-warn' pragma. No package namespaces. No legitimate mechanism of loading 3'rd party library files, much less a way of namespace collision resolution/isolation. No defined order of execution (some run in-line, others run on browser completely loaded, etc).

I'd instead say that Javascript is a frustrating language that's gotten too much rep. The fact that people migrate towards 3'rd party libraries to standardize simple programming operations (like jQuery / GWT) is a testament to how bad it's legacy has gotten - when trying to do 'real' work.

Sure a command-line javascript can define it's own standard and I'm confident that it can solve all these problems.. That's the great thing about standards - everybody's got one.

Re:Javascript is actually a great language (4, Insightful)

Blakey Rat (99501) | more than 4 years ago | (#30284642)

I'd instead say that Javascript is a frustrating language that's gotten too much rep. The fact that people migrate towards 3'rd party libraries to standardize simple programming operations (like jQuery / GWT) is a testament to how bad it's legacy has gotten - when trying to do 'real' work.

jQuery (prototype, mootools, etc) solves shitty DOM implementations, not shitty Javascript implementations. In fact, I don't think jQuery addresses a single "lack" in Javascript-- I could be mistaken-- virtually everything, if not everything, it does is fixing DOM's bad design and browser's inconsistent implementation of it.

This is why Javascript gets a bad rap: pair it with DOM, and *any* language would look awful, because DOM is awful.

Re:Javascript is actually a great language (2, Insightful)

fulldecent (598482) | more than 4 years ago | (#30284990)

so when is dom2 coming out?

Lexical closures "advanced"? (1, Insightful)

Anonymous Coward | more than 4 years ago | (#30284518)

C'mon. Perl has them. Lua has them. Ruby has them. Sheesh -- even Python has them. I'd guess even PHP has lexical closures these days. Advanced? You just disqualified yourself. Under which kind of rock have you been living the last 30 years?

Besides, I'd rather compare Javascript to a Gingko fruit. The stink is similar ;-D

[wow: captcha was "discord". This slashcode is developing some prescient intelligence, I fear]

Re:Javascript is actually a great language (3, Interesting)

Blakey Rat (99501) | more than 4 years ago | (#30284542)

Most of Javascript's bad reputation come from the W3C's DOM. When the majority of programmers think "Javascript," they're actually thinking "Javascript + DOM," and since the DOM is so awful, they think Javascript is awful as well. Not so.

Pair Javascript with a decent library, and it's extremely powerful. Maybe not as suited for large projects as languages with namespaces, but its template system and introspection features are simply amazing. If anybody ever writes a program that evolves itself until it becomes super-intelligent and takes over the Earth, it'll probably be written in Javascript.

Correction to the parent, though: Javascript isn't an object-oriented language in the classic definition of the term... it lacks many features to make it truly OOP. Instead, it's based around object templating, which is nearly as powerful, but not the same thing.

Re:Javascript is actually a great language (1)

shutdown -p now (807394) | more than 4 years ago | (#30284992)

Correction to the parent, though: Javascript isn't an object-oriented language in the classic definition of the term... it lacks many features to make it truly OOP.

Today, OOP is generally considered to encompass prototype-based programming as well. If you mean "classic definition" as defined by Simula and Smalltalk, then it makes sense, but it hasn't been used as such for ages (since Self).

Re:Javascript is actually a great language (3, Informative)

slug359 (533109) | more than 4 years ago | (#30284558)

Here's my three favourite language flaws, which make the language nearly unusable for non-trivial projects:
  • Variables are global by default, leading to accidental memory leaks, conflicts and various other fun things.
  • A lack of namespaces.
  • Lack of block scope (despite the fact the language has blocks), i.e:

    function a() {
    var b = 1;
    {
    var b = 2;
    }
    alert(b);
    }

    will alert 2.

Re:Javascript is actually a great language (1)

sproketboy (608031) | more than 4 years ago | (#30284618)

Huh?

        var a = "false";
        if (a) {
                alert("a is true?");
        }

Evil type coercion is a foundation principle of this shitty language.

Re:Javascript is actually a great language (2, Informative)

Rayban (13436) | more than 4 years ago | (#30284842)

All strings coerce to boolean true in JS, as they do in C (with the exception of the empty string):

char* a = "false";
if (a) {
    printf("a is true?\n");
}

In fact, most values coerce to true except integer zero, NaN, undefined, null and empty string.

Re:Javascript is actually a great language (4, Interesting)

mcrbids (148650) | more than 4 years ago | (#30284640)

Javascript makes many hard things simple, and many simple things hard.

Need to find out what the user typed in box foo? While most client libraries require fairly detailed memory schemes in order to keep track of which box is which, Javascript reduces all that to getElementById(); - a win in any programmer's book!

But in the reverse, what about trimming that input? The offense to the mind that you have to use a USER DEFINED FUNCTION for trimming just boggles the mind. Sure, there are libraries for this, blah blah but still, the truth remains that there is no trim() function. The lack of any kind of meaningful class structure makes the special word "this" almost worthless because you can't be sure consistently what it's referring to. (yes, it is possible to figure it out, but why should you have to?) If you delete an array key directly with the delete command, eg: `delete myArray[4];` the length property doesn't get updated even though the number of elements in the array does. (WTF?!?!)

So javascript has its warts. Lots and lots of them. It is clearly a hacked-together language that is only successful because of its ubiquity, which is the same reason why it evolves so extremely slowly, which is why we still have to manually implement things like trim(), and why so many of us are doomed to deal with javascript with all of its warts.

Javascript, however, has been free of the browser for some time, due to the Mozilla's JS engine being modular. They call it spidermonkey, and I actually considered using it as a replacement for PHP on the server side in order to keep langauages consistent. Unfortunately, nobody's embedded it into Apache as a module (with any kind of stability) so this means that js scripts would have to run as separate executables, which causes all kinds of performance and security problems.

Re:Javascript is actually a great language (1)

gbjbaanb (229885) | more than 4 years ago | (#30284762)

and I actually considered using it as a replacement for PHP on the server side in order to keep langauages consistent.

I always thought that would be a good thing - consistency in language means you don't have to learn 5 or so to do meaningful work. Unfortunately, whilst MS appears to agree with me (everything in C#), the rest of the world doesn't. So until we get a javascript world takeover, we'll be stuck with PHP, Perl, Python and Java server-side systems. I'd love for one to win, and JS may as well be the one as its used almost exclusively on the client side too.

(BTW, deleting an array element may reduce the number of elements in the array, but doesn't delete the storage allocated to it - that's probably an optimisation, and isn't such a bad thing).

Re:Javascript is actually a great language (1)

FunkyELF (609131) | more than 4 years ago | (#30284936)

Bad idea. The fact that you have to use different languages separates domains as they should be.
Django does something similar by using a templating language that is not Python and runs in a different context.
I feel that if you start putting JS on both client and server you'll start to blur the line between client and server and make the code much harder to read. You'll start using some of the same routines in both client and server. With separate languages you make sure that those types of things are only done once, in the correct place.

Re:Javascript is actually a great language (1)

Blakey Rat (99501) | more than 4 years ago | (#30284776)

Need to find out what the user typed in box foo? While most client libraries require fairly detailed memory schemes in order to keep track of which box is which, Javascript reduces all that to getElementById(); - a win in any programmer's book!

That's DOM, not Javascript.

But in the reverse, what about trimming that input? The offense to the mind that you have to use a USER DEFINED FUNCTION for trimming just boggles the mind.

That's a lack in DOM, not a lack in Javascript.

So javascript has its warts. Lots and lots of them. It is clearly a hacked-together language that is only successful because of its ubiquity, which is the same reason why it evolves so extremely slowly, which is why we still have to manually implement things like trim(), and why so many of us are doomed to deal with javascript with all of its warts.

No, Javascript is very nice. DOM is a piece of shit. Pair any language with DOM, and you'll think that language sucks.

What makes me sad is how many Slashdotters don't know the difference between the language and the libraries. DOM is nothing but a set of libraries-- you could code DOM in C#, Python, Java, whatever.

Saying DOM sucks says nothing about Javascript.

That said, this:

The lack of any kind of meaningful class structure makes the special word "this" almost worthless because you can't be sure consistently what it's referring to.

Is actually a language issue. Most people solve it by using the dumb workaround "var that = this" in their objects. That gives you a consistant "this", but it's kind of a retarded work-around.

If you delete an array key directly with the delete command, eg: `delete myArray[4];` the length property doesn't get updated even though the number of elements in the array does. (WTF?!?!)

That one I can't speak to... interesting if true.

Re:Javascript is actually a great language (3, Insightful)

TheRaven64 (641858) | more than 4 years ago | (#30284666)

JavaScript is a Self dialect with ugly syntax, a broken model for unboxed numeric values, monumentally broken semantics for closure evaluation, and no sensible second-chance dispatch mechanism. Oh, and all current JavaScript implementations are slower than the Self VM from a decade ago.

Apart from that, it's a great language.

Re:Javascript is actually a great language (1)

Rogerborg (306625) | more than 4 years ago | (#30284830)

It reminds me of the lowly tomato, a member of the poisonous nightshade family of plants, which for years was considered to be inedible. These days you can't get a salad without it.

That's not even remotely true. When I'm driving a car load of drunken cheerleaders to the abortion clinic, and I stop off at McDonalds, I enjoy an unequivocal Constitutional right to shoot the McMonkey in the balls if he puts tomato in my salad after I've told him not to.

Re:Javascript is actually a great language (1)

DoofusOfDeath (636671) | more than 4 years ago | (#30284854)

Dynamically typed, object-oriented, with features like lexical closures that are usually only found in advanced programming languages like Lisp, Javascript is really a great language that has gotten a bad rap.

I for one wish JS have the same broad success as Lisp!

Re:Javascript is actually a great language (0)

Anonymous Coward | more than 4 years ago | (#30284858)

Should bring in Eminem to help that bad rap...

Re:Javascript is actually a great language (0)

Anonymous Coward | more than 4 years ago | (#30284864)

"with features like lexical closures that are usually only found in advanced programming languages"

You mean like Visual Basic?

http://msdn.microsoft.com/en-us/library/cc441753.aspx [microsoft.com]

I can't wait. (1)

NoYob (1630681) | more than 4 years ago | (#30284874)

I can't wait for when this language first moves out of the browser, then we'll get coders wanting to beef up their resumes with the "latest technology" and they'll be implementing everything in JavaScript.

System architect: "Here's my design. It will work in any language."

Coder wanting to add a notch to his belt: "I know just the thing for this distributed ERP system: JavaScript! It's the latest technology and we'll be cutting edge.

The architect - who hasn't been keeping up with languages and thinks Java and JavaScript are one in the same: "Sounds great."

Oh, yeah! There's a team I would want to contract on - billable hours gallor!

Re:Javascript is actually a great language (1)

shutdown -p now (807394) | more than 4 years ago | (#30284970)

Dynamically typed, object-oriented, with features like lexical closures that are usually only found in advanced programming languages like Lisp, Javascript is really a great language that has gotten a bad rap.

Great language? Let's see:

function foo(x) {
    var y = 123;
    if (x > 0) {
        var y = 456;
    }
    write(y); // 456!
}

I think I see why it has gotten a bad rep now. And no, it's not all just about DOM (though that certainly played a part).

Don't get me wrong, some of the ideas in JS are great (though in all cases it wasn't the one to pioneer them). But their implementation in this wannabe C-style language is not. If you want to see a neat and really well designed language built on the same ideas, see Lua.

JavaScript broke out a long time ago (1)

icepick72 (834363) | more than 4 years ago | (#30284332)

JavaScript is already out of the browser, but unofficially or rather unstandardized. Look at languages such as JavaScript in Flash, or the use of JavaScript in Acrobat PDF Reader, etc. Microsoft allowed their JScript (variant of JavaScript) to be used on the server side years ago in classic Active Server Pages - so I coded JavaScript on the server several years back.

However I am in support of a more official representation of JavaScript on the server.

Re:JavaScript broke out a long time ago (1)

dpilot (134227) | more than 4 years ago | (#30284648)

> However I am in support of a more official representation of JavaScript on the server.

I suspect that part of the thrust here is migration of server CPU cycles to client CPU cycles. Server CPU cycles are typically planned, purchased, tracked, and constrained. Client CPU cycles are typically wasted. The "cheap box" today at the local big box retailer has more CPU power than a scientific mainframe of not that long ago. Most of that compute power is spent waiting for the user to press a key or move the mouse.

It's a classic case of "Somebody Else's Problem." Make my CPU cycle constraints into SEP, except that in this case Somebody Else isn't likely to notice - they'll even like it, assuming it improves their web experience.

Re:JavaScript broke out a long time ago (1)

bluesatin (1350681) | more than 4 years ago | (#30284716)

Look at languages such as JavaScript in Flash [..]

I wouldn't say JavaScript = Actionscript; they're both descendants of ECMAScript [wikipedia.org] .

Re:JavaScript broke out a long time ago (1)

Blakey Rat (99501) | more than 4 years ago | (#30284878)

Look at languages such as JavaScript in Flash,

Flash doesn't use Javascript, it uses Actionscript. Both are based on the ECMAScript standard, but Actionscript 3 is actually pretty far-removed from Javascript now. (Actionscript 2 is much closer.)

Anyway, I get what you're saying, it's just that Adobe's version is modified quite a bit.

My thoughts (3, Funny)

davidbrit2 (775091) | more than 4 years ago | (#30284338)

As somebody who's attempted to write object-oriented Javascript code, my response would be GOD NO.

Re:My thoughts (0)

Anonymous Coward | more than 4 years ago | (#30284394)

Yeah, and your ford fiesta isn't good at towing a boat either.

Re:My thoughts (4, Insightful)

rayharris (1571543) | more than 4 years ago | (#30284472)

JavaScript uses a different type of object than you're used to. JavaScript uses prototype-based objects whereas most other languages use class-based objects. I've seen a lot of work put into developing "class-like" objects in JavaScript and I've wondered why they just didn't learn to write code using prototypes instead.

Re:My thoughts (1)

TheNinjaroach (878876) | more than 4 years ago | (#30284578)

Umm, Javascript is great for object-oriented programming. I don't think you are using it properly..

Beyond What? (1)

Monkeedude1212 (1560403) | more than 4 years ago | (#30284344)

No one can deny JavaScript's usefulness on the front end of the web, but if you're a developer do you support the efforts to move it beyond that?"

If I've got Javascript on the front end, and say Java working the back end... How much more Java can I get? I'm a developer and I can't think of anything MORE front then the front end...

If you're talking about Taking Javascript and making it more integrated with the actual web page display, AJAX already handles most of that. We don't need Javascript to become like PHP, where you're using PHP to write your HTML inside of your PHP script tag inside of an HTML body.

Re:Beyond What? (1)

BiggerIsBetter (682164) | more than 4 years ago | (#30284480)

If I've got Javascript on the front end, and say Java working the back end... How much more Java can I get? I'm a developer and I can't think of anything MORE front then the front end...

If you're talking about Taking Javascript and making it more integrated with the actual web page display, AJAX already handles most of that. We don't need Javascript to become like PHP, where you're using PHP to write your HTML inside of your PHP script tag inside of an HTML body.

1) JavaScript is not Java,despite the name.
2) You can get lots more Java if that's what you want.
3) Are you a developer, or a guy who makes web apps?
4) The OS desktop is MORE front than the front end of your web app running inside a browser.
5) PHP (and JSP among others) doesn't have to be written like that.

Difference? (1)

TheNinjaroach (878876) | more than 4 years ago | (#30284598)

3) Are you a developer, or a guy who makes web apps?

Wait, since when is there a difference? I consider myself a developer, but my applications are only available on the web..

Re:Difference? (1)

BiggerIsBetter (682164) | more than 4 years ago | (#30284650)

Wait, since when is there a difference? I consider myself a developer, but my applications are only available on the web..

The difference is really understanding the technologies you're using, the context you're using them in, and effective ways to use them. I didn't get the impression that the OP necessarily had that understanding.

Re:Beyond What? (1)

Monkeedude1212 (1560403) | more than 4 years ago | (#30284732)

1) There are enough similarities between the two to associate them together. Obviously one is a script and the other is not, so Java needs to be compiled and you have to watch your syntax more in Javascript. But the way I declare and use my variables is most similar to the way I would handle them in Java as opposed to VB.

2) Yes I've written a GUI in Java, wrote the back end in Java, etc etc, and no, thats not what I want. It's not fun.

3) I actually only maintain web apps on occaison, most of my hobbying is spent inside C++ or C#.

4) Dear God, the idea of an OS being built on Javascript (given its massive exploitation) is a terrible idea. I hope it never comes to that.

5) I know. But about 50% of "developers" out there aren't ever looking at their own code. So they have to be able to handle that kind of shit when it comes up. And believe me, SOMEONE WILL write it like that.

Clueless (1)

TheNinjaroach (878876) | more than 4 years ago | (#30284506)

If I've got Javascript on the front end, and say Java working the back end... How much more Java can I get?

Repeat after me: Javascript is not Java. Don't confuse the two, they are completely different technologies.

Re:Clueless (1)

Monkeedude1212 (1560403) | more than 4 years ago | (#30284624)

I know that, everyone knows that. One is a scripting language where the other one needs to be compiled before running and blah blah blah yes we know. But there are obviously more similarities between Java and Javascript then say Javascript and C#.

Re:Clueless (1)

BiggerIsBetter (682164) | more than 4 years ago | (#30284742)

But there are obviously more similarities between Java and Javascript then say Javascript and C#.

List some of them.

Re:Clueless (0)

Anonymous Coward | more than 4 years ago | (#30284860)

In name, certainly. That's about it.

Re:Clueless (1)

riegel (980896) | more than 4 years ago | (#30284838)

Woooosh

Damn straight! (1)

ckaminski (82854) | more than 4 years ago | (#30284348)

I've been a big user of BSH ever since it came out, and before that a hacked Rhino/Spidermonkey fan for building system automation components that were scriptable via javascript.

I say bring it on.

Re:Damn straight! (1)

Bauguss (62171) | more than 4 years ago | (#30285018)

excuse the ignorance but BSH? googled it but too vague.

JavaScript should stay in its niche (1)

CodeBuster (516420) | more than 4 years ago | (#30284440)

While JavaScript has a good thing going with the web scripting niche, it has a long road to catch up with established players in the heavyweight "everything and the kitchen sink" language category currently filled by C# and Java. It is very difficult to see mainstream platform developers selecting JavaScript as their general purpose language in favor of C#, Java, or even C or objective C (for the Linux and Mac developers respectively). JavaScript would do better to reduce its footprint and burnish its credentials as a web scripting language because that is what we need it to be; after all, we already have good languages in the general purpose category that are NOT suitable for web scripting.

Re:JavaScript should stay in its niche (1)

TheRaven64 (641858) | more than 4 years ago | (#30284720)

C or objective C (for the Linux and Mac developers respectively)

Some of us use Objective-C on Linux (or, in my case, FreeBSD) too. It even works on Windows...

Getting JS out of the browser is a *great* idea. (5, Interesting)

Karellen (104380) | more than 4 years ago | (#30284446)

Javascript is a beautiful, elegant, small and generally well-formed language. It has a couple of warts, but what language doesn't.

However, the way that Javascript interacts with web browsers, web pages and all other things web-like is a disgusting, crufty, bloated piece of shit. The DOM bindings are horrible, as far as they go, and they're woefully incomplete. The browser deficiencies in their implementations of the DOM bindings, and the browser-specific work-arounds needed to circumvent said deficiencies, are Lovecraftian nightmares.

(The willful violation of the javascript object model for document.all in HTML5 [w3.org] (see bottom of page) is one particularly nasty example of what the web has done/is doing to Javascript. If you know the JS object model well, think about what that violation really entails, and what it would take to write that special case into a JS engine, for one particular property, of one particular object, if you happen to be running in a particular environment (browser))

Getting Javascript out of the browser would be the best thing that could possibly happen to Javascript.

Re:Getting JS out of the browser is a *great* idea (2, Insightful)

Anonymous Coward | more than 4 years ago | (#30284674)

The idea of Javascript is nice. In practice it's hardly what you describe.

Consider how closures work in Javascript. It's totally retarded and the scoping doesn't work like you think it would.

Lua [lua.org] has basically the same semantics as Javascript but it much simpler, faster, and you get a better design (eg. closures work like they should). Lua is a better Javascript than Javascript.

Re:Getting JS out of the browser is a *great* idea (1)

plague3106 (71849) | more than 4 years ago | (#30284710)

I agree; JS should be taken out of the browser... but not how the article suggests. It should NOT be brought to the desktop, and it should be obsoleted in the browser.

Its a steaming pile who's replacement is long overdue.

Scripts are fine for small mundane tasks, they're NOT good for building applications.

Re:Getting JS out of the browser is a *great* idea (1)

BradleyAndersen (1195415) | more than 4 years ago | (#30284836)

What is the difference between a 'script' and an 'application'?

Re:Getting JS out of the browser is a *great* idea (1)

lhoguin (1422973) | more than 4 years ago | (#30284902)

Javascript is already used for building desktop applications, the most popular probably being Firefox.

Many desktop applications already use scripting languages. For example see the following list of python gtk applications [pygtk.org] .

Nowadays you can easily write the parts of an application that requires high performance in C and the rest of the program, including the interface, in an interpreted language.

The problem Javascript has to face, though, is that it has very few libraries available for desktop or web applications. And the existing libraries are specifically written for one or the other task. CommonJS would be a common library for all environments and would allow porting code from one to another a lot more easily than it is today.

i'm not so sure about this. (1)

Overunderrated (1518503) | more than 4 years ago | (#30284450)

KILL IT WITH FIRE

Better Idea (2, Insightful)

physicsphairy (720718) | more than 4 years ago | (#30284462)

I think everyone can agree what we really need is web-executable COBOL.

Re:Better Idea (1)

dkleinsc (563838) | more than 4 years ago | (#30284746)

You mean like this [coboloncogs.org] ?

Re:Better Idea (0)

Anonymous Coward | more than 4 years ago | (#30284784)

it exist go there http://www.legacyj.com/

Javascript... (1)

spidercoz (947220) | more than 4 years ago | (#30284470)

the Johnny Knoxville of programming languages

A huge pain (4, Insightful)

mafian911 (1270834) | more than 4 years ago | (#30284488)

I'm not sure why anyone would want JavaScript anywhere else. I believe that the only reason why JavaScript is "popular" in the first place is because it is the only option available for client-side processing on the web.

A lot of the pain of JS, like its inconsistent experience across browsers, can't really be held against it. Each browser has to implement JS according to its own interpretation of the standard, virtually guaranteeing a non-consistent experience across the board. I understand that. But what truly kills JavaScript for me is the lack of development tools and a solid reference. Debugging JS with an alert window is a horrible experience.

Again, why anyone would want this stuff everywhere is beyond me. I was shocked a long time ago when Palm Pre decided it was a good idea to use JavaScript for app development. Shocked I tell you. And look where that went. Like I said, the only reason I would consider JS "popular" on the web is because there is no other way to do client-side processing. It's literally our only choice (VBScript doesn't count).

Re:A huge pain (1)

jeti (105266) | more than 4 years ago | (#30284678)

And I was under the impression that graphical JavaScript debuggers were provided with InternetExplorer and Chrome and available as an addon for Firefox. Silly me.

Re:A huge pain (1)

mafian911 (1270834) | more than 4 years ago | (#30284812)

Silly you indeed. I would hate to use 3 different debuggers for every bit of code I write, to make sure it works on every platform.

God forbid MORE browsers become popular. Oh wait, Safari? Opera? I wonder if they have 2 more debuggers you can heap onto your development checklist.

If you enjoy having to debug your JS using multiple different debuggers, silly silly you indeed.

Re:A huge pain (1)

jeti (105266) | more than 4 years ago | (#30284928)

Pure JavaScript code performs the same in any modern browser. Only interactions with the DOM have to be tested separately for IE. In my experience, the more complex a JS application becomes, the less code deals with the DOM and has to be tested on two platforms.

Re:A huge pain (1)

sydneyfong (410107) | more than 4 years ago | (#30284788)

I think the problems you've described are (among other things) what the article proposes to fix.

Good luck with that. (1)

ears_d (1400833) | more than 4 years ago | (#30284576)

As a Java coder who wants to go back to C++ I'm appalled. But, as a developer who gets beat up over the cost of my work, I can see that a scripting language could lower costs. It's not for me though.

Script Engine out of the Browser? (1)

decipher_saint (72686) | more than 4 years ago | (#30284590)

Sure a JavaScript engine may have shipped on "every computer ever" but it's been embedded into a browser. So the next step is to decouple it from that browser-based engine and use it to create local apps?

What would you run this script engine in? A Virtual Machine? Some kind of embedded OS Framework? A behind-the-scenes browser instance (shudder).

Either way, I don't get it, what magical app could I write only with JavaScript that I couldn't write with something else? Actually I do kind of get it, there are probably a lot of JavaScript hackers out there that would want to write desktop apps but are afraid to jump into something like Java or .NET.

Re:Script Engine out of the Browser? (0)

Anonymous Coward | more than 4 years ago | (#30285014)

> What would you run this script engine in?

SEE: A Simple ECMAScript Engine [adaptive-e...ses.com.au]

Can your language do this (3, Interesting)

asc99c (938635) | more than 4 years ago | (#30284612)

A lot of the comments are pointing out the problems in Javascript, and ignoring the problems in the big heavyweight languages like Java and C#.

It's not really in praise of Javascript, but a very good read is Joel's article 'Can Your Programming Language Do This?' It accurately points out a number of ways in which Java development very quickly takes up a lot of lines of code compared to more lightweight approaches. I personally prefer the light weight approach for many applications.

http://www.joelonsoftware.com/items/2006/08/01.html [joelonsoftware.com]

Re:Can your language do this (0)

Anonymous Coward | more than 4 years ago | (#30284938)

It's not very lightweight if you had to code the browser around it.

With Java or C# you have the tools to build pretty much anything, but that's just it, just the tools. With JavaScript everything is abstracted, you don't need to know anything about sockets, HTTP requests or libaries to make a web service call. That's why a lot of people like it I suspect, you don't need to work out the details for anything within the limited world of JavaScript but you can quickly build an application with it (kinda like MS Access back in the day).

The trouble is if you take the JavaScript out of the browser you are going to end up needing some kind of library support to get things done and you'll be in the exact same boat as Java or C# (just with a crummier language).

Crimes against humanity (1)

Mongoose Disciple (722373) | more than 4 years ago | (#30284614)

I don't think it's fair to call JavaScript a crime against humanity -- most humans aren't software developers...

Re:Crimes against humanity (1)

Lord Ender (156273) | more than 4 years ago | (#30284694)

Most humans do have to wait on javascript to load. And they have to deal with its popups.

It has potential... (1)

LitelySalted (1348425) | more than 4 years ago | (#30284672)

I would say that JavaScript has potential, just like Luke Skywalker. Both had the ability to do great things and both had/have the ability to do terrible things.

Question is... who is.. Who's JavaScript's father? And will he lead him down the dark side?

Works for what it's supposed to do (3, Insightful)

gestalt_n_pepper (991155) | more than 4 years ago | (#30284676)

It's a tolerable front end language for browsers. It's not as flexible or as fast as C++, but here's a newsflash to the "I'm living in Mom's basement crowd." It doesn't have to be.

It can suck up resources and not be especially fast and not be able to manipulate pointers or be much good for creating new classes and....

(sing it with me now) IT DOESN'T MATTER AND 99.99% OF WEB DEVELOPERS DON'T CARE.

Not all languages are C++, or Ruby, or Java or anything. Nor should they be. Use the right tool for the right job.

No!! (1)

mafian911 (1270834) | more than 4 years ago | (#30284754)

What have you done?! Put it back! Put it BACK!

Javascript: The Good Parts (3, Informative)

slim (1652) | more than 4 years ago | (#30284792)

This is the book that'll make you realise Javascript is OK:
http://oreilly.com/catalog/9780596517748 [oreilly.com]

It's not afraid to call out the bad parts, and to show you how to work around them. That's down to a rushed standardization process.

It doesn't deal with the DOM at all - after all, that's not part of JS.

It leaves you thinking JS is pretty neat, if you use it right.

Hell NO! (0)

Anonymous Coward | more than 4 years ago | (#30284808)

This is madness!... This is Javascript!

Great, maybe it will help (0)

Anonymous Coward | more than 4 years ago | (#30284820)

I fully support running JavaScript outside the browser. I think that will only drive more optimization and fixes. My main problems with JavaScript come from the fact that it is running in the browser and the interactions with DOM and security considerations that brings.

I really wish the browsers provided more detailed controls for configuring the JavaScript environment so I could tune it to my tastes and kill any naughty scripts.

Cross Compatibility (1)

Tarlus (1000874) | more than 4 years ago | (#30284840)

Just make the damn thing behave exactly the same way in every browser and I'll be sound as a pound!

Is it just me or... (0)

Anonymous Coward | more than 4 years ago | (#30284944)

I work with PHP and Javascript/HTML all day long, and for anything beyond simple Javascript effects with AJAX, and some form manipulation, I find it to be an annoying bitch.

Compared to the simplicity of PHP, it just seems to get in the way of regular web development. I think it's mainly because you have to worry about casting your numbers to strings and things like that. I love how PHP lets you concatonate strings with '.' or add things together with a '+', whereas in Javascript, you're always using the '+' for both concatination and addition, and it just gets all ambiguous and tedious.

In PHP, it just seems to work, whereas Javascript, I spend too much time hunting around, trying to figure out why an event (like a button click) isn't triggering.

I think if you're developing large frameworks, or just more critical code in general, then sure Javascript's advanced features will pay off for you, but for general web development where you just "need to get things done", I wouldn't want to use it much more than I have to.

wrong way of thinking about the issue (1)

circletimessquare (444983) | more than 4 years ago | (#30284964)

the browser is the os. or rather, the browser will become the os. anything and everything of any value to 99% of us in the modern internet-centered world will be interacted with through the browser

so instead of talking about jailbreaking javascript, the more relevant subject should be jailbreaking the browser. such that when joe user turns on his computer in 2015, he gets a browser, and only a browser, and nothing but a browser. native javascript implementation then continues merrily chugging along in the browser, as it always has, otherwise completely oblivious to the fact that it is now the only game in town

note that i'm talking about the computer using experience for the average user. please don't object to my depiction of this scenario from the point of view of the exotic user blocks that plenty of slashdot readers belong to, but don't describe the reality of computer use for the average user

Your bias shows: You can't program shit! (3, Interesting)

Hurricane78 (562437) | more than 4 years ago | (#30284984)

If you think JavaScript is a crime against humanity,

In other words “If you can’t program, or if you can’t tell JavaScript from Java or Python,”.

The new versions of JS are really sweet. But most “web-developers” can’t even write proper code in the old one. Which is quickly visible, if you enable strict warnings, and force the interpreter to the newest version. Most scripts throw warnings or fail after that.

I say JS and Python are on par with each other. But they use very different paradigms. JS uses prototypes. And that is what most people do not understand. See it like this: Everything is an object (including functions, which allows really powerful functional programming), everything can be written literally (including objects with functions), and everything has a prototype on which it is based and can be the prototype for other objects/prototypes.

So you build your object, and then use it as a prototype to create other objects with added functionality or changed data.
The elegance of this is, that inheriting and instantiation really becomes the same thing. And in my eyes, the less rules a language needs, while still having all the power, the better and more elegant it is.

It’s crazy how, with the newest version, I can write it nearly 1:1 like I would write it in Haskell! You can’t imagine how happy I was, when I noticed that I would practically a “scriptable Haskell in the browser”. Of course it does not have the type strictness of Haskell. But that is kinda the point.

It even has regular expression literals.

What’s a bit messy, is DOM. Perhaps because it’s a “design by committee with no own sense of reality” (= no leadership) API.

Then again, I’m all for more languages in the browser. Python, Ruby, Lua, Erlang, Haskell and Java are good candidates. C/C++ and Perl are not. (Perhaps Perl 6 in 2051. ^^)

Spinal Tap coders (1)

ubrgeek (679399) | more than 4 years ago | (#30285020)

> efforts to take JavaScript to the next level

This one goes to 11.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?