Skip to content

Instantly share code, notes, and snippets.

@AndrewDryga
Created August 14, 2017 18:03
Show Gist options
  • Save AndrewDryga/833b6f34366104ccc53f0faf892ba02e to your computer and use it in GitHub Desktop.
Save AndrewDryga/833b6f34366104ccc53f0faf892ba02e to your computer and use it in GitHub Desktop.
Elixir Refactoring Best Practice
  1. Revise folder sturcture and align everything without touching module names. Make sure everything is singular. Think about contexts. Don't forget about tests.
  2. Rename modules to match their file system path
  3. Refactor domain APIs to return {:ok, error} tuples, remove all error formatting from it
  4. Introduce fallback controller
  5. Go over all modules again and make sure naming is correct
  6. Remove all Elixir 1.5 and other warnings
  7. Bump deps and repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment