By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

discuss: is javascript sucks or not ?

P: n/a
Hi,
often I see people telling that "javascript sucks"

- is it because of the DOM with JS ?
- is it because of the language in itself ?
- is it because browsers/hosts differences ?
- is it because of language limitation ?
etc.

please don't turn this into a flame/troll war,
I just want to know what are the REAL reasons/arguments
behind that "javascript sucks" thing

I care only about technical argumentation, if you're just thinking
that js does sucks because you remotely heard someone saying that
but have no idea why well move away from this thread.

For my part I don't think JS sucks at all,
I'm just curious to know the reasons of that kind of assert
that's all :)

zwetan
Sep 23 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
zwetan wrote:
Hi,
often I see people telling that "javascript sucks"

- is it because of the DOM with JS ?
- is it because of the language in itself ?
- is it because browsers/hosts differences ?
- is it because of language limitation ?
etc.

please don't turn this into a flame/troll war,
I just want to know what are the REAL reasons/arguments
behind that "javascript sucks" thing

I care only about technical argumentation, if you're just thinking
that js does sucks because you remotely heard someone saying that
but have no idea why well move away from this thread.

For my part I don't think JS sucks at all,
I'm just curious to know the reasons of that kind of assert
that's all :)

zwetan


Hi,

Mainly noobs write that.
They try something, it doesn't work as they expected, and start spitting out
subjects like that.
Just be patient and educate them.
Remember many people who start coding JS come from a designbackground, non
technical people.
And of course JS doesn't suck. :-)

Just my 2 cents..

Regards,
Erwin Moller
Sep 23 '05 #2

P: n/a
Javascript suck mainly because it's like a Scheme clone with Java
syntax tacked on and that is a horrible combination.

Sep 23 '05 #3

P: n/a
I may not say javascript sucks...but there are a few disadvantages to
it....I'm not a javascript programmer...but i try my stuff with
it...and to tell you the truth it's easy to have errors for weird
reasons...basically because u moved to a different browser.

It's totally client side and that's where the majority of the problems
come from. But all in all it's a good tool and a quick method for form
validations and quick lil effects. So it doesn't suck all
together...there are the pros and cons to it.

Regards,
Gerard.

Sep 23 '05 #4

P: n/a
Kris Cipa wrote:
Javascript suck mainly because it's like a Scheme clone with Java
syntax tacked on and that is a horrible combination.


It is a very good combination. JavaScript is the first lambda language
to go mainstream.

http://www.crockford.com/javascript/javascript.html
Sep 23 '05 #5

P: n/a
Gerard <ca********@gmail.com> wrote:
I may not say javascript sucks...but there are a few disadvantages to
it....I'm not a javascript programmer...but i try my stuff with
it...and to tell you the truth it's easy to have errors for weird
reasons...basically because u moved to a different browser.


That's the fault of browser vendors (M$ and "Think Deranged" Apple),
not the language.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Sep 23 '05 #6

P: n/a
"Douglas Crockford" <no****@sbcglobal.net> wrote in message
news:nB*****************@newssvr11.news.prodigy.co m...
Kris Cipa wrote:
Javascript suck mainly because it's like a Scheme clone with Java
syntax tacked on and that is a horrible combination.


It is a very good combination. JavaScript is the first lambda language to
go mainstream.


I agree completely... but maybe "going mainstream" isn't the best argument.
Look at some of the crap that's gone mainstream:

Professional wrestling, Botox, disposable cell phones, Britany Spears,
Reality Television, Buying Stocks on Margin, Designer Clothing for Dogs,
Deeply spiritual Eastern religious symbols being tattooed on idiots because
"Dude, that looks wicked!", using the words "architect", "transition" and
"Impact" as verbs, etc.

JavaScript is great... but the mainstream often isn't. ;^)

Jim Davis


Sep 23 '05 #7

P: n/a

Jim Davis wrote:
I agree completely... but maybe "going mainstream" isn't the best argument.
Look at some of the crap that's gone mainstream:

Professional wrestling, Botox, disposable cell phones, Britany Spears,
Reality Television, Buying Stocks on Margin, Designer Clothing for Dogs,
Deeply spiritual Eastern religious symbols being tattooed on idiots because
"Dude, that looks wicked!", using the words "architect", "transition" and
"Impact" as verbs, etc.

