Category: Code Quality

All the stuff related to improving the code quality.

The Art of Debug Logging

The Art of Debug Logging

Almost everybody is well equipped with logging essentials. But, only a few understand the purpose and power of the debug logs. Lets just refresh our basics as far as debug logging is concerned. To me personally, a best practices reminder time to time, inspires me to write quality code. WHEN EXACTLY DO WE NEED IT? …

+ Read More

SonarQube: Using PostJob in Plugins

SonarQube: Using PostJob in Plugins

The last post was all about creating a new plugin for sonar. Now, lets get off the beaten path and create a post job in a plugin instead of a decorator or sensor. But, first it is important to understand the difference. Please read the previous articles on sonar if your haven’t gone through them …

+ Read More

Coding Custom SonarQube Plugin

Coding Custom SonarQube Plugin

This will be a continuation of the sonar series in code quality section. This article is for users who have been using sonar and wish to extend and explore the possibilities of customization. Go through the previous posts if you already haven’t: Setting up sonar Sonar analysis using eclipse plugin If you already use sonar, …

+ Read More

Sonar Analysis From Eclipse

Sonar Analysis From Eclipse

Sonar is a great tool for ensuring quality and maintainable code. Sonar is like a code reviewer every developer should have. One shouldn’t wait for a formal code review and peer code review to find fault with one’s own code. So, the best way of writing quality code is to run a sonar analysis after …

+ Read More

Admiring and Understanding LinkedBlockingQueue take Method

Admiring and Understanding LinkedBlockingQueue take Method

In order to admire the code of the implementation of the BlockingQueue, lets have a look at the LinkedBlockingQueue take method. Lets go through the code line by line, understanding the role of each line of code. Line 4: final AtomicInteger count = this. count; In case you already know, AtomicInteger is used for atomic modifications to integers. …

+ Read More

Generics And Parameter Type Hiding

Generics And Parameter Type Hiding

Generics is an essential ingredient for a extensible and crafty design. When used wisely, generics make a programming language look good. Spiderman has reminded us repeatedly that with great power comes great responsibility. With all the extensibility we might toss the whole point type safety if generics are not used carefully. The following is a discussion …

+ Read More

Item 15: Minimize Mutability

Item 15: Minimize Mutability

Confused what Item 15 is? Well, as I have already mentioned in my previous posts, ‘Items’ are 78 items mentioned in Joshua Bloch’s book ‘Effective Java’. Those, well versed with the items in Effective Java may read them as a reminder, rest can have fun getting to know things. Moving to the next item, minimizing …

+ Read More