technologies image

I'm James Webster, a software developer specialising in mobile games. Most recently I've been developing in Unity using C#, however in the past I've worked extensively with Objective-C and Xcode. Given the time I'd like to learn how to use Swift for iOS development.

I'm a strong believer in writing easy-to-maintain code. Present-me has sworn one too many times at past-me for implementing quick solutions rather than maintainable ones. I favour readable, clean and quick to write and maintain code over super-optimised, intricate and slow to create programs.

"Premature optimisation is the root of all evil"

Donald Knuth

You seem to be concentrating on optimisation too early. You should favour readability over efficiency at this point.

When your app seems to slow down, or near the end of a release, profile the application and find out what, if any problems exist. Otherwise you may find yourself spending a day "optimising" a for loop to find that you've saved 0.000001s per update.

Moreover, readable code is easier to:

Micro-optimised code is takes longer to produce, prone to bugs, difficult to debug and maintain and often impossible to share as another developer may not know how to interpret your optimisations.

That's not to say "don't optimise", rather concentrate on optimising the biggest problems.

An answer of mine from Stack Overflow on premature optimisation.