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
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
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
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
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
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