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)
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!
Oooh I want to check that out.
Just ordered it!