Code Quality

Duplicate Code? Chain Constructors

Reading Time: 2 minutes After the ‘Introduction of Null Object’ and the ‘Replace One/Many Distinctions with Composite’ let us do an easy one this time. It is easy but of course it is present in a lot of code samples else we would not be discussing it here. If there are a lot of constructors which have duplicate code then see if there is a reasonable possibility to chain Continue Reading

Duplicate Code? Replace One/Many Distinctions with Composite

Reading Time: 3 minutes After the first post on how to introduce Null Object, in this second post on how to write clean(er) code, let us look at one of the very frequent occurrence. At least something that I have seen quite often. You too would have noticed that many APIs provide two methods to do the same thing. One of the methods expects one object and the other Continue Reading

Duplicate Code? Introduce Null Object

Reading Time: 3 minutes One of the most significant code smells is having duplicate code. There are primarily 2 forms of code duplications Explicit – These are the ones where there is blatant copy paste of the code. Methods are repeated within classes and it is easy for the CPD tool of PMD to figure out that lines are copied thus leaving us red faced. Subtle – This is Continue Reading

Excellent Code Quality is Also an Issue

Reading Time: 2 minutes We all know the importance of good clean code. Meaningful names, ubiquitous language, one level of abstraction per function, SRP, OCP etc etc. It is not debatable that good code would lead to better reuse, maintenance, enhancements etc etc. Have you ever encountered the scenario where the code was too good and that was an issue? I was reading the book, The Pragmatic Programmer: From Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!