Posts Tagged getters

From AS3 to C#, Part 3: AS3 Class Parity

Tags: , , , , , , ,

Picking up from last time, today we’ll finish off classes in C# from an AS3 perspective in preparation for next week when we delve into all-new concepts that aren’t in AS3 at all. Read on to learn the C# way to implement getters and setters, final functions and classes, const variables, and packages.

Read the rest of this article »

13 Comments

Beware of Getters and Setters

Tags: , , ,

Getters and setters are indeed a very nice feature of AS3. They eliminate a lot of typing (.x versus .getX()) shaves off five characters and removes the need to hit the shift key for X) and make getting and setting values much more natural by disguising the fact that you’re actually calling a function. The downsides include the difficulty (impossibility?) of getting a Function variable for them and lower performance. This article is about that performance hit. EDIT: added a plain getter test)

Read the rest of this article »

13 Comments