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


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

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

"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

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

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

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:
I suppose that one wasn't written by Linus, otherwise I would tend to say that even wiz programmers tend to misuse goto :P.

Slashdot Top Deals

Money is better than poverty, if only for financial reasons.