refactoring

Recursos de programación de refactoring
“Yo refactorizaria pero el Jefe/Manager/PO no me iba a dejar” Si me dieran un euro por cada vez que he oído esto no necesitaría preocuparme de ninguna economía. Desarrollando cierta sensibilidad y apoyándonos en algunas técnicas, podemos hacer refactor en cualquier proyecto por hediondo que este sea. Pero ¿Cómo conseguir el tiempo para hacerlo? ¿Por dónde empiezo? ¿Cómo evito el ‘Gran Refactoring que necesita una semana’?. Contaré algunas lecciones aprendidas haciendo rescate de proyectos e intentaré contestar a estas preguntas. En esta charla pretendo explorar el impacto de refactorizar en la economía de un proyecto de mantenimiento. Encontraremos buenas razones para incorporar esta práctica y las expresaremos en el lenguaje que entiende el management (desde el 3.0 al mas rancio). El dinero. Porque adquiriendo una perspectiva correcta todos los proyectos son tan divertidos como un ‘greenfield’. Porque no hace falta cambiar escalas de valores ni abrazar árboles para empezar a hacer las cosas bien. Autor: Xavi Gost
¿Nos hacen los tests ir más rápidos? Mucha gente se pensará dos veces la respuesta a esa pregunta, cuando debería ser un rotundo y claro “sí”. Programadores de todo tipo intentan introducir el testing entre sus prácticas, pero no consiguen sacarle el beneficio esperado. Se sienten engañados ante todas aquellas promesas de refactoring seguro, de velocidad, y, en definitiva, de un código mejor. En esta charla veremos cómo podemos hacer tests que realmente nos hagan ir más rápido y mejoren nuestro código. Analizaremos prácticas comunes y anti patrones típicos en el testing, y cómo solventarlos. Autor: José Armesto
El lunes, 22 de diciembre a las 19h, os invitamos en el espacio de GeeksHubs a la primera charla del curso Refactoring a Patrones con Xavi Gost. El evento será un Coding Dojo, una reunión abierta, de programadores, aprendices, interesados y curiosos,…. Abstenerse aquellos sin ganas de programar y divertirse haciéndolo. Xavi nos explicará la forma de proceder en el curso y podréis resolver las dudas sobre dicho curso. Luego haremos un Coding Dojo para ir entrando en materia. Más info del curso: http://geekshubsacademy.com/courses/refactoring-xavi-gost.html
I've just redone the Roman Numerals kata in Clojure following the advices about test-driving algorithms that Sandro Mancuso gave during his Crafted Code course: Grow an algorithm bit by bitDelay treating exceptions (in this case, because they are more complex)Intentionally cause duplicationFocus on simple structures first The resulting code to convert decimals up to 3999 to roman numerals is much simpler than the code I got the first time I did the kata. I think the reason is that the first time...
These are the links mentioned in last two weeks conversations about the 12th and 13th chapters: Posts and Papers Decorator Pattern in C2 Wiki Aspect Oriented Programming in C2 Wiki Object Collaboration Stereotypes by Steve FreemanWhat the tests will tell you by Steve FreemanGetting It Right By Betting On Wrong by Sandi Metz Talks Workflows of Refactoring by Martin Fowler - por Garajeando
In the previous post I presented a solution of Conway's Game of Life in Clojure. I've refactored that code in order to eliminate some duplication from the game rules. First of all, I coded using TDD a new function will-have-a-cell? that later substituted both will-go-on-being-a-cell? and will-be-a-cell?. These are the tests for the game rules after deleting the obsolete functions (will-go-on-being-a-cell? and will-be-a-cell?): and this is the new function's code: Once I had the new function I u...
These are the links mentioned in this week's conversation about the 7th chapter: Posts and papers Traits: Composable Units of Behaviour by Schärli et al Shotgun SurgeryRefused BequestEncapsulatedCollection by Martin Fowler Talks Primitive obssesion and Value objects conversation between J. B. Rainsberger and Corey Haines (part 1)Primitive obssesion and Value objects conversation between J. B. Rainsberger and Corey Haines (part 2)Books On Lisp by Paul Graham - por Garajeando
We practiced with the Refactoring Tennis kata in the last Barcelona Ruby meetup. There were three different versions of the original code. I refactored the first one. This is the original code: First, I tried to refactor the code to the State Pattern as I did once before in C++. Then I realized checking the tests that the code was not meant to model a real tennis game. It's just focused in displaying the current score. So I decided to try to separate the code that was keeping the tennis game sco...
Yesterday Álvaro García (@alvarobiz) and I paired working on a possible solution to the Unconditional rock, paper, scissors kata that I facilitated in the recent SCBCN14 event. This is the last version of the tests so far: And this is the last version of the code: We managed to write the code without having to use conditionals in any moment. You can follow the process if you like since we did commits after every passing test and every refactoring. You can check the code in this GitHub reposito...
Yesterday Álvaro (@alvarobiz) and I facilitated the Fractions Arithmetic kata. It was an activity organized by the Barcelona Java Users Group and the Barcelona Software Craftsmanship Community. Thanks to Ignacio Cougil and Jonathan Vila for having the idea and making this event possible. Since the kata was meant to be an introducction to TDD, we had first a short talk explaining a bit what TDD is about. The talk took longer than I expected because we discussed about topics, such as, TDD, object-...