Record of experiments, readings, links, videos and other things that I find on the long road.
Registro de experimentos, lecturas, links, vídeos y otras cosas que voy encontrando en el largo camino.
Tuesday, May 27, 2014
Sunday, May 25, 2014
Interesting Talk: "The Curious Clojurist"
Interesting Talk: "Functional Programming You Already Know"
Today I watched this interesting talk by Kevlin Henney:
Saturday, May 24, 2014
Interesting Interview: "Stuart Halloway on Clojure and Functional Programming"
Today I watched this great interview with Stuart Halloway:
It's a great way to get an overview of where Clojure can be helpful for you.
Bizarre factorial in Clojure
I'm reading Brian Marick's Functional Programming for the Object-Oriented Programmer book.
This is my solution for an exercise from the first chapter, Just Enough Clojure in which I had to write a "bizarre version of factorial that uses neither iteration nor recursion":
Tested at the REPL it seems to work fine:
However, there are problems for big enough results because they don't fit into integers:
This can be easily solved using arbitrary precision integers.
You just need to append an N after any number in the calculation, since it's "contagious" to the rest of the calculation:
Now it works:
That's ok but how does bizarre-factorial works?
Let's first examine range function:
So, for example, to get the first 10 positive arbitrary precision integers we'd write:
We might refactor bizarre-factorial using let to create a helper function, positive-ints-until, to make this more explicit:
Let's see now how apply works:
So in the case of bizarre-factorial the apply function is applying the * function to a list of numbers returned by the positive-ints-until helper function.
That's how bizarre-factorial works.
Finally we can use partial to give a better name to the partial application of apply and *:
This version of bizarre-factorial is much more readable.
This is my solution for an exercise from the first chapter, Just Enough Clojure in which I had to write a "bizarre version of factorial that uses neither iteration nor recursion":
Tested at the REPL it seems to work fine:
However, there are problems for big enough results because they don't fit into integers:
This can be easily solved using arbitrary precision integers.
You just need to append an N after any number in the calculation, since it's "contagious" to the rest of the calculation:
Now it works:
That's ok but how does bizarre-factorial works?
Let's first examine range function:
So, for example, to get the first 10 positive arbitrary precision integers we'd write:
We might refactor bizarre-factorial using let to create a helper function, positive-ints-until, to make this more explicit:
Let's see now how apply works:
So in the case of bizarre-factorial the apply function is applying the * function to a list of numbers returned by the positive-ints-until helper function.
That's how bizarre-factorial works.
Finally we can use partial to give a better name to the partial application of apply and *:
This version of bizarre-factorial is much more readable.
Wednesday, May 21, 2014
Interesting Debate: "Kickstart Academy Podcast - with Sandi Metz "
Last night I watched this great conversation with Sandi Metz about object oriented design, writing maintainable software and more:
I really recommend it.
Sunday, May 18, 2014
Saturday, May 17, 2014
Interesting Talk: "Clojure for Java Programmers"
I've just watched these interesting talks by Rich Hickey:
Interesting Talk: "Dealing with Dynamically-Typed Legacy Code"
I've just watched this interesting talk by Michael Feathers:
Interesting Talk: "Making Little Classes out of Big Ones"
I've just watched this interesting talk by Avdi Grimm:
Interesting Talk: "Build a Bigger Brain: How Healthy Living Makes You Smarter"
I've just watched this interesting talk by Joe Kutner:
Interesting Talk: "Rules of Simple Design"
I've just watched this interesting talk by Corey Haines in which he comments some ideas from his last book:
Monday, May 12, 2014
Craft Conference 2014
Last month @pclavijo and I went to the Craft Conference in Budapest.
It was my first international conference and it was a great experience.
This were my favorite talks in no particular order:
This other one I couldn't go but @pclavijo said it was great, so it's in my talks queue:
It was my first international conference and it was a great experience.
This were my favorite talks in no particular order:
- Conway's Law and you: How to organize your organization for optimal development, Michael Feathers
- Polyglot Data, Greg Young
- Responsibly maximizing craftsmanship in software engineering, Theo Schlossnagle
- Acknowledging CAP at the Root - in the Domain Model, Eric Evans
- Find the right abstraction level for your tests, Gerard Meszaros
- Going reactive: event driven, scalable, resilient and responsive systems, Jonas Bonér
- Coaching teams through change, Rachel Davies
- Building on SOLID Foundations, Nat Pryce and Steve Freeman
- Jackstones: the journey to mastery, Dan North
This other one I couldn't go but @pclavijo said it was great, so it's in my talks queue:
Sunday, May 11, 2014
Interesting Talk: "Test-Driven JavaScript Master Class"
I've just watched this great talk by James Shore:
This class is a sample of what he teaches in his series of Let’s Code: Test-Driven JavaScript screencasts.
Saturday, May 10, 2014
Interesting Talk: "Decoupling from Rails"
Great talk by Jim Weirich where he refactors a Rails application code to decouple it from the framework so that it follow the clean architecture:
There's a lot of wisdom in this talk.
Values without practices
"All of this high-minded talk is well and good, but if there isn't some way to reduce it to practice, to reinforce it, to make the values a natural habit, then all we will have is yet another brave leap into the swamp of methodological good intentions."Kent Beck, Extreme Programming Explained
Friday, May 9, 2014
Talks related to Sandi Metz's Practical Object-Oriented Design in Ruby book
These talks by Sandi Metz explain many of the ideas in her book Practical Object-Oriented Design in Ruby book:
Wednesday, May 7, 2014
Interesting Talk: "Find the Right Abstraction Level for Your Tests"
Last month I attend this great talk by Gerard Meszaros at the Craft Conference in Budapest:
Tuesday, May 6, 2014
Interesting Talk: "The Architecture of Uncertainty"
I've just watched this great talk by Kevlin Henney:
This talk gives great insights in the relationships among uncertainty, design, learning and change.
Lately I've been reading and thinking a lot about this after reading Sandi Metz great book on OO design and several interesting discussions with @remosu.
Some intuitions are growing in my head but they are still quite fuzzy.
Lately I've been reading and thinking a lot about this after reading Sandi Metz great book on OO design and several interesting discussions with @remosu.
Some intuitions are growing in my head but they are still quite fuzzy.
Monday, May 5, 2014
Interesting Talk: "AngularJS Fundamentals In 60-ish Minutes"
I've just watched this great talk by Dan Wahlin:
Interesting Talk: "Given When Then" considered harmful"
I've just watched this great talk by Steve Freeman:
Saturday, May 3, 2014
Kata: Revisiting Gilded Rose in Java
Yesterday Jaume Jornet and I were practicing together doing the Gilded Rose kata in C#.
At the end of the session, we left the code in a point where it was ready to substitute several conditionals
with polymorphism. Then we discussed how we would do it without modifying the Item class (to avoid the goblin's rage).
We talked about wrapping Item in another object DegradableItem and then create several subtypes for it.
Once having this design in place the Conjured items might be implemented using a decorator over DegradableItem.
When I got home I did the whole kata again in Java and coded these ideas we had talked about with some slight variations:
This is the resulting code commited step by step.
You can compare it with another version I did nearly a year ago.
Our lifes would be much easier without the goblins :)
Our lifes would be much easier without the goblins :)
Subscribe to:
Posts (Atom)