O'Reilly logo

Android Studio Cookbook by Mike van Drongelen

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

Refactoring your code

Good software engineers refactor their work continuously. Names of methods and members should always indicate what they are doing. Since business requirements often change during the development process, in particular when agile methodologies come in, so do your apps.

If you choose the right names and stick to the rule that the length of methods must be limited to, well let's say, scrolling one page at most to view the whole method, often you do not need many comments to explain what your code is doing. If it is hard to come up with a good name for a particular method, then it is probably doing too much.

Since changing names could be scary, as it could break your code, developers often choose not to do so. Or, they decide to ...

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