Coder Social home page Coder Social logo

marotpam / incomprehensible-finder-refactoring-kata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codelytv/php-finder_refactoring-kata

0.0 3.0 0.0 14 KB

PHP Port of the Incomprehensible Finder Refactoring Kata created by K. Scott Allen.

PHP 93.96% Makefile 6.04%

incomprehensible-finder-refactoring-kata's Introduction

Introduction

Here is the bad news: the new developer you hired has written some terrible, atrocious code. No one can understand what it does.

The good news: at least there are unit tests to prove the code is working.

You job is to refactor the code and make it readable, while keeping the code in working order (pass all tests).

How To Start

  1. Clone this repository git clone https://github.com/CodelyTV/incomprehensible-finder-refactoring-kata
  2. Build the docker container which contains all the required dependencies with make build
  3. Run the tests with make test
  4. Start refactoring!

The primary goal is to refactor the code in src/Algorithm/Finder.php - as it stands the code is incomprehensible.

Tips

  • Start with simple rename refactors so you can better understand the abstractions you are working with. Rename any class or any variable.
  • Move on to extract methods and making the code more modular.
  • See if you can also eliminate switch statements and multiple exit points from methods.

Anything is fair game, create new classes, new methods, and rename tests. The only restriction is that the existing tests have to keep working. Lean on the tests and run them after every small change to make sure you are on the right path.

How to End

You can stop when you feel the code is good enough, something you can come back to in 6 months and understand.

Helpful resources

PHP 7

I've decided to port the kata directly to PHP 7 instead of 5.6. This will allow you to practice also with the new PHP features. By the way, if you're not used to it yet, here you have some useful resources:

PHPUnit 5.5

Refactoring

Credits and other programming languages

This kata is a PHP port of the original Incomprehensible Finder Refactoring Kata created by K. Scott Allen.

You can also find the kata in different programming languages in isolated repositories just ready to clone and enjoy:

This port has been developed by CodelyTV in order to have it available for the Software Craftsmanship Barcelona Coding Dojo session. Come with us and have some fun if you're near Barcelona the next Monday, August 22nd!

incomprehensible-finder-refactoring-kata's People

Contributors

javiercane avatar marotpam avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.