O'Reilly logo

Android Best Practices by David Truxall, Onur Cinar, Godfrey Nolan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter     3

Performance

Michael A. Jackson famously coined the first and second rules of program optimization:

  • Rule 1. Don’t do it.
  • Rule 2. (For experts only!): Don’t do it yet.

This can be interpreted in a number of ways. To me, it really means “keep your code clean and don’t worry about optimizing its flow.” Avoid making the code too complicated. It also points to the fact that as computers and JIT compilers get more advanced, you probably won’t have to worry about it in six months, as the hardware will have overtaken any minimal optimizations that you can apply.

What it doesn’t mean is to do nothing if your mobile app takes 10 or more seconds to load an activity and is a terrible user experience. Remember that whatever you thought was ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required