Re: [Flashcoders] using prototypes -bad or good?

2005-10-21 Thread Stan Vassilev
As2 compiles classes down to prototypes. So feature-wise and speed-wise it's 
the same thing for the player.
Prototype allows slightly better tuning of your code (when to put this 
when not, how to name the getter/setter etc.) but it has little practical 
benefit.


You can still mix prototype definition with intrinsic AS class shell to 
get AS2 benefits on your prototype code.


AS2 is faster to develop, however, since it's less noise in the written code 
and better/stricter compiler. So up to you - for small projects it's the 
same.

For larger projects AS1 would slow you down.

One silly example. I rountrip code between HTML+JS and Flash+AS2. If I type 
alert() instead of trace() in an AS2 class the compiler says wait a min. 
There's no such thing as alert() ..?.


In AS1 it just compiles it and when called fails silently :) saves precious 
seconds.


Regards, Stan Vassilev


- Original Message - 
From: Martin Klasson [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, October 21, 2005 12:38 PM
Subject: [Flashcoders] using prototypes -bad or good?



What is really the opinion on using prototypes now when as2 is being
used?

Prototypes can be used, but should it be used?

I got a friend who like doing prototypes and then making an Extension of
it.
So in the fla-file you can

#include prototypes.as

I don't really like the thought of using prototypes nowadays (liked it
when only as1 was the option)

And I really don't like extensions that much either.

I rather see a portability in where you got as-classed instead of
extensions and so on.

I do must admit that I use lacos tween, and that is for now both of and
prototype and an extension -which then is an #include lmc_tween.as

What do you think?

/ martin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] using prototypes -bad or good?

2005-10-21 Thread zwetan

 What is really the opinion on using prototypes now when as2 is being
 used?

 Prototypes can be used, but should it be used?


Why it should not be used ? what valid reason ?


 I got a friend who like doing prototypes and then making an Extension of
 it.
 So in the fla-file you can

 #include prototypes.as

 I don't really like the thought of using prototypes nowadays (liked it
 when only as1 was the option)


Well then don't use them if you don't like them


 And I really don't like extensions that much either.

 I rather see a portability in where you got as-classed instead of
 extensions and so on.

 I do must admit that I use lacos tween, and that is for now both of and
 prototype and an extension -which then is an #include lmc_tween.as

 What do you think?


I think that people do not understand is that when some people talk about
prototype-based programming they are talking about delegation mechanisms,
prototype explicit or implicit cloning, traits, dynamic programming,
closures, etc.

all these are prototype-based language features, and it's far away
from class-based languages paradigm

all what people are seeing is wooh it's use the keyword prototype in it
or wouh it's use the keyword class in it

and when they're talking about prototype is bad I believe they just don't
know what they're talking about

ECMAScript whatever flavour is NOT Java or C#

AS3 is a prototype-based language even if people can only see the class
keyword, under the hood it uses prototype features

Adding members to build-ins or other objects prototype in AS1,
Or using AS3 classes, these are just 2 different styles of programming
an ECMAScript based language.

And don't take my words for that, read the AS3 documentation,
Read the ECMAScript 4 proposal, do some search on google about
Prototype-base object-based languages

Read it yourself and make your own opinion

zwetan




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders