Posts

Model correctly and write less code, using Akka Streams

Image
One of my most productive days was throwing away 1000 lines of code. -- Ken Thompson More than two decades of writing software programs to earn some humble money and to keep the home hearth warm, has taught me that writing simple, elegant and readable programs result in much more maintainable and extensible software. Importantly, stakeholders prefer to have maintainable code. One way to ensure that  these properties exist in the code, is to write fewer lines of code , wherever possible. Generations of greats in the world of computer science and programming have been reminding us about this little yet undeniable truth. Yet, it is surprising how often we tend to ignore this, knowingly and to projects’ detriment. If we have to write programs that are simple to understand, we have to understand the problem well, before anything else. If the problem is redefined in simpler and more fundamental terms, then it becomes easier to model the problem in the programming terms. Th...

Who is afraid of immutable data?

Anand Kumar Keshavan   Founder/Partner  Swanspeed Consulting Lately, my LinkedIn feed has been getting posts about events on functional programming with special emphasis on how to deal with immutable data . True, many programmers are puzzled when told that from now onwards you shall not modify the value of a variable once it has been initialised. "But how can I work with  loops? Doesn't incrementing a counter need the value of a counter to be changed?"  This is just the result of doing something  over and over again and can be overcome by learning some programming techniques such as recursion  and map/reduce over collections.  The larger problem, however, lies with the questions of the following nature: "What about real world things like account balances ? How do I change  the account balance of I am not allowed to change the value?".  ( To be fair to programmers who are new to the functional world , such questions have been rais...