JavaScript is great... but the mainstream often isn't. ;^)

Jim Davis

That's deep dude, let's architect a new language to transition to a new
era and better impact all the new programmers!

Sep 23 '05 #8

P: n/a
zwetan wrote:
I just want to know what are the REAL reasons/arguments
behind that "javascript sucks" thing


JS, as a language, doesn't suck, IMO. It certainly has its drawbacks, and
it's a simpler language than some programmers are used to, but it does the
job. I certainly would never pick it for server-side development, just as I
would never pick VB if given the choice.

I would say there are a number of arguments for the statement of "writing
javascript for a web-browser environment on the internet sucks", though.
For example,

1) There is no concept of "this will always work" like other languages. In
other languages, such as Java, if you're using JDK1.2, you know you'll have
certain things available to you, and you have very specific and detailed
documentation about how it will work. With javascript, you never know for
sure what will work and what won't, and there's no specific and detailed
information about it.

2) Debugging is a pain.

3) Javascript!=DOM, but for most people they are conjoined twins. And since
DOMs differ and specific documentation about them is hard to come by, the
conclusion is often that javascript sucks.

4) Unlike most other languages, it is hard to find good, solid examples of
javascript programming done right. Bad code is everywhere. And some of it is
really, really bad. For many other languages, you can find a good reference
that details how to do things correctly. Such references for javascript are
almost non-existant.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 24 '05 #9

P: n/a
After many years of C++ programming I encountered Javascript. Of
course it wouldn't do what I wanted it to and I had no idea how to
debug it so for a year I said "Javascript sucks". Now, thanks to this
group and daily exposure to it, I find it to be ah, delightfully
challenging.

I think you've pretty much nailed it, Matt. Also, I think the poster
who said it was a combination of Scheme and Java has it wrong. It is
only a Java-like syntax in the parts that Java has taken from C.

Sep 24 '05 #10

P: n/a
zwetan schrieb:
Hi,
often I see people telling that "javascript sucks"


Well, I think many people hate JS because of the common use of JS. There are too
many pages in the web filled with useless and buggy JS, mostly without any
advantage to the user but with lots of incompatibilities. So I think, most
people syaing something like "JS sucks" mean primarly "The common abuse of JS
sucks".

IMHO in many cases there's no real alternative to JS for some things (OK, you
can use Java-Applets too, but oftenly, these would be oversized). So on the
right place and the right use, it's a really good thing. But on some sites, it
can be really annoying too :o)

greetings,

martin
Sep 24 '05 #11

P: n/a
zwetan wrote:
Hi,
often I see people telling that "javascript sucks"

- is it because of the DOM with JS ?
- is it because of the language in itself ?
- is it because browsers/hosts differences ?
- is it because of language limitation ?
etc.


Given that any language , including javascript has it's strengths
and weaknesses, it would tend to be more a matter of human nature than
the shortcommings of javascript which yield these opinions.

Most anyoneone who has programmed before will as a matter of human
nature compare javscript to their language of choice.

They will immeadiately make note of all the features from their
language of choice that are missing in javascript.

Since their world is defined by the original feature set of the
other language(s) they've experianced they know nothing of the
features unique to javascript that are "missing" in their own language.

I can say without too much reservation that two of the items you
mentioned as sources of angst....

- is it because of the DOM with JS ?
- is it because browsers/hosts differences ?

... tend to underline my last point of coders not having experianced
the features in javascript, "missing" from other languages.

Object sniffing and Normalizaion is a feature of javascript
that I've really not seen in other languages I work with.

Heres an example that patches in the missing Array.pop() and
Array.shift() functions in IE5

function DCpop()//**Crutch IE5.0
{if(!this.length)return null;var result=this[(this.length-1)]
delete this[this.length];return result;
}
function DCshift()//**Crutch IE5.0
{if(!this.length)return null;var result=this[0]
for(x=0;x<this.length-1;x++)this[x]=this[x+1]
delete this[--this.length];return result;}

