Thursday, June 27, 2013

Articles and Posts Read

La gigantesca hazaña de un humilde abogado
Why I Hacked Donkey Kong for My Daughter
How to be invincible
Interview with Sacha Chua
Every Day Can Be A Starting Point: Make a New Beginning

Innovative Minds Don’t Think Alike
El valor de los bitcoins se dispara un 57% en una semana

Learning and software craftsmanship
Motivated to learn?
Top down, bottom up
Towards mastery: deliberative practice, flow and personality traits
The Open-Closed Principle, in review
Trust and the tiranny of choice
Some things I've learnt about programming
Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce, Review
Some myths of 'Textbook-TDD', and why they are wrong
Developing instinct
Which Unit Test is correct? They both test the same thing in different ways
Testing on the Toilet: Testing State vs. Testing Interactions
A Test of Knowledge
Effective Steps to reduce technical debt: An agile approach
State vs Interaction Based Testing
Basic principles that will help you write better code
Why shorter methods are better
Virtual Panel: Code-to-Test Ratios, TDD and BDD
Why your IoC container could be a pain for you, young Padawan
Personality vs experience
What kind of a software engineer do you want to be known as?
Expertise, the Death of Fun, and What to Do About It
Event-Driven Programming: Introduction, Tutorial, History
Protected variation: the importance of being closed
On the Criteria To Be Used in Decomposing Systems into Modules

blaze-lib, A high performance C++ math library
The Biggest Changes in C++11 (and Why You Should Care)
More C++ Idioms
C/C++ Scientific Programming Libraries and Tools
C++ Programming WikiBook
Functional Programming in C++

Strategy Design Pattern in Javascript
Separating from the DOM, a JavaScript Story: XI to Eye
BDD applied to JavaScript RIAs
JavaScript Unit Tests: Jasmine vs Mocha

Python Koans
The pony I really want: a good signals tutorial

Agile and Lean
Agile Teams Are Neglecting Design
11 Agile Myths and 2 Truths

Entrepreneurship and Management
Sorry Google; you can Keep it to yourself
A note on working hours and working at home
Engineers Suck at Finding the Right Jobs
Great Employees Are Not Replaceable
Guiding newbie toward productivity
Titles are Toxic

El mayor proyecto neurocientífico de la historia

Portraits by Hong Yi

Spain and Europe
Tres millones de personas en pobreza extrema
La protesta llama a su puerta
Mascota para los JJOO 2020 rechazada
Arte en Berlín: ¿el fin de una era?
Más desigualdad, más miseria
Una crisis de novela
Chávez y Yeltsin
Los miniempleos son una amenaza para las mujeres en Alemania

Tuesday, June 18, 2013

MOOCs: "Becoming Human: Anthropology (BeHuman)" on Open2Study

I've just finalized this great Open2Study course by professor Greg Downey from Macquarie University:
It's been a great experience. The topics are very interesting, even mind blowing, and the lecturer is just great. I've enjoyed and learned a lot.


Sunday, June 16, 2013

Kata: "Gilded Rose" in Java

Today I've practiced with the Gilded Rose refactoring kata in Java.
I had to put a test harness in place before being able to start refactoring.

Here it's the code, committed after each small refactoring step.

Update: I revisited the kata a year after. Here you can find an improved new version.

Saturday, June 15, 2013

Resources for TDD beginners

I've just found this great link with selected resources to start learning TDD in Matteo Vaccaris's blog:

Interesting Talk: "Refactoring Fat Models with Patterns"

I've just watched this interesting talk by Bryan Helmkamp:

Notes to myself: "Kent Beck's Theory of Programming"

  • Communication.
  • Simplicity.
  • Flexibility.

  • Local Consequences.
  • Minimize Repetition.
  • Logic and Data Together.
  • Symmetry.
  • Declarative Expression.
  • Rate of Change.

Interesting Interview: "Brian Foote on the State of OOP, Refactoring, Code Quality"

I've just watched this interview with Brian Foote:
I't a very interesting vision from the perspective of a thirty something years career.

Sunday, June 9, 2013

Kata: "Prime Factors" in JavaScript

Some months ago, I did the Prime Factors kata in JavaScript.

Here is the code with all the baby steps so that you can follow the process.

Carlos Blé wrote an interesting post about this kata in his blog that I think it's worth reading.

Learning Test Driven Development (TDD) through katas

I'm trying to improve my TDD skills, so I'm working through the katas included in this post by Todd Sedano:

Encapsulating collections

I'm working on a protein energy landscape exploration program written in C++.

In the program each explorer can react to its environment in several ways: stopping the simulation, changing its search parameters or jumping to a more favorable spot.
An explorer knows about its environment through its sensors and then evaluates a series of conditions to know what to do next. There are conditions for each kind of action to happen.

Our code was suffering from a case of primitive obsession in the form of using raw STL collections for the conditions and sensors. That meant that there was a bunch of code that dealt with those concepts that was spread all over the place, particularly in the explorer's creation code.

On Friday I tried to improve the code applying the Encapsulate Collection refactoring.
I combined this refactoring with the use of the factory method pattern.

I'm happy with the results. Now the collection-handling code that was spread all over, has been attracted by the newly generated collections-like classes (ExitConditions, JumpingConditions and Sensors). Moreover, I've been able to give that functionality proper names to improve its readability and also to remove a bunch of getters that were bothering me and a class that didn't make sense anymore.

Regarding the refactoring process, it was pretty easy to introduce ExitConditions and JumpingConditions in tiny steps staying in green most of the time.

The real challenge was to introduce Sensors because the sensors related code was being used in many places, mainly for building conditions and reporting sensor values.
I tried to refactor it in tiny steps but got to a point where I got stucked. So I decided to plow ahead (I always had the possibility of using SVN to go back to where I started) and see. Well, three hours were gone before I could run the tests again...

While in the end all tests were green, I'm not proud of how I did it. I spent too much time in red and it could have easily gone badly.

Even though I'm sure I need more practice with this refactoring technique, I think it's always going to be very difficult to apply it when the problem has already spread too much.

In that case, I think that I have two options: a reactive one, learning more powerful large scale refactoring techniques like Mikado method; or, better a preemptive one, not letting the problem spread by applying the Encapsulate Collection refactoring more often.

As Xavi Gost said once:
Encapsulate in objects your collections you must.
A couple of days after writing this post I realized that I could merge JumpingConditions and ExitConditions classes in just one: Conditions.
This has simplified the code further.

Kata: "StringCalculator" in C++ using Igloo

Today I've worked in the StringCalculator kata in C++.
It's been perfect to start using Igloo, the BDD framework I talked about in my last post.

Here it's the code. It's incomplete. I still have to do the steps 7, 8 and 9 that deal with multiple delimiters and delimiters of any length.

Playing with Igloo, a BDD framework for C++

Today I've been playing with Igloo which is a BDD framework for C++.

I like it. The specs are very readable and, as it is implemented as a set of header files, it's really easy to use in your project. Its documentation is also ok.

Its author, Joakim Karlsson, has done several screencast where you can see him using Igloo. You might also have a look at Igloo's source code.

Saturday, June 8, 2013

Friday, June 7, 2013

Interesting Talk: "How To Approach Refactoring"

I've just watched this great talk by Venkat Subramaniam:
where he gives sensible advice on how to get quality code through refactoring.

Interesting Talk: "Fractal TDD: Using tests to drive system design" (2nd)

I've just revisited this great Steve Freeman's talk:
I'm also revisiting his book in the light of what I've practiced in the last 9 months and what I've learned in the BeCode Agile Development course. I hope this time I'll understand it a bit better.