Terse versus Verbose, Word Count per Concept

Book

Last week I finally finished reading "Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith" by Sam Newman. 


Aside from learning that breaking apart of the monolith in to microservices and breaking apart the database is not always the best idea, another key take-away that I took from the book is the naming of patterns. 

When we agree upon the meaning of the above terms, we now have a shorthand for describing a complex idea. We abstract away the details to be able to have conversation that that leans towards the terse side, rather than a verbose conversation that requires a lot more words to convey the same meaning.

Podcast

In the same week, I listened to a the following ADSP, The Podcast: "Episode 197: 🇬🇧 Algorithms & Tersity" with Aaron Hsu. In the podcast, Aaron has a lengthy monologue about how mathematics condenses complex ideas in to a very terse syntax. Some programming language follow this philosophy. However, the majority of programming languages have a very verbose form. This has resulted in growth of ideas such as clean and solid code.

source: thesaurus.plus

Final Thoughts

Like most things, you can sound intelligent in any conversation by saying "it's all about finding the right balance." When it comes to this topic - I think that tersity and verbosity is a spectrum. If we add another axis to this spectrum that includes simplicity and complexity - we can then start to map out whether code is:
  • Terse and simple
  • Terse and complex
  • Verbose and simple
  • Verbose and complex
Assuming that the complexity is intentional and not accidental - I will leave it to the reader to decide what kind of code they would like to write and what they actually write.

My code is verbose and (unintentionally) complex. With enough practice I hope to one day be able to write terse and simple code.

Project update: Couch to 5 km and 70 of TDD C++

Brief update on this previous post - now on week 3 of couch to 5 km. Redoing this week as it was for me a difficult step up from week 2. I have a suspicion that the timings are not 100% accurate when the screen locks for extended periods of time. Perhaps I am just terrible at judging how long 3 minutes actually is. In any case, I plan to test the app with a stopwatch, pencil, and paper to check the timings with the screen locked.

Regarding Modern C++ Programming with Test-Driven Development Code Better, Sleep Better by Jeff Langr I am currently on page 41 and I am supposed to be on page 50. I will catch-up the difference over the weekend. The main benefit that I'm seeing as I work through the examples in the code is that due to small increments - it's really easy to catch and fix defects in the code.



CouchTo5km App Fix, 70 Days of C++, and Next App Idea

Feedback on the "Couch to 5 km" App

The great thing about taking your app out for a run to test it - is that you can fix issues! I was delighted to discover that "Couch to 5km" app that I made in Flutter + Dart reset when the orientation changed.

The quick-fix is to set the orientation to portrait only. The better fix is to have a responsive app that adapts to different screen sizes and orientations. At some point I should also look at accessibility.

In any case - I'm on week 2 going on week 3 of "couch to 5 km" and it's been great using the app to learn TDD (test driven development) and actually using it to get fit.


"Modern C++ Programming with Test-Driven Development. Code Better Sleep Better"

I mentioned TDD above. It's something that I find divides developers. Some people think it's great and others active dislike it. As a project manager I do not enforce any techniques or methodologies or tools for the development teams that I work with. However, in order to better understand the possible tools and techniques - I have started mini-projects (such as "couch to 5 km") as a way to get a high level understanding.

My initial attempts at TDD were meant to be widget level tests but quickly morphed into Integration testing. You can find out more about the 3 levels of Flutter testing here: Testing Flutter Apps.

In order to dive a bit deeper into Test Driven Development, I have set myself the challenge to read and put in to practice via code examples the following book: Modern C++ Programming with Test-Driven Development Code Better, Sleep Better by Jeff Langr

Now you might be asking yourself: "Why are you trying to learn Flutter & Dart as well as C++ at the same time?" It's a good question and conventional wisdom online in the programming community encourages beginners such as myself to focus on just one language at a time. 

Never the less I have had the C++ TDD book on my shelf a long time and it's got to the point where I either need to read and practice it - or give it away. The guilt of not reading it has reached a tipping point. Anyway, here is the project that I've challenged myself:

Project: TDD in 70 days
Duration: 70 Days. This is assuming 5 pagers per day for 67 days to reach 331 pages with a few days to spare.
Measure: Read the whole book and completed at least 50% of the exercises.
Notes: This might seem like a simple project, but I'm not very technical and my motivation fluctuates a lot within any given 10 minute time-span.



Future Project: Record My Route

Putting this here as a note to future me. Create an app in Flutter & Dart that allows the user to record their movement across either Google or Open Map. Simple record and stop button. The app will snapshot the locations every X seconds (X could be more or less than once per second). The app will stop the journey and allow playback of the route as either a continuous animation or step through it as if stepping through code with a debugger. The idea needs some polishing... this is the kernel of the app idea.



Flutter: Couch to 5 km running App

"Couch to 5 km" is an app commonly found in the app store that helps people who are non-runners (such as me) build up over a 9 week period into runners who should be able to complete 5 kilometres in 30 minutes.


In the past I have attempted it 3 times and succeeded once. However, whilst I could run for 30 minutes non-stop, I did not reach 5 kilometres. Rather than download another app, I decided to write my own.


The app consists of:

  • List of countdown timers
  • Start / Pause / Stop button
  • Indicator to run or walk
  • Sound to indicate whether to start running or walking

This is my first Flutter app, and as they say "you need to write a lot of bad code before you learn to write good code." Currently there is one widget with all the functionality that should be split. Another improvement is to use streaming - but since I have not learned this yet, I decided to try a different approach to tracking status of countdowns.

Here are some images of the app.




Here is a link to the code in GitHub. 

X / Twitter post about the app: