Friday, March 29, 2013

The yoga of software engineering

Time to finalise this post, it has been brewing there already for some time now...

The following is an attempt to map raja / ashtanga yoga to software engineering. The connection between the two might seem a bit vague at first, but let's see if we can find something in there...

Ashtanga yoga, also know as raja yoga or classic yoga, contains eight limbs or pillars or steps or whatever you want to call them. They prescribe the students how to progress on the path to the ultimate goal, which in case of yoga is either union with the God or realisation of the God-like part in themselves. With relation to SWE the goal might be to build a piece of software that has maximum compliance with the requirements, performs cleanly and swiftly, has good user experience and is secure. So the yoga of software engineering is about developing oneself in the profession so that one is, some day, honored among both co-workers and customers for being an efficient worker producing quality code and known for not straying from the golden path of best practices.

The first two pillars are yama and niyama, yama meaning self-restraints (what one should not do) and niyama requirements or obligations (what one should do). They help building the ethical platform without which the rest of the path will most likely fail to lead to the desired result.

The five yamas are ahimsa (non-violence), satya (thruthfulness), asteya (non-stealing), brahmacharya (sexual abstinence) and aparigraha (non-covetousness).
  1. Non-violence would mean (in addition to not abusing anything or anyone physically) in the context of SWE to not violating any interfaces or specifications etc. 
  2. Thruthfulness is easy to see in the context of pretty much every aspect of working life, with SWE that would mean being truthful to both the team and the customer, not hiding bad code or compromised design decisions but confronting and solving them before they give rise to more serious issues, and telling the customer the real status of the project and not trying to cover things up. 
  3. Non-stealing means one should not literally steal code (unless licensing permits such code-reuse) as well as not violate any licenses but perhaps also not stealing the time of ones co-workers. 
  4. Abstinence from sex... well, that might not be required in SWE (even though a stereotypical coder might get intimate as rarely as a monk), but abstinence from activities that drain time and energy from the yoga of SWE might be a fitting interpretation. That could mean abstinence from fulfilling ones lusts, which might include things like hanging out in social media or gaming sites during working time, or even cheating on ones employer by doing some work for other parties (i.e. professional adultery, unless permitted by the employer). 
  5. Non-covetousness (or non-greediness) can be seen to mean both not trying to gain personal glory and/or benefit and also referring to holding unto the KISS and YAGNI design principles. Also trying to include too many things/functions within a module/class should be avoided.
The five niyamas are shacha (purity both inside and outside), santosha (contentment), tapas (austerity), svadhyava (study of religious books and repetitions of mantras) and ishvarapranidhana (surrendering to God).
  1. Purity is needed both in design, code and personal hygiene, so keep both your design and code neat and clean, keep your head clean so you can think straight and get a shower more than once a week.
  2. Contentment is required to be able to adjust to the limitations so that no precious energy and time is used on fighting wind mills.
  3. Now there is a sanskrit word with rather varying meanings, but it might be seen here as having to take certain amount of discomfort along the way of meeting the goal. If we're gonna advance, it will take practice over an over again. Some of the connotations of the word also can be interpreted as holding KISS and YAGNI dear.
  4. Study of SWE books is, of course, necessary to improve one's professional skills on SWE, and it might even be helpful to pick up some good quotes (guidelines, one-liners etc) and remind oneself of those things repeatedly, thinking about what they really mean.
  5. Total surrender to anyone might not be the best thing for a SW engineer to do as individual thinking and challenging the current design is a good way to improve the design and thus the resulting piece of software. But curiously enough, many experts of their trade are highly dedicated to the thing they are doing, and certainly that does also apply to SWE.
The third pillar is asana, which in yoga tradition means postures (which is the only part most  people ever know of yoga). Asana practice is meant to develop one's tool (the body) so that it is fit and properly diciplined for the challenges that follow. In SWE one needs also proper practice (just read Practicing Programming by Stevey Yegge if you feel like disagreeing). Coding itself is not enough to develop oneself, since there are always external constraints that dictate things like how much time there is for a given task - which prevents adopting new methods or tools that would need time to be learned. If there is always a hurry to get an adequate solution, when will one have time to implement good (or even excellent) solutions? From my experince I'd dare to answer "hardly ever".

The fourth pillar would be pranayama, which in yoga tradition means controlling the life force, but like this part is done in the yoga tradition, I'll leave that and the rest of the story for the private teachings passed from the SWE master to his or her disciples. Besides, I wouldn't even be competent to give any deep teachings - being in dire need for such myself, too.
submit to reddit Delicious

No comments:

Post a Comment