Clean Code: Don’t mix different levels of abstractions

We spend more time on reading code than writing. So if the code is more readable then obviously it will increase the developer productivity. Many people associate readability of code with coding conventions like following standard naming conventions, closing file, DB resources etc etc. When it comes to code reviews most of the people focus on these trivial things only, like checking for naming convention violations, properly releasing resources in finally block or not. Do we need “Senior Resources” in team (I hate to call a human being as a Resource) to do these things?Tools like Findbugs, PMD, Checkstyle, Sonar

Continue reading »

Java Coding Best Practices: Better Search Implementation

In web applications searching for information based on the selected criteria and displaying the results is a very common requirement.Suppose we need to search users based on their name. The end user will enter the username in the textbox and hit the search button and the user results will be fetched from database and display in a grid.In the first look it looks simple and we start to implement it as follows: public class UserSearchAction extends Action{ public ActionForward execute(…) { SearchForm sf = (SearchForm)form; String searchName = sf.getSearchName(); UserService userService = new UserService(); List<User> searchResults = userService.search(searchName); //put search

Continue reading »

Next level of Don’t Repeat Yourself(DRY) principle

We are building the software applications using various languages for several years. Over the time new frameworks, new tools, new methodologies have came up. Especially in Java platform, now we have plenty of choices in each area following various design patterns and principles like MVC, FrontController etc. We have many development principles like KISS(Keep It Simple Stupid), DRY(Don’t Repeat Yourself) which encourages to write better code which is maintainable. Especially DRY principle is a very good one which every developer should understand and follow. The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative

Continue reading »

10 things to become an outstanding Java developer

If you are a java developer and passionate about technology, you can follow the below things which makes you an outstanding Java developer. 1. Have strong foundation and understanding on OO Principles For a java developer having strong understanding on Object Oriented Programming is a must. Without having a strong foundation on OOPS, one can’t realize the beauty of an Object Oriented Programming language like Java. If you don’t have good idea on what OOPS is, eventhough you are using OOP language you may be still coding in procedural way.Just studying OO principles definitions won’t help much. we should know

Continue reading »