If you want to code faster, you have to be more efficient. Here are some tips and tricks to help boost your productivity as a coder.
Navigate the article
#1 Squash bugs the moment they appear
Don't let bugs pile up. If you see a syntax error, fix it right away. If you know you need to fix or update something in another file, go fix it. Don't wait. As bugs pile up, they start causing more bugs and adding unnecessary complexity to the task at hand. Keep it clean.
Contributor: Ryan Desmond from codingnomads.co
#2 What can go wrong will go wrong
With every line of code you write, think to yourself, what could go wrong here? When you realize what can go wrong, immediately build in proper exception handling and data sanity checks so that you don't end up having to come back and clean it all up when everything starts going wrong.
Contributor: Ryan Desmond from codingnomads.co
#3 Write tons of psuedo-code
If you write down what you need to do in English, step by step, before ever writing a line of code you can think through it clearly and simply. Write your steps down as pseudo-code, then just come back and fill in the lines of code required. This habit also has the nice side effect of leaving your code well documented, which makes it much easier to maintain and upgrade later.
Contributor: Ryan Desmond from codingnomads.co
#4 Don’t stop learning
Especially in coding, everything is changing really fast. There’s always a new way to make it faster, easier, and more efficient. Spend at least some of your time researching before you start coding. There’s definitely a better way to do things. That being said, don’t just copy and paste. This sort of thing almost always ends up badly. Think about what you do.
Contributor: Sarunas Budrikas from angle180.com
#5 Iterate in small cycles
Don't build an entire project and leave it until the end to test what you've made. Split up the project into chunks, such as a group of related requirements from the project specification and review, implement and test that group tasks exhaustively before moving onto new features. Bugs missed at the start of a project usually are much more difficult to identify and fix later in the project as they are fresher in your mind, so spotting them early will save you a great deal of time and mental effort.
Contributor: Andrew Ward from andrewleeward.com
#6 Upgrade to a mechanical keyboard
A mechanical keyboard makes typing much easier and faster. It is comfortable when you need to code for long hours. Once you're used to a mechanical keyboard, it is hard to go back to a membrane one.
Contributor: Kashish Kumawat from technewswith.me
#7 Do not trust your memory
Always keep a list of your daily targets handy. Whether you type it, write it, or dry erase it, a list is an easy, effective way to make sure you don't lose track of your daily tasks. Simple lists also help measure progress and could inspire solutions to multiple problems throughout the day.
It sounds easy, but lists are the first thing to go when your day gets busy! The next time you tell yourself, I'll remember that write it down, so it doesn't disappear.
Contributor: Aniket Sarkar from robustwealth.com
#8 Prevent distractions
Keep your phone out of site & out of mind. Turn off email, chat & other notifications on your computer.
Contributor: Matt Ferderer from mattferderer.com
#9 Make sure you rest
Top performers rest and prevent burnout. You also switch to a diffused mode of thinking while resting which allows you to think about problems in a less focused way. This is often why you can easily solve a problem the next day or the answer comes to you in the shower, in bed or on a walk.
Contributor: Matt Ferderer from mattferderer.com
#10 Break things into as small of tasks as possible
This will help with naming things. It also helps you get back on track after getting interrupted or taking a break.
Contributor: Matt Ferderer from mattferderer.com
#11 Always pursue the simplest solution that will work
You can't have a bug in a line of code you didn't write.
Contributor: Joshua Harding from mojotech.com
#12 Care about your interfaces more than your implementations
You can always clean up a nicely encapsulated piece of logic, but you can't always redesign an API.
Contributor: Joshua Harding from mojotech.com
#13 Create a Single Source of Truth
Structure information models and associated data schema so that every data element is stored once.
Contributor: Grace Walz (and the Fueled app developers) from fueled.com
#14 Comments on code
Writing comments on your code might seem extra work, but it goes a long way when you revisit your code to debug. You might forget about a use-case and wonder why you added a certain chunk of code. That's where these comments help out. Even if other developers are not going to use the code, always add comments.
Contributor: Prajacta Khopkar from robustwealth.com
#15 Commit and push to version control often
Committing often is particularly important if working collaboratively within a team. By creating commits as you finish each feature, you make it easier to track progress or roll between breaking changes. Should the members of your team be working on different branches, then this might also allow everyone to cherry-pick commits to apply to their current branch in advance of your branches being ready to do a full merge.
Contributor: Andrew Ward from andrewleeward.com
#16 Maintain a project readme.md file
Often you'll do things in a project that have to be done in a certain way or require several steps to get correct. These steps aren't always appropriate to document within your code comments, so instead get into the habit of making a note of these steps in a readme.md file in the root of the project. These notes don't have to be complex, a simple bulleted list including relevant hyperlinks is good enough.
Contributor: Andrew Ward from andrewleeward.com
#17 Ask someone else to review your code often
Get someone to review your code, don't have them spend too long, 5 minutes is enough, but have them review it often. Known unknowns are easy to spot and fix when you test your code, but what about unknown unknowns?
You might be making obvious mistakes and not realizing it. By having someone skim-read your code from time to time, you hold yourself accountable to write clean, commented code, knowing someone will be looking, and if you make a mistake then it will be noticed quickly so that you don't get into bad habits. Nobody wants to realize they have made the same mistake lots of times throughout a project, then have to go through to refactor or re-write code at the end.
Contributor: Andrew Ward from andrewleeward.com
#18 Always check if someone else has solved the problem first
Don't be so fast to jump into coding up a feature right away. Stop, review what's involved, and take ten minutes to see if you can find an open source module or library that does most of the work for you already. This ten minutes of research might result in saving days, weeks, or even months of coding time building it again from scratch. If you improve on the code, you find then make sure to share that change with the repository owner so that you are helping to improve the open source community that you got this free value from in the first place.
Contributor: Andrew Ward from andrewleeward.com
#19 Learn how to write good tests
Writing tests as you go is like using a harness & rope when rock climbing. It prevents you from falling down when you make a mistake.
Contributor: Matt Ferderer from mattferderer.com
#20 Use the best tools possible
Don't be afraid to pay for them. Here are some must-have tools:
Code Linter to keep you from making mistakes & make your code consistent.
Code Snippets & Generators because having to write boilerplate code is boring, time-consuming, inefficient & not why people pay you.
Continuous Build & Deployment tools. You should be able to jump on a new project & spin up a development environment with a single command. You should equally be able to push to a testing server with a single command.
Contributor: Matt Ferderer from mattferderer.com
#21 Start with a plan
Get a sheet of paper and think about what would be the most efficient way to do it. Only then start coding. First time just do it, then try doing it right and after that do it even better. Don’t forget to test your work. Nobody’s perfect at the very first try. Code a little bit, test a little bit, code a little bit, test a little bit. It’s all about persistence.
Contributor: Sarunas Budrikas from angle180.com
#22 DRY Principle (Don't repeat yourself)
When you are writing something that is the same or similar to what you already wrote, move that code into one function and call that function.
Contributor: Grace Walz (and the Fueled app developers) from fueled.com
#23 Single responsibility principle
Basically, modularize each task so it does one thing. This makes it easier to make large changes. For Fueled iOS projects, we use MVVM architecture to separate the data and UI logic.
Contributor: Grace Walz (and the Fueled app developers) from fueled.com
#24 Limit the number of open browser tabs
Having too many open browser tabs might be an indicator that you are juggling too many different tasks at once. Task switching takes time, mental energy and reduces your effectiveness. Try to do one thing at a time with optimal focus.
Contributor: Andrew Ward from andrewleeward.com
#25 Make use of plugins in text editors
Most of the popular text editors like VS Code, Sublime, and Atom come with many useful plugins. Some of these plugins can even autocomplete and autoindent the code.
Contributor: Kashish Kumawat from technewswith.me
#26 Get better at using Git
Git is a version control system and having a good grasp of git commands can make software development process more efficient.
Contributor: Kashish Kumawat from technewswith.me
#27 Use Heroku to deploy applications quickly
Instead of spending a lot of time deploying your Web App on popular cloud service, you can quickly deploy it on Heroku for free. It is simple and easy to use!
Contributor: Kashish Kumawat from technewswith.me
#28 Find the best IDE and tools to develop faster and better
For instance, as a C++ dev environment, I think that Visual Studio is one of the best tools, so I use it to develop faster.
Contributor: Antony Vitillo from skarredghost.com
This post was created with our nice and easy submission form. Create your post!