xiphias: (Default)
[personal profile] xiphias
I mean, it's not DIFFICULT to use or anything, but it's so awkward. It's . . . inelegant. Things that should be analogous use different syntax, for no apparent reason. The equality operator is "===".

It's like it was designed by independent people at different times who weren't in consultation with each other, and then bodged together at the last minute. I swear, the thing looks like it was designed by, I dunno, MBAs or something. Or maybe planaria. Or maybe even flatworms with MBAs.

(no subject)

Date: 2012-02-08 01:33 am (UTC)
From: [identity profile] undauntra.livejournal.com
Not cool.

(no subject)

Date: 2012-02-08 01:33 am (UTC)
From: [identity profile] xiphias.livejournal.com
Which, JavaScript, or digs at planaria?

(no subject)

Date: 2012-02-08 03:55 pm (UTC)
From: [identity profile] xiphias.livejournal.com
Aw, crap. You've got an MBA, don't you? I'd forgotten.

(no subject)

Date: 2012-02-09 12:01 am (UTC)
From: [identity profile] undauntra.livejournal.com
Evidently. :(

(no subject)

Date: 2012-02-08 02:28 am (UTC)
From: [identity profile] aprivatefox.livejournal.com
By the by, if you would like to find the elegant, pretty language hidden inside JavaScript, I recommend the (very thin!) "Javascript: The Good Parts." It's basically one very experienced JS programmer's attempt to point out all the very cool stuff in the language, and also warn you about places where the language lets you do something that's actually not a great idea if you want to write elegant, comprehensible code. There are a lot of those places, as it turns out.

(no subject)

Date: 2012-02-08 09:15 am (UTC)
From: [identity profile] zachkessin.livejournal.com
Yes, that book is very much worth reading.

A large part of Javascript's problems result from the fact that it was designed to do very small things and then evolved into larger things later. And more importantly it was pushed out the door of Mozilla way too soon. Most languages have a period of a few years where the rough edges get filled off, javascript didn't.

As for the equality operator, there are two == and === the problem is that == does some very strange type conversions and can lead to all sorts of strange results in some corner cases.

(no subject)

Date: 2012-02-08 09:17 am (UTC)
From: [identity profile] zachkessin.livejournal.com
The truth is if you want to just have a better syntax check out CoffeeScript, its JavaScript with a better syntax.

(no subject)

Date: 2012-03-02 10:49 pm (UTC)
From: [identity profile] alienne.livejournal.com
It's actually a really lovely language if you take it on its own terms. The thing you really have to remember is, it only *looks* like C. It's *actually* LISP.

And another recommendation here for Crockford's Javascript: The Good Parts. Crockford is really brilliant in general. He also has a website with several essays about JS worth reading.

(no subject)

Date: 2012-03-03 02:15 am (UTC)
From: [identity profile] xiphias.livejournal.com
Great. Guess what computer language was largely responsible for the first time I flunked out of school? Well, Scheme, technically, but still.

(no subject)

Date: 2012-03-04 12:49 am (UTC)
From: [identity profile] alienne.livejournal.com
Well, I've never managed to grok LISP, myself, actually. But i do love JS, and love it more the more i do with it. I do think reading Crockford is probably hugely helpful -- at least some of the stuff on his site, if you can't find/afford/deal with the book.

(And there are actually two equality operators in JS, btw: you can use '==', but it does type coercion, as someone else mentioned. The reason to use '===' is that it doesn't coerce types, so it's a lot safer.)

You're also not WRONG about it being a language designed by committee, mind. There's some really STUPID shit in JS, precisely because of that. But it is also true that on its own merits, it has a lot of really marvelous stuff. I am in particular deeply in love with prototypal inheritance, because it makes SENSE to me in a way that "classical" inheritance never really has.

November 2018

S M T W T F S
     123
45678910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags