-
Continue reading →: Creating reliable “Objects”
Let’s start of with a piece of code. We have a Main( ) method, which creates an object of a Circle class, sets the radius and then calculates the area of the circle. Let’s have a look at the circle class. It has a simple implementation to calculate the area…
-
Continue reading →: Fail as early as possible
The inspiration behind this blog post is, of course, the Clean code book. Sometimes, people choose to use unnecessary deep conditionals. They choose to return error/exception from else part of the deeply nested conditionals. It hampers the readability. We will consider the use case of register user which requires three mandatory…
-
Continue reading →: Do not catch “Generic exceptions types”
(Below scenario may be hypothetical, but for explanation purpose, let’s consider it happens…….) Imagine you are using a service for achieving some task, for example, let’s say, you are buying something on an online shopping portal. It so happens that while surfing for products, the site crashes. You contact the…
-
Continue reading →: Repeating yourself? Wait! You could avoid the repetition.
In software development, there is this term Don’t repeat yourself. There are many posts which talk about it and terms like DRY, DRYness, WET, “write everything twice”, “we enjoy typing” or “waste everyone’s time”, and so on. When you are repeating yourself, it’s a clue, an opportunity for you to…
-
Continue reading →: Is it time to re-name “Human resources” department?
Few weeks ago, I received an email from a recruiter. The title of the email went like, “Need immediate .NET resources who can join in Blah Blah.. time”. The email kind of triggered many thoughts in my mind. Am I really a “resource”? Is that only what I stand for?…
-
Continue reading →: Introduce explaining variable
While doing pair programming with developers, I have experienced that some of them are hesitant to introduce the explaining variable. They worry more about other devs thinking about that extra variable. Will it be redundant to have an extra variable? Well, let’s see: Before In the above code snippet (…even though…
-
Continue reading →: What is “Google time”?
Software engineering and product development are different from other streams of business (manufacturing, for instance). Things are more predictable in manufacturing, specifically in the execution phase. But it is no so at any stage in product development, where you get to know the next challenge only once you solve the…
-
Continue reading →: Writing test for translation files
In the past, I had worked on different websites and app that support localization. The user on these sites can work with the language of their choice and translations were provided on UI elements for selected languages. When working with translation files for multiple languages, I found that there were instances…
-
Continue reading →: Encapsulation
Encapsulation is the process of putting data and code (that operates on data) together in a single unit, which, acts as a protective wrapper for data and code. Access to the data is provided via controlled access (public interface). Consider an example of a simple wristwatch. Abstraction means to provide the simplest…
-
Continue reading →: Why giving meaningful names to things in programming is important
Everything in this world has meaningful names. It helps our brain to understand and remember the things very easily. It means less mental mapping. Let us take real-world examples of meaningful names given to things like hand wash (of course, you don’t use it to wash your face), face wash, shaving…
