Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Steven Sacks
Keyword: Old. Hans Wichman wrote: ps we're probably not the first ones discussing this old subject, has n1 found some good sources/references? Most of the old CS textbooks sentence you to hell for using public variables so let's not refer to those ;)

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Steven Sacks
And just to clarify: Stand on the shoulders of giants, don't follow in their footsteps. Steven Sacks wrote: Keyword: Old. Hans Wichman wrote: ps we're probably not the first ones discussing this old subject, has n1 found some good sources/references? Most of the old CS textbooks sentence

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Ian Thomas
On Wed, Dec 10, 2008 at 4:01 AM, Steven Sacks [EMAIL PROTECTED] wrote: That being said, I don't abide by the retarded rule that you shouldn't have public vars in a class. People who do this private var _foo:Boolean; public function get foo():Boolean { return _foo; } public function set

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Ian Thomas
In the programming languages used in the old CS textbooks, you didn't have the option to switch from a public property to a getter/setter pair without breaking the interface. Ian On Wed, Dec 10, 2008 at 8:23 AM, Steven Sacks [EMAIL PROTECTED] wrote: Keyword: Old. Hans Wichman wrote: ps

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Steven Sacks
Thankfully, AS3 allows you to put implicit getters and setters into an interface. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Ian Thomas
For some vars, the bounds don't matter - so why not use a public? If they do matter, use getters/setters. The beauty of Actionscript is - to the designer - it doesn't matter or change anything. :-) And from your PoV, you can flip between either when you need to add (or drop) bounds checks. (Or

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread allandt bik-elliott (thefieldcomic.com)
any code amending outside the class can be avoided if you take the (self-imposed) rule that internal/private class vars start with a leading underscore but public ones don't - that way if you need to create getters and setters, you just create the class var with the _ and the get/set without On

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Steven Sacks
It is incredibly rare that I agree with Steven. I resemble that remark! ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Eric E. Dolecki
I usually take the private with getters and setters approach - I can check the bounds of the setting of the var. I am thinking more of designers here taking the code and using it than I am other developers. Although I have many times set up public vars that I tweak from outside the class(es) too.

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Ian Thomas
I think we're saying the same thing there. :-) Such code amending is needed in languages like Java, because you can't go from a property to a getter/setter _without_ changing the interface. Which is why the Java getters and setters are used almost everywhere - like I said, it's programming in

RE: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Merrill, Jason
I tend to send this link on whenever this debate comes up, good article on public vars vs. getters and setters from a well respected Actionscript coder. http://www.darronschall.com/weblog/2005/03/no-brain-getter-and-setters.cfm And I also agree with Steve, Ian, the others, I used to be against

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Hans Wichman
Hi, yep that was the article, but the original poster asked a subtly different question (unless I'm mistaken). allandt asked about implicit vs explicit getters setters. Darron talks about using public variables vs implicit no brain getters setters. First time I read that article I thought he

RE: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Merrill, Jason
yep that was the article, but the original poster asked a subtly different question (unless I'm mistaken). allandt asked about implicit vs explicit getters setters. Rereading it and seeing its about public variables vs implicit, it's a nice read ;). But another discussion:). Uh, I guess you

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Hans Wichman
hmmm no guess I didn't, been pixelstaring too long already today;) On Wed, Dec 10, 2008 at 4:18 PM, Merrill, Jason [EMAIL PROTECTED] wrote: yep that was the article, but the original poster asked a subtly different question (unless I'm mistaken). allandt asked about implicit vs explicit

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Ian Thomas
I apologise for being deviant. Oh, hang on... :-P Ian On Wed, Dec 10, 2008 at 3:40 PM, Hans Wichman [EMAIL PROTECTED] wrote: hmmm no guess I didn't, been pixelstaring too long already today;) On Wed, Dec 10, 2008 at 4:18 PM, Merrill, Jason [EMAIL PROTECTED] wrote: yep that was the

Re: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread allandt bik-elliott (thefieldcomic.com)
good roundup - thanks ^^ On Wed, Dec 10, 2008 at 5:31 PM, Joel Stransky [EMAIL PROTECTED]wrote: So lets see if I can sum up the consensus here. There are four techniques for accessors and mutators listed (imho) in order of suggested use. 1. *public vars * - probably the best

RE: [Flashcoders] use get / set functions or make your own