if(!Array().pop){Array.prototype.pop=DCpop;Array.p rototype.shift=DCshift}

With languge features like this , you can back fill support
to browsers a long ways , making those points about language
and DOM variations largley moot. Since this featue
was likely never in a language they knew, and never came into
play in their evaluation of the language.

As to the language limitations , I think most are referring
to low level I/O and buffer manipulation limitations.

Given the venue in which javascript plays , I think it
was wise to limit the languge in that fashion, but thats
not what folks are looking at. They want to solve problems
with the new language in te same way they did their old language.

At least today we have XMLHTTP, which given the big picture is
a good answer to the IO issue.

Will javascript be C+++ (my native) never I hope. HAs the language
stopped me from solving a problem? Never.

--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> Internet Programming since 1994 <>=-- DHTML NSAPI TCP/IP
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.
Sep 24 '05 #12

P: n/a
zwetan wrote:
Hi,
often I see people telling that "javascript sucks"

- is it because of the DOM with JS ?
What is that supposed to mean?
- is it because of the language in itself ?
Unlikely.
- is it because browsers/hosts differences ?
That is a significant factor in encouraging people to dislike
javascript, though misplaced as differences in hosts are not the fault
of the language used to script those hosts, and javascript is the ideal
language for handling those differences.
- is it because of language limitation ?
Javascript doesn't have significant limitations as a programming
language. It relies on a host to provide an environment to be scripted,
and so if things like file IO are needed/relevant it is the
responsibility of the host to provide the facility.
etc.

please don't turn this into a flame/troll war,
I just want to know what are the REAL reasons/arguments
behind that "javascript sucks" thing

<snip>

You are asking the wrong people. Generally, the people who think
javascript sucks will be people who have expectations gained in the use
of other programming languages and have had a limited exposure to
javascript, insufficient for them to have gained an appreciation of what
javascript is capable of. So your should probably be asking people like
server-side Java developers, but that is not going to work very well on
Usenet because asking for criticism of javascript in a Java group will
be regarded as off topic, and so probably subject to complaints.

Richard.
Sep 25 '05 #13

P: n/a
In article <43***********************@news.wanadoo.fr>, zwetan
<ne********@zwetan.com> writes
Hi,
often I see people telling that "javascript sucks"

- is it because of the DOM with JS ?
- is it because of the language in itself ?
- is it because browsers/hosts differences ?
- is it because of language limitation ?
etc.

<snip>

Javascript didn't fit .NET at all well which is why Microsoft have spent
a fortune redesigning the language from the ground up. Presumably some
MS product strategist felt very strongly that 'javascript sucks'.

John
--
John Harris
Sep 25 '05 #14

P: n/a
Douglas Crockford wrote:
Kris Cipa wrote:
Javascript suck mainly because it's like a Scheme clone with Java
syntax tacked on and that is a horrible combination.


It is a very good combination. JavaScript is the first lambda language
to go mainstream.

http://www.crockford.com/javascript/javascript.html


Hi Douglas,

great article. :-)
I liked the part about encapsulation: and the javalike 'private'
constructions.

Regards,
Erwin Moller
Sep 26 '05 #15

P: n/a
thanks all for the comments

off course if I launched such discussion it's because I don't think JS
sucks,
but since about 10 years I see again and again the same "bad aura" around JS
programming

all the points that have been discussed here are valid, but imho one point
is missing

for me the main reason JS can have a "bad reputation" is because there is no
vendor behind JS promoting it

yes, there is Mozilla leading the implementation of the language,
but people from mozilla mainly push their browser platform, they do not
really
defend and/or educate people about JS in other platforms.

Since the language has been standardized to ECMAScript, it's like it has
been
left orphan, Mozilla take good care of its own JavaScript implementation,
some others
vendors implement also the standard but that's it, you don't have ONE entity
behind the language.

Behind Java you have Sun, behin C# you have Microsoft, etc.
and behind ECMAScript (the language, not the implementation) I feel like
there is no one,
except the developers community.

The problem is developers using the language everyday can see what's
missing,
what should be added, how the language could evolve, but they got no one to
talk with.

Because when ECMA add somethingto the standard (like E4X), they do not talk
to the developers, they talk to vendors implementing the standard, that's
put the
developer community out of the loop of the language improvments.

And even if the developers could be let out of the loop,
because after all E4X is still a great addon to ECMA-262,
the implementors have the choice to implement it or not,
so yes Bea, Mozilla, etc. will implement it, but they are a ton
of others who will not and this contribute to the fragmentation of the
standard,
there are not ONE vendor pushing/promoting the language to all implementors.

When you remember the way evolved JavaScript vs JScript,
when you look at the Opera or Safari implementation you can see history
repeating,
the ECMA-262 is here, still the same, but when it come to implementation
time
it's like anyone can do whatever he wants, add this feature but not that
one, or implement it later etc.

you as a developer you re too weak/small to tell Opera, Apple, or any other
implementor
that their implementation is buggy or miss important feature of the
language,
only a strong vendor could directly influence them.

Tomorrow ECMAScript v4 can be implemented anywhere and any implementor can
decide
that ECMA-262 is obsolete and you'll find yourself with another language
having nothing
close to the one you like and you will be able to do nothing, because there
is no main vendor
you can pressure/rant/yell at.

In this time where each big company use and overuse blog to be closer to
their community of developers,
you realize that the ECMAScript language is miles away from the developers
using it everyday.

Even if you don't give a sh!t about particular implementation of the
language (as Microsoft JScript, Macromedia ActionScript, etc.) and the only
thing that interest you is the Mozilla JavaScript implementation,
if the features you obtain in JavaScript are not implemented in the same
time on other platforms
you will not be able to use it globally (in ALL the browsers for exemple)
and so you find yourself
with a language which do not evolve as it should, and well you feel
frustrated at the language even
if it's not the fault of the language.

The worst thing being that new usefull features appearing in one platform
are not reinjected into the standard,
well... no vendor to enforce that sadely.

zwetan
Sep 27 '05 #16

P: n/a
On 24/09/2005 22:49, Dr Clue wrote:

[snip]
Heres an example that patches in the missing Array.pop() and
Array.shift() functions in IE5
If you're going to offer up replacements like that, they should either
follow the specification precisely or indicate where they differ.
function DCpop()//**Crutch IE5.0
{if(!this.length)return null;var result=this[(this.length-1)]
delete this[this.length];return result;
}
This doesn't reduce the size of the array, and it returns null when
there are zero elements, not undefined.
function DCshift()//**Crutch IE5.0
{if(!this.length)return null;var result=this[0]
for(x=0;x<this.length-1;x++)this[x]=this[x+1]
delete this[--this.length];return result;}
This also returns null instead of undefined when there are no elements,
and will create undefined properties in sparse arrays.

Neither could be applied to other objects

if('function' != typeof Array.prototype.pop) {
Array.prototype.pop = function() {
var n = this.length >>> 0,
r;

if(n) {
r = this[--n];
delete this[n];
}
this.length = n;
return r;
};
}
if('function' != typeof Array.prototype.shift) {
Array.prototype.shift = function() {
var n = this.length >>> 0,
i, j, r;

if(n) {
r = this[0];
for(i = 0, j = 1; j < n; ++i, ++j) {
if('undefined' == typeof this[j]) {delete this[i];}
else {this[i] = this[j];}
}
delete this[--n];
}
this.length = n;
return r;
};
}
if(!Array().pop){Array.prototype.pop=DCpop;Array.p rototype.shift=DCshift}
Testing the prototype object would seem a more appropriate approach. I
also don't see why you polluted the global namespace instead of
assigning the function objects directly.

[snip]
As to the language limitations , I think most are referring
to low level I/O and buffer manipulation limitations.
Usually. Of course, they need to understand what a scripting language
is, and that the environment is responsible for providing features
(beyond the core), not the language.
Given the venue in which javascript plays , I think it
was wise to limit the languge in that fashion, but thats
not what folks are looking at.
Absolutely. Though ECMAScript is based around the scripting languages
implemented by Netscape and Microsoft, it is general purpose. Making I/O
and other features required will prevent that from being possible.

[snip]
At least today we have XMLHTTP, [...]


You /may/ have XMLHTTP. :P

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Sep 28 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.