• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Dion Almaer

Software, Development, Products

  • @dalmaer
  • LinkedIn
  • Medium
  • RSS
  • Show Search
Hide Search

Abstractions: Does your code tell a good story?

February 5, 2015 Leave a Comment

I have always been fascinated with how we structure the code and architecture of our systems. Over the years I have found it fascinating to see the fashions change on both surface arguments (e.g. tabs vs. spaces, foo_bar vs. camelCase), and architecture issues (e.g. granularity of services).

I often wonder how much information cascading occurs. We see the side effects when noticing a change in approach that people consider to be a revolution (Ajax, iOS, Docker) compared to one where people believe it is a failure (*cough* EJB *cough*).

The Story

I have often been happy with code that reads well like a story. This is one of the reasons why I disliked the Java of old, as it felt like I was always getting in the way of the story with boilerplate for the computer.

I felt like I was writing sentences such as:

Dion (a person) enjoyed (verb) eating (adjective) food (a noun)

My brain best connected with languages such as Ruby where I could distill the language down.

This is why I have always been fascinated with literate programming.

The Abstraction

What makes coding slightly different to a story though is the domain knowledge of the abstractions.

When I read a book, the majority of the words encompass an abstraction that I already understand. I am then able to chain these together to progress through it from start to finish.

With coding, unless it is writing something that you have a complete model of in your brain (very rare for me since most of the time I am creating something new), you are building a layer of abstractions from primitives. Since this is software, you have a different level of constraints. On the one hand the primitives that you have may be constraining, but on the other hand you can do things that are closer to the mental than the physical (which separates this work from traditional engineering).

If I am reading someones code, I need to get the model into my mind while reading it, which isn’t always easy, especially as you keep nesting abstractions.

This is why we dislike leaky abstractions. When they leak you need to keep more of the abstraction chain in your head.

It is through this lens that I personally enjoy technology such as React. The more I can hide in a <Component> and compose on it the better.

It is also why I often enjoy doing some test first like development to root out an API from the consumer end (top down vs. bottom up). Some problems are easier to reason that way vs. from primitives up. This lets you play the role of a user of the abstraction and it is often a good idea to have the knowledge of a layer above and beyond you, as Glenn always said:

"Developers should always understand one layer of abstraction below their everyday work” /by @glv

— Dion Almaer (@dalmaer) November 19, 2013

Our short term memory

We keep learning about our learning, and it is fascinating. There have been interesting studies around how much data we can keep in working short term memory.

One of the keys is around chunking. When it comes to remembering a string of numbers, it is obvious that you would have a better chance remembering “CIAFBIABCCNN” compared to “AURNFUQTPZYJ” because you can chunk the letters into CIA, FBI, ABC, CNN. Techniques for memorizing packs of cards are all about having an abstraction for each card and then building a story around it: “The queen with the diamond ate at the park with four dogs”.

Do you think that your system tells a story in a way that you can keep the model better in your mind?

This is one of my quests. Mapping a great story to my software so a team can own it and talk at the highest levels possible.

Share this:

  • Twitter
  • Facebook

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Twitter

My Tweets

Recent Posts

  • Generative AI: It’s Time to Get Into First Gear
  • Developer Docs + GenAI = ❤️
  • We keep confusing efficacy for effectiveness
  • The holy grail of a Web SDK
  • The rise of the extensible app platforms

Follow

  • LinkedIn
  • Medium
  • RSS
  • Twitter

Tags

3d Touch 2016 Active Recall Adaptive Design Agile Amazon Echo Android Android Development Apple Application Apps Artificial Intelligence Autocorrect blog Bots Brain Calendar Career Advice Cloud Computing Coding Cognitive Bias Commerce Communication Companies Conference Consciousness Cooking Cricket Cross Platform Deadline Delivery Design Desktop Developer Advocacy Developer Experience Developer Platform Developer Productivity Developer Relations Developers Developer Tools Development Distributed Teams Documentation DX Ecosystem Education Energy Engineering Engineering Mangement Entrepreneurship Exercise Family Fitness Founders Future GenAI Gender Equality Google Google Developer Google IO Habits Health HR JavaScript Jobs Jquery Kids Stories Kotlin Language Leadership Learning Lottery Machine Learning Management Messaging Metrics Micro Learning Microservices Microsoft Mobile Mobile App Development Mobile Apps Mobile Web Moving On NPM Open Source Organization Organization Design Pair Programming Paren Parenting Path Performance Platform Platform Thinking Politics Product Design Product Development Productivity Product Management Product Metrics Programming Progress Progressive Enhancement Progressive Web App Project Management Psychology Push Notifications pwa QA Rails React Reactive Remix Remote Working Resilience Ruby on Rails Screentime Self Improvement Service Worker Sharing Economy Shipping Shopify Short Story Silicon Valley Slack Software Software Development Spaced Repetition Speaking Startup Steve Jobs Study Teaching Team Building Tech Tech Ecosystems Technical Writing Technology Tools Transportation TV Series Twitter Typescript Uber UI Unknown User Experience User Testing UX vitals Voice Walmart Web Web Components Web Development Web Extensions Web Frameworks Web Performance Web Platform WWDC Yarn

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Archives

  • January 2023
  • September 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • November 2021
  • August 2021
  • July 2021
  • February 2021
  • January 2021
  • May 2020
  • April 2020
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • April 2019
  • March 2019
  • January 2019
  • October 2018
  • August 2018
  • July 2018
  • May 2018
  • February 2018
  • December 2017
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012

Search

Subscribe

RSS feed RSS - Posts

The right thing to do, is the right thing to do.

The right thing to do, is the right thing to do.

Dion Almaer

Copyright © 2023 · Log in