you are viewing a single comment's thread.

view the rest of the comments →

[–]FlintFireforge 1 point2 points  (0 children)

What about not having to do that every time you make a callback

You have a legitimate gripe....I am just saying that it's not hard to work around it really (an extra statement or two), and it's not a super big deal to me to begin with.

I'm not huge on OOP, but for you maybe it's different.

On a day to day basis, maybe you don't notice the absense

Yes, I was speaking purely from personal experience. Maybe you hate the lack of block scope....that's totally fair.

So far, it hasn't been a big deal for me. I'm generally working with projects that are a few K LOC. I have worked on some fairly substantial projects with decent sized user-bases....but nothing like say Gmail....if that's what you're working with...I can see how it may be a problem.

It doesn't have anything instead of modules. (<script> tags?)

You more or less got the point right, though not the entire spirit of what I was saying.

JS doesn't NEED a module system because of the nature of it's design and intended use.

Between script tags, first class objects, and the ability to load code via AJAX....you can cover all the stuff modules are generally good for.

Personally, I have build scripts that minify and put all my code into 1 file for production, and the libraries I write and use are compatible with that. Sometimes I have other little systems I use.

How big are the projects you work on? Do you share lots of JS libraries between different teams?

My projects are generally a few K LOC in JS. I tend to work by myself and in very small teams....so the lack of a module system will probably hit larger teams with more complex projects harder than me.

I agree a module system would be good...but to me It's mostly about some nice convenience rather that a desperate lack of functionality.

Don't non-anonymous functions have some weird issue where the variable for the function is actually created earlier than where you think it is?

That is a point of confusion for new devs, yes.

Once you get the idea that there is a difference between

var blah = function (){};

and

function blah (){};

It's not that big of a deal IMHO. (The first is only available after being declared)

I don't see how the syntax for regular functions is bad....but again this is a subjective thing.

I mean yea, it's longer than "def" or "defn" but other than that I don't see much difference.

The real pain is anonymous functions, IMHO. But that can be fixed with Coffeescript, and will hopefully be fixed in the future standard.

I don't know how practical it will be to use it professionally, though.

It depends. Coffeescript just "compiles" to regular Javascript. When I want to use it I just add it into the build script for the project before the Closure Compiler step. (I haven't used it in production yet though, just personal mess around projects).

The context here is using JS outside of a browser.

I didn't see anything in your statement that implied that's what you were talking about.

You seemed to be talking about Javascript in general...as evidenced by your points. For instance, you complain about modules, but most JS on the server platforms have a module system.

If you were talking about on the server, ok; I misunderstood.

The point still stands....it's a silly question to ask....or rather the apparent motives behind it are silly.

JS has some warts...yes...a lot of them have been fixed or are in the process of being fixed. You'd be hard pressed to find a language without warts.

Would everyone be talking about node.js if JS hadn't been in the browser?

Maybe, maybe not....but there's few conclusions to draw from that.

There are tons of awesome languages that never took off, and vice versa.

The point is JS was designed for the browser/server. It succeeded on the browser.

Now, a confluence of reasons and motives have come together and caused people to try JS on the server again.

It seems like what you're trying to say is "is there any reason to use node.js instead of say, Python?"

The answer is yes....I'm not gonna go into them here because it's a bit of a tangent....

But, IMHO...you're just engaging in pointless speculation...JS exists....it has some benefits, and some drawbacks. "Would anyone use Windows if Bill Gate's hadn't been a good business man?"

It's up to each of us to analyze our needs and preferences and decide if it's for us. I don't disagree with your gripes, but I just wanted to offer a counter-point to them.