This healthcheck has to your first step toward building a better software for startups. It helped me to build a couple of successful MVPs and this guidelines is guiding me on every tech decision.
How to execute the health check:
- Grab your dev team and book a 2-hour meeting. Don’t include business partners or other stakeholders, it has to be an internal meeting just for devs. Get an outside facilitator if you have no senior leader who can lead the meeting.
- As a team, go through every point and evaluate it on a scale from 1 to 10. Note your answers. If you are not sure what some rule means – google that, and make sure you understand every word from the doc.
- During the discussion collect action points, especially when something is having a score of less than 4.
- Calculate the average score, combine your action points into a single action plan, and send it to your stakeholders.
Development
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility, and maintainability.
General rules
- Follow standard conventions. Have conventions for naming, function length, quotes, etc. Utilize Linker to control the quality.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy Scout rule. Leave the campground cleaner than you found it.
- Always find the root cause. Always look for the root cause of a problem. Don’t do quick fixes, avoid IFs.
Design rules
- Keep configurable data at high levels.
- Prefer polymorphism to if/else or switch/case.
- Prevent over-configurability.
- Use dependency injection.
- Follow Law of Demeter. A class should know only its direct dependencies.
- Utilize types, don’t use any
Understandability tips
- Be consistent. If you do something a certain way, do all similar things in the same way.
- Use explanatory variables.
- Prefer dedicated value objects to primitive type.
- Avoid logical dependency. Don’t write methods which works correctly depending on something else in the same class.
- Avoid negative conditionals.
Names rules
- Choose descriptive and unambiguous names.
- Make meaningful distinction.
- Use pronounceable names.
- Use searchable names.
- Replace magic numbers with named constants.
- Avoid encodings. Don’t append prefixes or type information.
Functions rules
- Small.
- Do one thing.
- Use descriptive names.
- Prefer fewer arguments.
- Have no side effects. (or have as less as possible)
- Don’t use flag arguments. Split method into several independent methods that can be called from the client without the flag.
Comments rules
- Don’t add obvious noise.
- Don’t comment out code. Just remove. You can find it in Git.
- Use as clarification of code.
- Use as warning of consequences or as a clarification of a decision.
Source code structure
- Separate concepts vertically.
- Dependent functions should be close.
- Similar functions should be close.
- Place functions in the downward direction.
- Declare variables close to their usage.
- Keep lines short.
- Use white space to associate related things and disassociate weakly related.
- Don’t break indentation.
Objects and data structures
- Base class should know nothing about their derivatives.
- Prefer non-static methods to static methods.
- Better to have many functions than to pass some code into a function to select a behavior.
- Do one thing.
- Should be small.
Code smells
- Rigidity. The software is difficult to change. A small change causes a cascade of subsequent changes.
- Fragility. The software breaks in many places due to a single change.
- Immobility. You cannot reuse parts of the code in other projects because of involved risks and high effort.
- Needless Complexity.
- Needless Repetition.
- Opacity. The code is hard to understand.
Architecture
Architecture has to be supported by a developer, not a burden. Well, design architecture makes you more efficient. You never have to be scared to deploy your code, add a new environment variable or create a new microservice.
- Document your backend endpoint, you will say thank you in the future (SwaggerUI, tags, examples, descriptions)
- Make your backend stateless so that you can easily scale it horizontally
- Automate everything which requires you to spend a small amount of time every day. Definitely have CI/CD and automated linter.
- Make sure your secrets are separated from the code.
- Your infrastructure has to be easy to develop locally. Utilize the power of Docker and Docker compose if you have a lot of components that require setup like DBs.
- Make your infrastructure observable on the front end and backend. Tools like Fullstory, Smartlook, and Google Analytics make your frontend observable. Tools like Prometheus and Grafana make your backend and infrastructure observable.
- Do smart logging. Separate your log in separate threads. If something happens you have to be able to find the root cause just from logs.
- Local and staging testing before deployment to the backend. Never deploy directly to production. Build expectations with a business that code needs to go through the testing circle before being delivered.
Project management
Even small your startup is a project and it needs management. bad project management will make your co-founder and employees hate work. Good project management will make work feel like a vacation and will get the most out of everyone.
- The team trust each other and there is a feeling of team responsibility.
- Execute daily meetings with daily standups. If you feel the standup is too long – separate dev standup from business standup.
- Don’t merge anything in the master without a code review
- Stick with 1-week sprints and do sprint planning every Monday.
- Utilize specialized project management software like Jira, Asana, Notion, or clickup.
- Organize weekly planning. The planning can be done by CTO or founders, but don’t forget to present it to the team and do estimating together.
- Organize retrospectives from time to time, at least once per month.
- Strategically utilize tech debt. Let your engineers add more points to it if they think some features or optimizations can be postponed.
- Execute roadmap planning once in 1/2 month together with all stakeholders and optionally the dev team. Prepare a visual board for this meeting and discuss every feature before putting it on the roadmap.
If you need any clarification or you are seeking help over executing or reacting to the health check drop me a message at yev.rachkovan@gmail.com.