2008-12-10 Thread Patrick Matte | BLITZ
) Sent: Wednesday, December 10, 2008 10:33 AM To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your own good roundup - thanks ^^ On Wed, Dec 10, 2008 at 5:31 PM, Joel Stransky [EMAIL PROTECTED]wrote: So lets see if I can sum up the consensus here. There are four

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Ian Thomas
I use Actionscript getters and setters. Because I can start off using ordinary public properties, and change them into getters and setters if I need more control/notification without changing any of the code that _uses_ my class. In order to achieve that otherwise, I'd have to make a getValue()

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread allandt bik-elliott (thefieldcomic.com)
i would have to agree - i use the built in ones and can't see any benefit from using bespoke ones apart from maybe being able to use the variable name i want rather than adding extra characters to it (although i use a leading underscore for class variables anyway) On Tue, Dec 9, 2008 at 10:48 AM,

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread David Bellerive
get / set functions or make your own To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Tuesday, December 9, 2008, 6:28 AM i would have to agree - i use the built in ones and can't see any benefit from using bespoke ones apart from maybe being able to use the variable name i want

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Hans Wichman
Hi, I'm still in the middle. I used to use getMyVariable setMyVariable for everything, now I usually use public variables for entity/value objects. I still hate not being able to see whether something is a variable or function, so for everything else than very simple objects I prefer

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Eric E. Dolecki
Since I like FlashDevelop, with a keyboard shortcut and a click I create setters and getters. On Tue, Dec 9, 2008 at 9:02 AM, Hans Wichman [EMAIL PROTECTED] wrote: Hi, I'm still in the middle. I used to use getMyVariable setMyVariable for everything, now I usually use public variables for

RE: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Cor
Yes I prefer FD also, but what is the shortcut for getters and setters?? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric E. Dolecki Sent: dinsdag 9 december 2008 15:16 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Eric E. Dolecki
9 december 2008 15:16 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your own Since I like FlashDevelop, with a keyboard shortcut and a click I create setters and getters. On Tue, Dec 9, 2008 at 9:02 AM, Hans Wichman [EMAIL PROTECTED] wrote: Hi

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread jonathan howe
Coders List Subject: Re: [Flashcoders] use get / set functions or make your own Since I like FlashDevelop, with a keyboard shortcut and a click I create setters and getters. On Tue, Dec 9, 2008 at 9:02 AM, Hans Wichman [EMAIL PROTECTED] wrote: Hi, I'm still in the middle. I used

RE: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Cor
Of Eric E. Dolecki Sent: dinsdag 9 december 2008 15:16 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your own Since I like FlashDevelop, with a keyboard shortcut and a click I create setters and getters. On Tue, Dec 9, 2008 at 9:02 AM, Hans Wichman [EMAIL

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Ian Thomas
Ooh - never knew about that. :-) You learn something every day! Ian On Tue, Dec 9, 2008 at 2:40 PM, jonathan howe [EMAIL PROTECTED] wrote: The magic Context code completion hotkey, which by default is Ctrl-Shift-1, when your cursor is over a variable declaration. This awesome hotkey also

RE: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Cor
When you open the Startpage of FD you find some more shortcuts. HTH Cor -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: dinsdag 9 december 2008 16:14 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Joel Stransky
PROTECTED] On Behalf Of Ian Thomas Sent: dinsdag 9 december 2008 16:14 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your own Ooh - never knew about that. :-) You learn something every day! Ian On Tue, Dec 9, 2008 at 2:40 PM, jonathan howe [EMAIL PROTECTED

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Todd Kerpelman
shortcuts. HTH Cor -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: dinsdag 9 december 2008 16:14 To: Flash Coders List Subject: Re: [Flashcoders] use get / set functions or make your own Ooh - never knew about

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Steven Sacks
For clarity, they're referred to as implicit and explicit. get prop / set prop = implicit getProp() / setProp = explicit In AS2, it made a difference because implicits were available right away, whereas explicits were not available for 1 frame. This limitation is not present in AS3.

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Muzak
] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 10, 2008 5:01 AM Subject: Re: [Flashcoders] use get / set functions or make your own For clarity, they're referred to as implicit and explicit. get prop / set prop = implicit getProp() / setProp = explicit In AS2, it made

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Latcho
on the other hand using public vars makes it more difficult if you have to add an extra parse or an extra function on the returning var for ex. like array.join() or ad some html wrapping around a string Then you don't have to redeclare public _unaltered var to an altered getter and setter and

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Hans Wichman
- From: Steven Sacks [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 10, 2008 5:01 AM Subject: Re: [Flashcoders] use get / set functions or make your own For clarity, they're referred to as implicit and explicit. get prop / set prop

Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Hans Wichman
Sacks [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 10, 2008 5:01 AM Subject: Re: [Flashcoders] use get / set functions or make your own For clarity, they're referred to as implicit and explicit. get prop / set prop = implicit getProp