CodeNPaste: Blog

5 steps method to improve programming speed and efficiency

  • Productivity
  • Organization
  • Planning
By Grégoire LEGEARD - May 29th, 2020 - Originally published on Quora

Coding is an iterative approach. The more you code, the more you learn, and the more your coding speed increase. Why ? simply because there is less research, less experimentations, and more recycling and knowledge application. Here is a 5 steps method to take advantage of your experience and improve programming speed and efficiency.

1 - Sketch out the design or structure.

No matter the size of your assignment, small or big, use a tool to sketch out what you are about to code. For example, you can utilize UML (with Online Diagram Software & Visual Solution | Lucidchart) , Graphic Design Tool (like Adobe Illustrator, Affinity Designer, ... )


YOUR BENEFIT: it helps visualize, communicate, and define the project and coding needs.


It's much faster to create a visual of a Webpage or UI with a graphic design tool than to code it. The same applies to software structure when using UML. You can also make several sketches and decide which one is best suited for your need.

It's an investment in time, but you reap off the benefit at the end of the project and prepare your future in management.

2 - Use step 1 to plan and structure your code and infer the needed re-usable components.

Use the sketch you have just done to define your code precisely and ask yourself:

  • How will you structure your code
  • Which tools, attributes, properties, class, method, etc. are needed?
  • How can they be divided, grouped, named them, etc. ?
.

YOUR BENEFIT: minimize the number of lines to write and keep the structure clean.

3 - Develop and test your code step by step

Don't rush in writing all code ready at once. Divide your work in the smalled unit possible that can be tested to confirm it's working as you wish.


YOUR BENEFIT: it reduces your debugging / troubleshooting time and makes it much more manageable.

4 - Refer to the work you have previously done.

Don't repeat yourself. If there are components you have previously written and could use again, retrieve it. Ding in your past project, or code database, to import the re-usable components into your code and adapt them.

YOUR BENEFIT: you don't need to code it again, only adapt it and save time.

5 - At the end of your project, take the time to reflect and refactor your code.

Now the project is over. The code is running smoothly. So it's time to debrief and ask yourself:

  • What did you learn?
  • What would you have planned and structure differently?
  • What code or object can you later reuse and archive them?

You can use a traditional file system to store your re-usable components or an application like the one provided by CodeNPaste: to store and retrieve your components (The more re-usable components you have, the handier it is an app for retrieving them). You can also share them if you have the right to do so.


Final word

Step 1 to 4 - systematically helped me be significantly more efficient down the line. Every time I tried to outsmart these 4 steps and skip them, it resulted in longer production time and inferior results.

Step 5 - is the long term approach to learn, organize, and improve my coding skills.

This method works in many areas, not only coding ...