my favorite code advice

Is it gauche to repost my comment on my own blog?

I wrote this on this blog (which I enjoy), then decided it’s good enough to post here.

My favorite code advice is “if you need something >3 times, make it a function/object. Otherwise, re-code it inline.” Without this rule, I 1) underestimate the cost of developing reliable objects; 2) overestimate the effort required to code the same thing a second time; and 3) overestimate the likelihood that I’ll need to that function again (in that language/context) in the future.

What’s yours?

 

 

This entry was posted in Game Production by admin. Bookmark the permalink.

About admin

Josh Whitkin is a Lecturer in the School of Media, Communication and Culture at Murdoch University. His areas of expertise include mobile device design and computer graphic content production.