Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Comment: Re:Why bother? (Score 3, Informative) 531

by Glabrezu (#30285990) Attached to: Trying To Bust JavaScript Out of the Browser

"One of the few popular languages with first-class functions"? Allow me to disagree but almost every dynamic language I know of has first-class functions.

Other languages, like C, C++, C#, also allow you to use functions as a data type.

I agree that, in some of them, their syntax does not make it easy to define functions as, for example, an argument, but you can define the function first, and pass it as an argument later if needed.

Closures are another thing altogether, but they are supported on many dynamic languages.

Comment: Re:Why bother? (Score 3, Insightful) 531

by Glabrezu (#30285762) Attached to: Trying To Bust JavaScript Out of the Browser

You mean the Douglas Crockford that wrote http://www.crockford.com/javascript/private.html?

When I talk about an object oriented programming language I'm referring to a language that allows you to use the concepts of OOP in a *natural* and *homogeneous* way. I don't want to write a library and helper methods to write an OO program, I want to use the language.

It's OK if it doesn't has classes, and therefore inheritance does not have a place in Javascript, just stop trying to force it to be something that it was not meant to be (that is a general purpose language to write medium to large scale applications).

Comment: What for? (Score 2, Interesting) 531

by Glabrezu (#30285136) Attached to: Trying To Bust JavaScript Out of the Browser

We already have a good number of established scripting languages that fill the niche. What does Javascript brings into this world that makes it interesting to work again on compilers, module platforms, optimizers, etc.?

The arguments posted in the article about what changed to consider moving javascript out of the browser, are in my opinion, pretty weak:

* We discovered AJAX: besides doesn't having anything to do with the argument, we might say that more than AJAX, browsers started to be a *little* more standard compliant, so designing complex HTML application became less painful. AJAX is really a so simple thing that I really don't believe is the responsible for our buzzed web 2.0 (besides... we always had iframes). Heavy support for CSS, fixing of layout issues, etc., that's what probably brought our web interfaces as we know them today.
* Its included on every consumer computer: Yes, in the browser. You will not use the browser to run these javascript programs, since there are limitations, and for a reason, on what you can do from the browser. Probably, you will need to download a javascript runtime to execute this new javascript programs anyway.
* Designers know how to program javascript: And that is why it's in the browser and not running on your server or free on your computer. Have you ever looked at the average javascript source code? People program as if they needed to save every byte on their source code, avoiding white space and having tons of a,b,c variables. Have they never heard of minimizers? And if size is such a problem, standarize an optimized intermediate representation instead.

What remains is that javascript is cool. That's probably right if you feel cool when you write ugly hacks to make things work.

And regarding problems with javascript to be used on large applications and not as glue code, I would say prototype programming is one of my main concerns. Weakly typed languages already have the disadvantage of lacking compile time type checking, and the difficulties to perform automated refactoring since you don't know to what a variable will refer. But with prototype languages you also add the difficulty to know what's the structure of an object.. In other dynamic languages you can also do it (ie. changing the structure of a class during runtime), but, being there and doing that, it's a probable road to "WTF is going on" (with exceptions, of course).

Comment: Re:One word.. (Score 1) 683

by Glabrezu (#29225527) Attached to: Dirty Coding Tricks To Make a Deadline
After reading a thread about why C++ wasn't used for developing git (basically, apparently it's used by bad programmers), I decided to take a look at git source code, first file I check and I find this:
http://gitorious.org/git/mainline/blobs/master/commit.c#line144
I suppose that one wasn't written by Linus, otherwise I would tend to say that even wiz programmers tend to misuse goto :P.

Man will never fly. Space travel is merely a dream. All aspirin is alike.

Working...