The current team I am on is really amazing. We have some dev practices that we follow so that all of our projects flow smoothly and prevent us from doing a lot of unnecessary work.
The system we have set up has helped us complete full stack applications on some incredibly short deadlines. Here are ten best dev practices we implemented which help our team to work efficiently.
1. Approve each other's code through pull requests
No one should be able to merge their changes to the main branch of a project unless another team member has reviewed those changes. Having this kind of approval process keeps the code base clean and it helps to strengthen each person's skills as a developer.
When you take the time to do these code reviews, you can find glaring errors that would have caused problems and you can help your fellow developer understand why those lines of code need to be improved. This is one of the best ways to get junior developers up to speed faster and help senior developers remember why they do things in a certain way.
By approving each other's pull requests, you put everyone on the same team. Even the project lead has to have their pull requests approved by another teammate. That way there have been multiple chances to catch any issues before you deploy your application to production.
Image credit: Cheezeburger
2. Make a list of tasks for each project
Having a task list in place before your team starts working on a project will save you so much time. You won't have to worry about people wondering what to do next because there will be a whole list of items to choose from. It also helps to keep track of the changes each person makes in case some questions come up later.
A good system to keep this list from getting unruly is to assign priorities to each task. That way when someone on your team finishes one of their items they don't have to go around asking which items they should work on next. When you prioritize the tasks before everyone gets into the code, you're more likely to finish everything you need to get done in the right order.
3. Set schedules for things like deploying or submitting changes
Keeping everyone on the same page is essential if you want to avoid problems within the team. Pick a day of the week to get all of your changes in and deploy any updates and don't change it. The only time you should have an unscheduled deploy is if there is a major issue that arises. Otherwise, don't change the date.
This helps everyone keep track of their time and it helps keep the pace of work consistent. It also helps prevent a lot of confusion because everyone will know the deadline for their changes to be submitted. A set schedule will also help you plan out any other activities you need to do like have a meeting about the team's progress this week.
Image credit: Simpsonsworld
4. Stick to one code writing convention
Every programmer has a certain way they like to write their code. Some people prefer a two-spaced indention compared to a four-space indention. These little details can be distracting if everyone formats their code differently. The same goes for any variable naming or function naming as well. Have the team pick a format they agree on and use it.
Writing in one coding format will also make it easier to find bugs. You won't have to spend time searching through lines of code to find where the missing comma is because everything will be neatly aligned. Using a standard coding convention might sound a little nit-picky, but it is one of the smallest things you can do to save yourself the most time. Image credit: Usanetwork
5. Write unit tests for everything
Yes, writing tests takes time away from fixing actual bugs. On the other hand, having tests in place prevents a lot of major bugs from making it into the production environment. I'll be honest, it can take a little time to get the whole team on board with writing their unit tests.
Once you get them going, it's worth every bit of the struggle. Get to the point where you are running all of your unit tests before you approve any pull requests. The great thing about unit tests is that once you've written them, you don't really need to change them and you can reuse them in multiple projects!
6. Write reusable code
Having a team that focuses on writing reusable code is invaluable. Eventually, you end up with your own libraries for all of the common things you do on every project. That brings a certain uniformity and level of control that you can't get from other libraries because you built this one yourself.
This "home code base" will help your entire team be more efficient because you will have plenty of examples of code to look at and use. You'll be able to take the forms from one project and easily adjust them to fit another. You'll be able to take APIs from one project and use them anywhere else you want to! Getting a project finished is important and having these code snippets lying around will help you.
Image credit: emibob
7. Double check any APIs before you release them
Any time you have a code that deals directly with the database, you need to test it heavily. One of my team's favorite tools is Postman. You can make as many API calls as you like without taking security risks. This is one way you can make sure your APIs are handling the data like you want them to.
Always check that you are getting the right data back. What we usually look for is any unnecessary data. For example, if a phone number is being returned in the data but we don’t use it anywhere, it's unnecessary and it will get removed. It's also important to make sure the APIs are able to handle the correct input values. There shouldn't be any unused parameters.
Image credit: Demic
8. Keep the responsibilities of the code separate
In the scurry to finish things quickly, developers write some hacky code to make sure their logic is correct or the right code gets executed. Don't be that person on the team and don't leave that code in there. This is one of the things that can slip through the cracks and it is one of the hardest things to find and refactor later.
Image credit: rawpixel
9. Set up a communication system
Use Slack, Google Voice, Skype, something that makes it easy to talk with everyone on the team. Sometimes you just need a quick question answered and it doesn't require an email. A good communication system will make it easy to work with your team in real time which can make the difference between getting a project deployed on time.
Let everyone know that they can still have fun too. Not every bit of communication has to be related to the project or use a formal tone. You'd be surprised by how funny some of your teammates are even though they are some of the best developers you know. The best practice you can create for your team is letting them be themselves.
Image credit: Slack
10. Make sure everyone on the project knows how it works
This is a practice that has saved my team from complete client meltdowns. Never have a project that only one member of the team. Every person in that team needs to know how that project works inside and out because you never know who will have to be the hero one day.
As a bonus, when everyone knows how the project works, they feel more confident working on it. When everyone on your team has that confidence, the project flows better. There are fewer disputes over those insignificant details and you'll see a lot of good work come out of it.
Image credit: NFL
There are a lot of programming best practices out there, but it's equally important to understand the best practices for a team. These are some of the ones that my teams have used and they have saved our butts multiple times.
What's the best practice your team follows? Share it in the comment section below 💬
Useful list, thanks.
Make sure everyone on the project knows how it works
I don't think it's possible in large, old projects for everyone working on it to know how it works.
That's the main difficulty of working on large projects. You have to figure out what other people did, and what you can safely change without affecting seemingly unrelated parts. You need a lot more structure.