Last week, I came across a LinkedIn post about junior engineers and why some experienced developers write code that looks just like theirs. The post pointed out forgotten comments, unused variables, and messy formatting. I was surprised. I thought everyone followed a structured development cycle.
Developing a new feature isn’t just about quickly writing code. When I was a junior, my mentor taught me a few essential development habits. At first, I found them frustrating, but over time, I realized how valuable they are.

How to Develop a New Feature the Right Way
You get a new task, and you’re excited. You start writing code, debugging, and before you know it, you have a working feature. Then comes the code review, and suddenly, you’re hit with 40+ comments. Sound familiar? That used to be my reality—until I started following a structured development cycle.
1. Development
- Write the new feature, review previous code, and manually test both new and refactored code.
- Choose meaningful variable and method names. No one likes seeing
a1
,b4
, orfixSomething
in production.
2. Write Tests
- I’ll admit it—I hate unit tests. JUnit used to be my nightmare, but I’ve come to accept that tests are necessary.
- If your test doesn’t work, how can you be sure your feature does? You don’t need 100% test coverage, but having solid foundational tests will save you time in the long run.

3. Code Cleanup
- This is my favorite step. I manually review all changes, removing unnecessary comments and ensuring every variable serves a purpose.
- Formatting is crucial. Thanks to my colleague’s script, all files are perfectly formatted—no extra spaces or misplaced tabs.
4. Documentation
- I don’t have a superhuman memory, so I document my work. Whether it’s comments, README files, or structured documentation, it helps my future self (and my team) understand why the code was written the way it was.

The Benefits of Following a Development Cycle
By the time my code reaches review, I know it’s well-structured and maintainable. Since adopting this cycle, I’ve drastically reduced the number of review comments and improved the quality of my work.
Do you follow a development cycle? If not, it’s never too late to start!
Leave a Reply