How to code? — 11

Thalapathy Krishnamurthy
2 min readNov 6, 2019

--

Read post-10 here.

I will summarize our journey in creating a backup application so far.

  1. We wrote a copy() function that copies files from a source folder to a destination folder (or backup folder)
  2. The copy() function also recursively calls itself if it encounters a sub-folder until it deep copies every file under it to unlimited levels
  3. We examined the incremental copying to be done by maintaining the last copied file in a meta file in the destination, dropped it as it does not guarantee the sanity of the meta file contents when a PC shutdown happens abruptly.
  4. We looked at finding the last modified timestamp in the destination and continue to copy source files beyond that for a incremental backup. But then we dropped it as there could be source files that might have got modified as the backup proceeded.
  5. We settled finally to always prepare a source file list based on the size of the file whenever backitup runs.

Some of the things we learnt while doing this are

  1. Explore, question, iterate on the problem until we know what we want to solve exactly.
  2. Sort the needs as business or technical. Business needs drive technical needs.
  3. Some needs are far fetched like the ability to backup to cloud. Leave them for later rounds.
  4. When there are multiple things of the same thing (like multiple sources feeding data to the program), abstract the interface to them and make them plug-able.
  5. Applications that deal with data have to be largely reliable or need to handle failures from day one. The design for this have to be addressed right in the beginning.
  6. Start thinking about how the user will use your application. And design the simplest way in which that can be accomplished.
  7. As soon as there is a clarity on the key functions, begin to code and learn things that can be bottlenecks in the design.
  8. Key algorithms should be succinct and describable. Keep refining them until major design bugs are uncovered.

--

--

Thalapathy Krishnamurthy
Thalapathy Krishnamurthy

No responses yet