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 ;)
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
)
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
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()
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,
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
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
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
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
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
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
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
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
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
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
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
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.
]
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
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
- 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
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
35 matches
Mail list logo