Code Cleanups

  ... the case you feel the need for a new feature or want to submit one.

Code Cleanups

Postby ronan » Sat Feb 12, 2011 7:32 pm

I'm not sure where to put that. I'm pretty sure I am not as experienced as the most guys here, but (I'm playing a bit with Shapes) why do you use this.getWith(); to get a protected property of a parent class. I mean protected is visible to all childs. And as I understand calling a is always more expensive to the cpu than just use this.mWidth;

This might be a tiny thing, but I guess an game engine needs every optimisation it can get to be more faster - right?

There was also another thing I remeber from an ibm website. Something like top 10 mistakes in java. In Java properties visibility is class based not instance based. So in case you have methods which take the same class as the object itself you can access the properties also via this.foobar instead of otherObject.getFoobar();

(p.s. i there in the forum a page of all threads I was active in?)
ronan
 
Posts: 7
Joined: Tue Feb 01, 2011 10:45 pm

Re: Code Cleanups

Postby Nicolas Gramlich » Thu Feb 24, 2011 12:49 am

Well this always depends on the field, but in this case it might be useful.

You can view all your posts at least: search.php?author_id=1411&sr=posts

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany


Return to Features

Who is online

Users browsing this forum: No registered users and 6 guests