Friday, May 06, 2016

YAGNI distilled

I strongly believe in YAGNI ("You aren't gonna need it") philosophy when it comes to Software Engineering (and life, why scratch before it itches). Very similar to how i was taught to use GOF design patterns to solve problems when you see them instead of starting with a design pattern. Advent of J2EE/Spring created Java programmers who would start with a factory pattern that created only one thing. Rationale for this was, tomorrow we will create more things. Now these amazing programmers are moving towards Scala/FP (mostly no semicolon java) and are bringing their philosophy of "We will need this day after tomorrow". Obviously they search their bible stack and decide to use Scalaz/Cat etc without understanding the underlying concepts. I have heard guys who can't grok Either talk about monad transformers. You can see the same behavior with infrastructure too. Multi AZ, Auto scaling etc is mandatory even when there are no customers using the crap.

So to explain YAGNI, I have come up with an analogy, here it goes; "You aren't gonna need Viagra when you don't have a partner or money to rent one". I guess its self explanatory but let me distill it (I am not sexist but for ease, I will assume we are talking about men).

Necessity of Viagra occurs when the following occurs in sequence;
  1. You attempt to have sex.
  2. You experience erectile dysfunction(ED)
  3. 1 data point is not good enough but if you panic, see a doctor. Do not google like you do while programming.
  4. If he prescribes Viagra then use it, when you get a chance to have sex.

You are a programmer for crying out loud, you should be able to translate that to software engineering. If you can't, I am really sorry for your company and colleagues.

My software engineering process litmus test below

No comments: