Member-only story

How to Optimize Code

Brian N. Siegelwax
4 min readMar 16, 2020

I am here to advocate — whenever time permits — rewriting your code from scratch. We can all look back on code that we wrote months, years, and maybe even decades ago and be thoroughly embarassed by what we produced. However, you often don’t have to wait nearly that long before reaping potential benefits from rewriting your code.

This also applies to those who take programming courses, whether self-taught or otherwise. You may complete exercises and move on, but how much of anything do you really learn when you only do it once? Go back and do the exercises one more time from scratch, and observe the difference.

Writing From Scratch

Code libraries exist that simplify a great many functions. However, it’s possible to start using these libraries without any fundamental understanding of what they’re actually doing for you. Consequently, I have observed students exhibit frustration over trying to use provided code samples beyond the given tutorials.

Perhaps I am not the only one who has observed this, as there is a growing number of code-from-scratch tutorials that help you achieve a base understanding of whatever it is you’re trying to do. By acquiring this knowledge first, you can go on to employ these libraries expertly. And while I have subscribed to this method of learning for a long time, I take it one step further.

--

--

Brian N. Siegelwax
Brian N. Siegelwax

Written by Brian N. Siegelwax

The least qualified person in quantum.

No responses yet