Getting rid of a train of IF-ELSE

It is rare but probably happens once in a few years that we write a very long list of if-else blocks. Not only this kind of code is hard to manage, it is bad for a single responsibility. And it’s slow. I just devised a faster and cleaner way to do it.

Read More »

Advertisements

Architecting in Java(!): Planning for Exception

There has always been confusion and debates on what to do with “exception” and how to use it. Now, if you see “exception handling” in context of just a programming practice, or java, or a convention, you are sure to get challenged by both your team members and yourself. During my early years, I have been in turmoil for making right decisions on it. But over the time, I have learned lessons and found the real purpose of exceptions which I am gonna share today:

Read More »

Every software developer must know: part 1

There are some underlying theories behind software architecture and structure that every software engineer must know. On the face of it, a developer may not face a situation where this knowledge is applicable, but there are situations in development where one may have any idea where the problem exactly hides. If you really want to know why overdriving yourself and your team is not helping you to get things done and dusted, I recommend you to study some subjects.

Read More »

Writing Effective “Special Case Pattern” and “Null Object Pattern”

Handling null can be problematic in code organization and management. So, there are two very common patterns used by experienced developers now and then. One is “Null object pattern”, where you return an object which states a missing object, and another is “Special Case Pattern”. This article is to “How you can write effective objects for those patterns and why you should use them instead of returning null or throwing exceptions”

Read More »