View on GitHub

Designing, programming, testing, writing & other useful topics

Ashwin Jayaprakash CC-BY-SA-4.0 (An opinionated collection)

Table of Contents

Created by gh-md-toc

Product development lifecycle

(Keep in mind that the stages are iterative with feedback loops)

Design mnemonics - “FDSCARSS”

(Also see 12 Factor)

Programming basics (Mostly for Java)

Design basics

Documentation and information management

Project maintenance and contributions

Testing and code review

Debugging and problem solving


Computer fundamentals


Distributed systems




Java/JVM deep dive

Guides, best practices and patterns


Code generation


Restrict its use to the bare minimum.

Misc Java

Dependency Injection


Stick to explicit Java in all places other than the one place where you bind things.

public class FruitModule extends AbstractModule {
  Apple makeApple(){
   return new Apple();

  Flour makeFlour(){
   return new WheatFlour();

  ApplePie makeApplePie(Apple apple, Flour flour){
   return new ApplePie(apple, flour);





Member variables

public class PieRecipe {
    private static final int DEFAULT_FLOUR_GRAMS = 250;

    private String name;

    private int sugarGrams;

    private int flourGrams = DEFAULT_FLOUR_GRAMS;

    private List<Flavor> optionalFlavors;


Prefer readability over compactness while formatting code. Sometimes the IDE’s automatic formatting may have to be overridden manually.

public BigClass(
        int foo, String bar, float fizz, Object bizz, List<String> names) {

public BigClass(
        int foo, String bar, float fizz, Object bizz, 
        List<String> names, Map<String, Long> moreNames) {

void hello()  {
      xx, yy, zz, aa, bb, more, stillMore, manyMore, 
      others, moreOthers.values().stream().count()

List<Integer> ids = allObjects
          .filter(foo -> foo > 34)
List<String> items = few
      ? new ImmutableList.Builder()
      : Lists.newArrayList("aa", "bb", "cc", "dd", "ee", "ff", ....);

Ordering of methods

//In unit tests.

@Test testXX
@Test testYY

Thread safety


public final class FooBarConstants {
    //"PROP" or "KEY" prefix for property or map keys.
    public static final String PROP_CONFIG_FILE_NAME = "app.config.file";
    //"VAL" prefix for fixed property or map values.
    public static final String VAL_DEFAULT_CONFIG_FILE_NAME = "conf/";
    //"VAR" prefix for template strings that can vary slightly.
    public static final String VAR_ERR_MSG_AGE = "The value [%s] provided for 'age' is invalid";
    //Private ctor and an abstract class. Prevent sub-classing and instantiation.
    private FooBarConstants() {

(Java)Docs, comments and logs

Non-Java files and resources

Prefer non-source code file and directory names like - ~/data-feed/all-lower-case-with-hyphens.csv.

Unit tests

We tend to focus on the “core” parts of the test but often ignore to clarify test boundaries, confirm the absence of unwanted start/end states and test for side effects.

Advanced unit tests



“Awesome lists”