Thursday 8 March 2012

Preface

Why "Think Functional"?

Sure, the first guess about my love to functional paradigm has some place, but not the main one.

The name of blog appeared eventually. I tried to play with different paradigms, languages, technologies, approaches during my not so long, but intensive programmer's life. Was a bit tired of numerous holy wars and discussions like "Who is the coolest and whose languages/tools are the best".
I was very young and idealistic.
I am still young and still idealistic=)
But after facing a not-so-ideal-reality at different projects I started to listen more and to try to learn more from others, and not to be stubborn fanatic.
At the beginning I couldn't understand why older and more experienced colleagues where so pessimistic and careful. Why business never understands our dreams about ideal requirements which follow strict logic and can be implemented in the most ideal way. Why we are always late with delivery. Why...why...why
My attitude was changed dramatically. Sure it would mutate later.

But at the moment I think we need to apply ideas of functional programming to our way of thinking.


Functional - strict mathematics-based approach - teaches us to have proven decision/result, based on lower-existing rules and axioms. 

I need to start to think about results of development like about mathematics:

  • To always have exactly one result of function application (result - delivered product, which satisfies the requirements of client)
  • Result should be calculated in appropriate time (product should be delivered in time)
  • We should prove that result is correct (product should pass acceptance tests, based on requirements and should be successfully used by end users)
Sounds like a mess of ideal phrases from PragmaticProgrammer's books shell and agile principles, isn't it?
Think it is obvious and nobody will deny that three statements(in brackets) are the only thing client wants from us and is paying for.
But how to reach this ideal situation?
As I am trying to represent any statement in form of functional/mathematical style, 
I have created a formula for myself, which is in blog description: 

success=function(programming(dream, love, hard_work, discipline))
where level of success - function of programming with 4 arguments/circumstances, and the measure of those three ideal statements satisfaction.

The function means that success depends on 4 arguments, and if you forgot one of them or hadn't commited any of them enough - you will not have achieve the goal.

 So I should Think Functional - return result like function, follow strict mathematical theory doing my work, work hardly, be pragmatic, love the thing I am doing and to follow discipline - good practices and code beauty.

Inspired by developers and MMA trainers I met on my way.
See also ideas of SoftwareCraftsmanship ,  OnePragmaticProgrammerAboutTechnologiesVsProblem and hundreds of other articles and books=)