Early Adventures in Functional Programming

I have been reading about React (so I can eventually learn React Native), and the book starts with a bunch of stuff on functional programming and how it is beautiful.

It was quite convincing, so I decided I would give it a try with a code parser I'm writing in javascript (the reasons why are of no consequence :) ).

In hindsight, I should definitely have started simpler, but it was still a fun adventure and I learned a lot.

I played around with compose() functions which return a function which calls a bunch of other functions in order, and functions which add/remove fields from the data and return it.

It was looking fairly descriptive and not too ugly (any ugliness was surely down to my inadequate understanding of functional programming)...

...but then I tried to debug a piece of it.

I nearly vomited at the giant stack of bollocks which appeared in the callstack window.  How the hell is that giant stream of nonsense supposed to be helpful?

So I'm going back to the drawing board. 

If I had designed the whole thing up front as functional, then maybe it would've worked better.  At least that way I could've tested it in smaller increments.  As it is, I've had an enjoyable afternoon playing with my coding toys, and one hg revert and it's all tidied up again! :)

Comments

Popular posts from this blog

Micro:Bit and SPI display

DCS World with TrackIR under Ubuntu

Cardboard Mock-up of USB Joystick