Refactoring a Simple Node.js API

Refactoring from a student’s perspective

Image for post
Image for post
Photo by Jay on Unsplash

The Problem

Who needs comments? Just read the code.

- Me, 2018

Image for post
Image for post

The Process

Image for post
Image for post
Example 1

Simplification…For Complexity

Image for post
Image for post
Example 2

Separating Concerns

Image for post
Image for post
Image for post
Image for post
Example 3

Conclusion

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store