Archive for April, 2011

daily snapshot | 25 May 2011

April 25, 2011

Advertisements

a quick discourse on dependency injection

April 25, 2011
  • +1 : less boilerplate code for component initialization
  • -1 : boilerplate code can be reduced by moving initialization to library + app-specific conf
  • +1 : DI might provide standardized way to do so – valuable especially for common components such as db
  • +1 : Easy to provide mock implementations -> supporting testing (separate setup for conf)
  • -1 : More difficult to debug / trace issues
  • -1 : As flexibility is added to the interaction with injected object – the complexity of debugging increases
  • +1 : But components can be tested in isolation and covered with tests
  • -1 : Though this definitely introduces longer development time. Great on off-the shelf components but challenge for one-off custom code
  • -1 : Promotes IDE dependency for developers (no more emacs)
  • ….
  • summary: A priori usage of dependency injection without proper justification can come at the price

daily snapshot | 22 april 2011

April 22, 2011

  • “Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe. Okay, you can’t see a stream if it’s inside a pipe. That’s what I get for attempting a flowing analogy. You want literature, read James Joyce.” – http://www.grymoire.com/Unix/Sed.html
  • Minimal usable syntax for describing Turing-complete set of operations on arbitrary text streams ?
  • Java boxing, heap pollution and long-term worst-case app performance. Unknown pleasures.
  • Extract unique values from “number 424242“-style patterns in newline-delimited file :  cat file | grep number | sed ‘s/.* number \([0-9]*\) .*/\1/’ | sort | uniq -c