News for hackers. Stuff that matters.
Re:Coding Skill and the Decline of Stagnation by BoppreH on Friday January 13, 2012 @06:38PM (#3462898)
For that I prefer the ActionScript3.0 solution: methods that imitate attributes.

You replace

  public var myAttribute:int;
with

  public function get myAttribute():int;
The caller uses both with the same "object.myAttribute", so you can just replace one with the other when the need arrives, without changing any other code.

This allows you to use all sort of syntactic sugar ("object.myAttribute++", "+=" and other assignments), and for dynamic languages you can get and set values just from a reference to the object and the attribute's name. This last part is invaluable for animation engines.

Re:Coding Skill and the Decline of Stagnation by eropple on Saturday January 14, 2012 @02:51AM (#3463761)
Sure, but Java doesn't have that. =) Some of the Java.next languages (Scala among them) do, though.