Skip to content

Instantly share code, notes, and snippets.

@veev
Created January 10, 2018 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veev/58b980e69d91bd6cc24cb66cd98280c1 to your computer and use it in GitHub Desktop.
Save veev/58b980e69d91bd6cc24cb66cd98280c1 to your computer and use it in GitHub Desktop.
Instructions for Refucktoring Workshop

Pairing Workshop

Break out into groups of two, based on the language you want to work in. You don't have to be at the same level of fluency, in fact, often it's better if you're not.

The first step is to code something with your partner, it could be generating the Fibonacci Sequence, or something as simple as "Hello World." Then, the real goal is to refucktor the code so that it still passes a test, but is hard to read, inefficient, unnecessarily memory intensive, really the impossible-to-maintain sky is the limit!

After each small change, run a test to make sure it's still working. This could be a test you run with a testing environment, or just printing the result of the function and seeing if it throws an error.

Start by implementing a solution for a code challenge

  • Visit exercism.io. This site has a lot of prompts for code challenges in a variety of languages, and shows you how to get set up testing your solutions (if you decide to use their testing suite.)

  • Click on the exercism.io/languages tab, and behold how many languages there are to choose from.

  • Select a problem to work on, the prompts are pretty language agnostic.

Use an online REPL if you're having trouble setting up an environment

  • Visit repl.it.
  • This is an online REPL (Read-eval-print-loop) that lets you get started writing code in a variety of languages without having to install anything first.
  • Sign up if it prompts you to, and select a language to code in.
  • You can save and share a repl with your partner if you want to switch who is driving and who is navigating. Just copy the link at the share button.

Refucktor it up!

  • For more refucktoring inspiration, check out "reluctant algorithms" for some fun ideas and bad practices! (hat tip to Julian Squires)

Alternatives to exercism prompts and online REPLs

If you don't want to use an online REPL or have code interview fatigue, and want to work on hamming distance or anagrams, here are test suites for Python, Javascript, Ruby, Rust, and Haskell for anagrams, and the Hamming distance problems in this attachment. Edit the main file in the language/problem directory of your choice and test it by running the provided test file. Here's another repo with some code samples in popular languages, ready for refucktoring!

You can always write your own tests or just say "yolo" and refuckter test-free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment