Great Software Design is an investment in the long run

Iryna Mykytyn
2 min readJul 31, 2020

I have just watched great talk of John Ousterhout on the topic of Software Design and I would like to share here few thoughts I really like and totaly agree with from that talk.

Photo by Austin Distel on Unsplash

A few overall concepts

Classes should be deep

  • Classes should be deep: with a very simple interface and with a very large amount of functionality underneath it.
  • Don’t focus on the length of the methods, focus on abstraction. Number of lines is not so important as the depth of the class. Length isn’t the big issue as long as code is clean. Think about abstraction and complexity first and then you can chop the method up if it’s too big.
  • Do things for the future usage of the class but don’t try to think too far ahead since we can’t visualise the future very well.
  • Classes are good, but this doesn’t mean more classes are better — no shallow classes. Classes should be deep.

Avoid exceptions

  • Exceptions: try to minimize the number of places where exceptions must be handled because it’s a huge source of complexity.
  • Ideally no thrown exceptions at all. Google C++ Style Guide advise not to use exceptions at all, see cppguide.html#Exceptions.
  • Throw an exception when you can’t keep the contract with the user of class, because you can’t implement it with that exception case.
  • Program crashes are a good thing in certain cases, for ex. if you go out of memory — just crash.

Tactical vs Strategic Programming — prefer the second one

Working code is not enough, but you also have to have great design to simplify future development.

Mindset: great design it’s investment — it takes extra time today but it pays back in the long run.

You can watch the whole talk on the YouTube. Enjoy!

--

--

Iryna Mykytyn

Computer programmer specialised in C++ and the Linux OS . Passionate about coding, technologies and learning new tools for optimisation and performance analysis