DEV Community

Hudson Burgess
Hudson Burgess

Posted on • Originally published at hudsonburgess.com on

Scaffolding: Another Benefit of Clean Code

Imagine this scenario: you’ve been asked to build a particular feature that depends on someone else’s work. Maybe that work is happening within your team, maybe not. Either way, it needs to be done as quickly as possible. What do you do?

This has happened to me more than once in the past few weeks. My solution?

Don’t worry about it. Just write good code around it.

Two clean coding practices in particular can help us:

  • Breaking things into small pieces: This makes it easy to isolate implementation you don’t have yet, whether you need it from someone else or you simply haven’t figured out how to do it yet.
  • ‎Testing: code that’s broken into smaller, independent, more manageable pieces is also easier to test, both in isolation and integrated. This way, when new code shows up, you can test it quickly and have confidence that it’ll play nicely with your existing work.

Lots of CLI tools (ex. Angular CLI, Rails generators, etc.) already scaffold around code you don’t have yet. Why don’t you do the same thing yourself?

Top comments (3)

Collapse
 
josephmcasey profile image
Joseph Michael Casey

Hey Hudson,

These are definitely the right principles to clean code. Have you had a chance to check out Robert Martin's new book, Clean Architecture? It came out this month. Would love to hear your thoughts on it!

Collapse
 
ben profile image
Ben Halpern

Oooh I want to check that out.

Collapse
 
hudsonburgess7 profile image
Hudson Burgess

Just ordered it!