refactoring

Recursos de programación de refactoring
I've just watched this wonderful talk by Tom Stuart; Refactoring Ruby with Monads - por Garajeando
These are the links mentioned in this week's conversation about the second chapter: Talks Boundaries by Gary BernhardtBooks Object Design: Roles, Responsibilities, and Collaborations by Rebecca Wirfs-Brock and Alan McKeanOn Lisp by Paul GrahamPosts Tell Don't Ask by Martin FowlerTell, Don't Ask in The Pragmatic bookshelfTelling, Asking, and the Power of Jargon by Dave ThomasKeep It DRY, Shy, and Tell the Other Guy by Dave Thomas and Andy HuntLaw Of Demeter in C2 WikiThe Law of Demeter Is Not A...
Xavi nos presenta el curso de Refactoring a patrones
I refactored my my previous version of generalized FizzBuzz, so that, it doesn't use neither for loops nor recursion. Now it only uses: reduce and map. This is the new code: The tests are exactly the same as in the previous version: - por Garajeando
Cuando hemos aprendido el dar cera pulir cera del refactoring y nuestras funciones ya no pasan de las 20 lineas y nuestro código es semántico y limpio como una patena, entonces empezamos a ver que nuestra estructura, nuestro diseño también necesita atención, aplicando las mecanicas de refactoring y convergiendo a patrones bien conocidos. Hablaremos de como reconocer estas situaciones y mostraremos un ejemplo de aplicación sencillo pero escla recedor.
Álvaro García and I were pairing yesterday after work.We practised coding the Rotate an array in place kata in Python.It was great fun and we discussed about naming, scaffolding tests, closures, free variables and deleting tests.Once back at home, I redid the kata in JavaScript. You can see the resulting code in GitHub. I commited every time I got to green and after every refactoring so you can follow the process.In this post I just want to highlight what Álvaro and I did to optimize the code a...
This is my solution to the Beer song problem in Clojure:I wrote a first version using just regular functions:and a second one using multimethods:I enjoyed refactoring the code once all tests were passing. I also practised how to use multimethods and how to pass parameters with default values.You can nitpick my solution here or see all the exercises I've done so far in this repository. - por Garajeando
Last weekend I did the UglyTrivia legacy code refactoring kata in Java.Before starting to refactor, I added a characterization test to describe (characterize) the actual behavior of the original code. Since the only "visible effects" of the code were the lines it was writing to the standard output, I had to use that output to create the characterization test.This is the code of the characterization test:Although in this final version, the expected output reflects the fixing of two bugs in the or...
I've just solved the UglyTrivia legacy code refactoring kata in Java which was the kata we did in the last Barcelona Software Craftsmanship event.This is the initial version of the Game class: And this is the code after my refactoring:Update:And this is the code after I revisited it again (Feb. 27th 2016): Check my solution in GitHub with commits after each refactoring step. - por Garajeando
I've just watched this great live-coding talk by Sandro Mancuso: Testing and Refactoring Legacy Code - por Garajeando