refactoring

Recursos de programación de refactoring
I did the Brownish Greenfield Gilded Rose kata in JavaScript. I started working on it with Jordi Masramon at the last Software Craftsmanship Barcelona event. Today I did it again from scratch. In this variant of the Gilded Rose kata you use TDD but you're "forced" to use Item which you can't modify or inherit from. To avoid having to put up with Item limitations, I used the Adapter pattern. I also used the Decorator pattern for the Conjured items. However, their implementations can seem a bit...
I did the first round of the Yatzi kata in Java using jMock. As I tell in the README, I used "a funny way to explore design having strict mocks in place". Even though it's not very orthodox, it's working fine for me because it helps me to avoid accidentally creating obstacles to refactor. If I have some time, I'll explain it in a future post. If you're curious about it, check the commits to see its mechanics (I committed after each green and each refactoring step). You can check all the code in...
I've recorded myself using TDD to code the Mars Rover kata in order to be able to later watch me and detect problems to correct. This is the recording of what I've done so far (all the possible movements of the rover): Mars Rover kata recordingIf you decide to watch it, please do it at 2x speed (I still write slowly). These are the commits after each green and every refactoring step. You can see the code in the using_java_enum branch of this GitHub repository. - por Garajeando
I've just watched this great talk by John Pignata: Code Smells: Your Refactoring Cheat Codes Here is the code of the example shown during the talk. - por Garajeando
Last week some friends from Software Craftsmanship Gran Canaria and I practiced doing Matteo Vaccari's Open-Closed Principle kata. Jose M. Deniz Suarez and I paired to solve it using Ruby. We got two versions of the code. These are the tests: and the code of the first version: In this first version, we used a reduce over a list of translators. Each translator might add or not a translation of the given number to the resulting string. To try something different from what we've tried other times,...
Primera sesión de dudas en la segunda edición del curso de Refactoring
I've just watched this great talk by Nell Shamrell-Harrington: First Do No Harm: Surgical Refactoring - por Garajeando
I just redid the Alphabet Cipher kata from the fantastic Carine Meier's Living Clojure book. I had done it some time ago with Eloi Poch and Rafa Gómez (thanks guys I had a great time) at a Clojure Developers Barcelona event. These are the tests using Midje: and this is the final code: I used a mix of TDD and REPL-driven development committing after each green and each refactoring. What I did was tinkering in the REPL to get rough versions of encode, decode and decipher functions. This kind of...
January- Software Architecture for Developers, Simon Brown- Functional Programming Patterns in Scala and Clojure, Michael Bevilacqua-Linn- Working Effectively with Unit Tests, Jay FieldsFebruary- Vida y Destino (Жизнь и судьба), Vasili Grossman. (2nd time)- Primer Libro de Lankhmar (The First Book of Lankhmar), Fritz Leiber- Drown, Junot Díaz- Los girasoles ciegos, Alberto Méndez- Smalltalk Best Practice Patterns, Kent BeckMarch- Las puertas del paraiso (The Vagrants), Yiyun Li- Growing Object-O...
¿Por qué puede ser malo tener varios puntos de retorno en una función? En este vídeo analizaremos las razones que hay detrás de este mantra :)