+1

On Jan 15, 2012, at 8:44 PM, Taka Kojima wrote:

> WIth great power comes great responsibility.
> 
> The bottom line is, I'd say AS3 has it's strengths and weaknesses, but
> JavaScript is a far more expressive and powerful language.
> 
> Overwriting Classes, functions and variables at runtime can be dangerous,
> but used correctly you can do a whole lot more, a whole lot easier.
> 
> Just take for example, in AS3 you have trace(). Now, I'm not saying
> overwriting the trace method is a good idea, but in JavaScript to get trace
> outputting the output to somewhere when running in a browser environment,
> all you would have to do is this.
> 
> if(runningInBrowser){
> 
>  trace = function(){
>       console.log(arguments);
>   }
> 
> }
> 
> In AS3 you have to call a separate function which traces and does the
> console.log().
> 
> This is just a small example, that everyone I'm sure can relate to.
> JavaScript lets you do more, there is no arguing that. The only thing you
> could argue is whether or not JavaScript being able to do more is a good
> thing or a bad thing. Personally I think it has it's cons, but the pros
> outweigh them for sure.
> 
> Prototypical Inheritance is not a step backwards. If anything, it's a
> lateral step. It has a lot more to do with the quality of the code then
> what language it's written in.
> 
> I've seen tons of bad AS3 code. I've seen tons of bad JavaScript code.
> 
> Taka
> 
> 
> On Sat, Jan 14, 2012 at 5:31 AM, Henrik Andersson 
> <[email protected]>wrote:
> 
>> Taka Kojima skriver:
>>> 
>>> The biggest shift is from Classical Inheritance to Prototypical
>>> Inheritance, but the key thing to note is that there is still
>> inheritance.
>>> 
>>> Prototypical inheritance is definitely more powerful than Classical
>>> Inheritance when used right.
>>> 
>> 
>> 
>> Yet it is considered insane by most people to change the type of an
>> object at runtime.
>> 
>> Any such trickery is best delegated to the Strategy design pattern instead.
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> 
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to