The long way through Software Craftsmanship

Jan 1, 0001 - 1 minute read - Comments

published: false categories: - sample - unfinished - clojure - algorithm - mathematical-notation - paradigm

- comparison

I’ve been doing some code jam exercises, some on paper, some on the computer and I generally use “pseudo-mathematical” notation: FOREACH, BELONGS, etc

I have realised that this is much simple for algorithm rather than start thinking on data structures and then adding behavior on top of it.

Also, that once the algorithm is outlined into this notation, is relatively straightforward to convert to clojure notation.

Also that (even I already knew it), maps are the most comfortable notation for objects in clojure and that the object representation is quite similar (in lighttable’s format) to JSON. Something to think about.

Some of these algorithms are only data transformations, therefore good candidates for the functional paradigm. When there is shared state (e.g., dynamic programming), maybe it gets out of the usual scope for functional languages.

The three main patterns in recursive algorithms (keep, filter, every) are useful in dealing with algorithms

comments powered by Disqus