Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:God please... (Score 2) 180

Yeah, fortunately that is being corrected in ES6. You don't really need to use require.js (it is awful!) though. I've been able to avoid it and similar solutions other ways, depending on the project.

As for the object model, it's undeniably superior. Google "classical vs prototypal inheritance" for a bunch of articles and (informed) discussions. Once you get a handle on it, you'll be amazed at how much effort it ultimately saves you. (Believe it or not, it's significantly simpler than the classical approach, and far more flexible.)

Would you recommend any books for learning javascript at a deeper level?

Not really. Crockford's book is okay, but far from perfect -- same with Flanagan's JavaScript: The Definitive Guide. They're probably the best of a bad bunch.

You really do have to toss out pretty much everything you know and start from scratch. If you try to use all those techniques you're used to from Java, you're going to pull your hair out. As an added bonus, you'll want to strangle Brendan Eich if you try to treat it like Lisp!

It's a whole different animal. My advice? Avoid new and constructor functions to shake off some of those old classical OO habits. Spend some time reading about prototype-based programming and event driven design (a good start there is decoupling with events). Your ACM DL subscription will pay for itself in cash saved in therapy.

Also, do you think Java is really hellish?

That may be a bit of an exaggeration, but I really don't care for it. Maybe I've just suffered through too much bad Java code? Still, I find it tedious.

Comment Re:God please... (Score 1) 180

Too bad the people who wrote the mounds of code I have to maintain don't.

Indeed. It's very frustrating. I blame the glut of terrible books, though the tutorial websites are even worst.

Every feature of javascript is painful and can be abused easily.

I don't know about painful -- I found the language quite refreshing after years of Java and C# hell. It's very flexable, so abuse is easy; I can't deny that. A big part of the problem there, of course, is that it's so easy to make it act like a class-based language, which is a mistake all-too-frequently made by incompetent developers. The unnecessary new and constructor functions didn't help, and are likely responsible for the bulk of the confusion early-on.

Unfortunately, it's about to get a whole lot worse, as ES6 is going to add "classes". They're little more than sugar, but will further the confusion.

Comment Re:Cry Me A River (Score 1) 608

I do know that not all JavaScript interpreters in use support the semantics of "use strict".

That's not what I was referring.

how should I go about determining whether the extent to which I have learned the language is enough to allow me not to make a fool of myself here on Slashdot?

When you stop getting abused on c.l.j? The easiest way to not say silly things is to check to make sure that what you're saying is accurate.

Comment Re:Cry Me A River (Score 1) 608

One stupidity is global variables by default unless you use var every single time.

Fail! That's not entirely true for reasons that are obvious if you understand the language. Nice repeated meme though.

If your data is full of 64-bit integers, tough.

Or just use a bigint library, like users of other languages have done for years.

Really, if that's the best you manage, I'd love to see what language you think is well-designed. I guarantee that I can offer a criticism far more convincing that the one you've offered here.

Try learning the language first. You'll find that forming your own informed opinions is far more rewarding than the cheap up-mod you get for repeating nonsense.

Slashdot Top Deals

If you have a procedure with 10 parameters, you probably missed some.

Working...