Weekend Read 1

Posted on Sep 25, 2021

Articles

  • Thread pools in JVM
    • CPU bound, Blocking and Non-blocking
    • CPU bound should have threads at max equal to no of CPU
      • Blocking IO operations should never be allowed on the CPU bound pool
        • They need to go to separate pool
    • Async IO polls (non blocking) should be handled by very small number of fixed, pre-allocated threads
      • These just sit idle asking kernel continually if any new async IO notification is available then forward to rest of application
      • Never do any work on this thread pool. NEVER!
  • Code convention: java comments
    • Code block (note: this is not a javadoc comment) - snippet#1
    • Single line comments - snippet#2
    • Trailing comments - snippet#3
    • End of line comments - snippet#4
    • Java doc comments
      • After /** the next line follows a one space indent to align all subsequent *
      • These should NOT be placed inside contructors/methods
      • Annotations supported in javadoc
  • Mockito verify cookbook
    • verify(x)
    • verify(x, y)
    • verifyZeroInteractions(x)
    • verifyNoMoreInteractions(x)
    • inOrder.verify(x)
  • Git rebase explained visually
  • Deep stubs in mockito
    • Mockito.RETURNS_DEFAULTS
  • Reverse/foward proxies explained
  • 10x engineer myth
    • tl;dr such engineers ultimately slow company down and drags scalability.
  • Genius checklist
    • tl;dr no secret sauce just a list of good habits to help memory
  • On time, money and health
    • tl;dr an eye opener for those in the rat race. Shows value of time in ones short life.
  • Software estimation 1
    • It’s hard and not accurate but still do it
    • Estimation gets better with time
    • Size up tasks with apt. days required for each eg: {S:1, M:3, L:5, XL:10}
    • Unertainty multiplier: {low:1.1, med:1.5, high:2.0, extreme:5.0}
  • Software estimation 2

Code snippets

Snippet#1

/*
 * Here is a block comment.
 */

Snippet#2

if (condition) {
    /* Handle the condition. */
    ...
}

Snippet#3

if (a == 2) {
    return TRUE;            /* special case */
} else {
    return isPrime(a);      /* works only for odd a */
}

Snippet#4

if (foo > 1) {

    // Do a double-flip.
    ...
}
else {
    return false;          // Explain why here.
}

Snippet#4

/**
 * The Example class provides ...
 */
public class Example {
...
}