Qoders Blog     About     Archive     Feed
by Qadeer Ahmad Khan

Effective Java - Classes and Interfaces

Classes and Interfaces (Ch 4) This is a short summary of Joshua Blochs book Effective Java chapter 4. I have only included items that I find relevant. Minimize accessibility to keep your API clean (item 13) A public class or member is part of the contract to your clients, and... View entire post

Effective Java - Methods Common to All Objects

Methods Common to All Objects (Ch 3) This is a short summary of Joshua Blochs book Effective Java chapter 3. I have only included items that I find relevant. The general equals() contract (item 8) The equals contract describes the equivalence relation as: x.equals(null) == false Reflexive - x.equals(x) ==... View entire post

Effective Java - Creating and Destroying Objects

Creating and Destroying Objects (Ch 2) This is a short summary of Joshua Blochs book Effective Java chapter 2. I have only included items that I find relevant. Static Factories (item 1) Some advantages of static factories vs constructors: Factory methods have names which add a description to the constructor... View entire post

Shell (unix) commands you always forget

This is a list of typical commands that I often have to Google because I forget either their usage or important flags. Using grep with perl type regex ls | grep -P "dirNo\d\d$" Using the -P flag lets you search for more advanced regex expressions. Other useful grep flags: -i... View entire post

Running shell commands with Python

Although bash scripts are powerful, the language contains many gotchas that makes your head scratch. I therefore really enjoy the simplicity of Python. The following is a simple way to run shell command and get the result, using Python. Note that output to stderr will not be returned. import subprocess... View entire post

A Cheap and Painless Mass Regression Testing Approach

My new client and project has been alive quite a time and has involved many people and consultants going in and out. It also has a large code base and typically, these combinations entail code being written in different styles making it harder to read and maintain. However, involving many... View entire post