Submitted by heartin on Fri, 02/20/2015 - 22:06
Are comments needed in your programs? If your code is very clear and expressive, then you won’t ideally need comments. By naming your identifiers correctly you can avoid the need for comments in lot of places within your code. So why learn about writing good comments? Due to reasons including the limitations in expressiveness of a programming language, we may have to still use comments, and for these use cases we will need to learn to write good comments.
Submitted by heartin on Fri, 02/20/2015 - 10:27
Below simple list of principles and practices can help you write cleaner methods in your program:
Methods should be as small as possible and should have descriptive names that explain its purpose without the need of any extra comments. Bigger methods should be refactored to move contents that can be grouped together, into other methods with descriptive names that reflect the task done by that method and then invoke those methods from the original method.
Submitted by heartin on Wed, 02/18/2015 - 19:52
Is naming identifiers like classes, methods and variables important in developing clean code? It is.
Below is a set of simple rules that you can use as a quick reference to name your identifiers correctly:
Use intention revealing names that can explicitly tell why it exists, what it does and how it is used, so that others can easily understand the code. E.g. int elapsedTimeInDays instead of int d.
Submitted by heartin on Sat, 02/07/2015 - 09:20
Object Oriented Design principles are very important and are sometimes considered even more important than design patterns. All design patterns are based on one or more of the design principles. Having thorough understanding of the design principles will help you understand the design paterns better and faster, and will even help you solve many design scenarios if you can't find a design pattern fitting that scenario.
Submitted by heartin on Sat, 03/09/2013 - 11:19
This article lays down some of the best practices which you can use during your design or code reviews, and assumes that you are familiar with the basics of mutithreading in java available at articles/multithreading.