[OT] D hidden features topic for StackOverflow

Yigal Chripun yigal100 at gmail.com
Thu Sep 25 14:56:03 PDT 2008


Nick Sabalausky wrote:
> "bearophile" <bearophileHUGS at lycos.com> wrote in message 
> news:gbgr2h$306j$1 at digitalmars.com...
>> Nick Sabalausky:
>>> FWIW, I was thrilled to see that newer versions of JS actually allow
>>> variables to be declared as actual specific types instead of just 
>>> variant.
>> Everyone is free to like or dislike JavaScript, but the point here is that 
>> all JS and all its features are designed to be a small dynamic language 
>> with prototype-based OOP. So bolting on it fake-static-typing plus 
>> Java-style classes makes it a mess. That's why I was not trilled.
>> If you like static typing and Java-style OOP, is much better to start with 
>> a Java/C#-like language instead, and keep using it. Think about adding to 
>> the current D2 language prototype-based OOP too and a lot of dynamic 
>> typing here and there, and you get an image of a reversed situation.
>>
>> Bye,
>> bearophile
>  
> As far as I'm concerned, dynamic typing and prototype-OO are mistakes 
> period. I can understand that it's good for a language to be true to itself, 
> but when "itself" is just a giant pile of bad ideas in the first place, then 
> shoehorning it into something more sensible, despite being messy or 
> inconsistent, is at least the next best thing to the ideal action of just 
> abandoning the monstrosity entirely and replacing it with what it should 
> have been from the start. 
> 
> 
I've got to disagree with you here.
prototype OOP is a sensible and much *much* more flexible than your
plain old class based OOP. for small scripts and little snippets the
flexibility of both the prototype OOP and dynamic typing is much better
than the the respective opposite. for those use cases (for which
javascript was initially intended) js is perfect. the problem was never
in the language itself.
WWW was designed to be a platform for mostly static _documents_.
when people started to create those god-damn awful web-apps they broke
that design. they use the browser for use-cases it was never meant to
do. js is used too for large code-bases. it's like trying to build a
house in the sea with a screwdriver.

what we really need is a suitable platform with different protocols (not
http which is stateless and not suitable for applications), a different
client software agent (what does it really mean to press the back button
in gmail, or take a bookmark? that UI is wrong for the app. the browser
is the wrong place to put a mail program in) and different languages.
for a real app you'd want to use a statically typed class based OOP
language such as D and not js.



More information about the Digitalmars-d mailing list