│

Exploring Quality, Complexity, and Creation

Category: Uncategorized

  • Meekness to Liberal Arts: Generics in Complex Systems

    Meekness to Liberal Arts: Generics in Complex Systems

    I’ve been blessed with several opportunities to speak to students at my local university. A professor, that I admire greatly, likes to have career individuals come in and discuss technologies used in the industry. One year I was introducing the students to code repository and container technologies, such as GIT and Docker, technologies I enjoy immensely. During the discussion, the professor left for a short time. After he left, a student, who was quiet up until then, raised his hand for a question. When I turned to him, he asked “why are they not teaching us these technologies here at the University? They seem fundamental to being a programmer.” My response was not well received: “You are here to get educated, not trained to be a programmer.” The students’ blank stares told me this distinction was unfamiliar to them. We continued on discussing technologies, but this short conversation represents the confusion that exists in our culture about our university system and their primary responsibility.

    For a short time, the industry actively recruited people with liberal arts degrees. Eastern Airlines has their famous saying “You educate them, we’ll train them.” Why did the industry emphasize a liberal arts education? What I’d like to discuss is the concept of generics, how a liberal arts education relates to it and how generics is an incredibly important aspect in a complex systems.

    Consumer Provider Paradigm

    All complex systems are hierarchical. In order to be complex, a system has to distribute its complexity into smaller interconnected modules. Think of a human: our organs are smaller modules that together creates the structure of a human. These modules encapsulate a responsibility that is needed in order for the complex system to function. Your heart pumps blood, your kidneys clean your blood, etc. One important relationship between modules is its dependency structure. A human depends on organs in order to exist. The human is a new quality that can only exist by its dependencies: the organ. But the hierarchy doesn’t stop there. Humans become a module in other systems, like a employee in a company or a member in a church. The company and the church are dependent on the module that is the human, just like the human is dependent on the organ. But the hierarchy doesn’t stop there either. The company is a module in the economy and the church is a module of society.

    This relationship between dependencies is what I call the Consumer Provider Paradigm. Why “consumer” and “provider”? The dependency between the hierarchical modules is that of a consumer and provider. Your organs provide a service to the human while the human consumes their services. Same thing at the next level of the hierarchy: the human provides a service to the company and church while the company and church consume the service of the human. This dependency in complex systems is about consuming and providing. What a module consumes or provides is unique to the module, but this rule is absolutely important:

    All modules in a system have to consume lower level dependencies AND also provide to higher level modules.

    No module can only be a consumer or a provider alone. They have to be both. Take the human: they have to consume the services of the organ in order to function, but they also have to provide services to the company and/or church. When a module only consumes or only provides, the module can no longer fit within a complex system and will eventually be removed.

    Black Swan Events

    Because of this Consumer Provider Paradigm, complex systems are always incredibly large in scale. For example, there are many many hierarchical biological modules that make up your own body, all the way down to the atom. Because of the large scale of all complex systems, due to the structure that is produced from the Consumer Provider Paradigm, nothing can fully conceptualize the entire system. Because of this, complex systems are susceptible to Black Swan Events. A black swan event is a highly improbable and unpredictable event that has massive and widespread consequences. This concept was popularized by Nassim Nicholas Taleb in his 2007 book “The Black Swan: The Impact of the Highly Improbable.”

    There are three main aspects of a black swan event that are important: rarity, extreme impact, and retrospective predictability. Most complex systems of importance are fairly robust. One can make predictions that are mostly accurate by using the law of averages. However, since complex systems are unfathomable by nature, some major “glitches” can happen. Since these complex systems are fairly robust, these glitches happen rarely. But, they can have a major impact. This impact can be positive or negative.

    The majority of Taleb’s examples of black swan events were negative: the 9/11 terrorist attacks, 2008 global financial crisis, World War I, and the spread of antibiotic-resistant bacteria. Positive black swan events don’t create much anxiety, but negative ones can take down systems. Because negative black swan events can cause way more damage than the positive ones do good, we humans naturally are bias towards loss aversion. This is called Prospect Theory, a theory developed by Daniel Kahneman and Amos Tversky. This theory states that people feel the pain of losses more intensely than the pleasure of equivalent gains. For example, losing $100 typically feels worse than the joy of gaining $100.

    What are the best ways to prevent negative black swan events? Taleb gave several concepts on how to handle negative black swan events in his book Antifragile. One of those concept is that of Optionality.

    Optionality

    One of my pet peeves as a software architect is when a junior software developer creates a piece of code that can only do one thing. A piece of code that can only do one thing lacks options, or what a systems engineer would say is that it is “low in optionality.” To create a robust system, one that can handle negative black swan events, modules within the system need to be created with high optionality.

    Optionality provides the ability for modules within a complex system to be a dependent in more than one way. For example, think of it in something that you use everyday, like a vehicle. The more options that a vehicle provides, the more ways one can use it to provide transportation. Hybrid vehicles provide more than one energy source: gas or electric. Pickup trucks have the option of using only two or all four wheels as to provide the ability to perform well on both paved roads and off-road terrains. And so on. The more options for a module, the greater the ability for it to be adaptable and flexible.

    Why optionality is important is that when a negative black swan event happens, optionality provides the ability to the system to adapt at every level. When a system is properly distributed and modules self-restricted to their responsibility, the sources of the negative event can quickly be understood. The additional options can then provide the ability to make adaptive changes to quickly reduce the negative events. Think again of a vehicle, if a truck is stuck in the mud, enable the four wheel drive. If the hybrid runs out of battery, turn on the gas engine. Even though these situations aren’t a traditional black swan event, it illustrates how optionality provides the adaptability needed to overcome a negative event.

    Law of Diminishing Returns

    However, as an engineer, the trick is to provide many options that fit within the responsibility of the module within the complex system. In my article Know Your Freedoms: Responsibility in Complex Systems, I go over how each module within a complex system needs to have a responsibility and the freedom to fulfill it. For example, a vehicle has the responsibility to transport items and people across a terrain. Another example that I give in the article is the responsibilities of the different organs in your body: your heart and the complexity of pumping oxygenated blood, the kidneys and the complexity of filtering waste products from the blood, etc. The optionality provided for each module in a system needs to be relative to the responsibilities the module has to fulfill. A vehicle shouldn’t have a retractable landing gear for an option since that is outside its responsibility for transporting items across a terrain. Similarly, the heart shouldn’t have any option to clean waste out of the blood since that is outside its responsibility.

    One of the drawbacks of optionality is the application of it quantitatively. Just adding a lot of options, without the vision of understanding the responsibility of the module within the system, will only lead to bad results. A classic example of this is the Swiss Army Knife. What is a Swiss Army Knife? Is it a knife? Or is it a Scissors? How about a saw? It contains many many different unrelated functions into one module. As a systems engineer, this would be a monolithic system: one module that can do many different functions. One can argue that this would be valid implementation of “optionality” in the quantitative sense.

    Back to the example of optionality with vehicles: adding more options will make the vehicle more adaptive, but adding other options will make it more brittle. For example, what if we added a feature to toast bread? It’s an additional option to the vehicle when you might need to toast bread, but it is completely outside of the responsibility of the vehicle: to get a person from one place to another. But Jesse, you might say, nobody would be dumb enough to add a toaster to a vehicle! This is an extreme example to prove a point, but here are some actual options for vehicles that were sold on the market: in 2004, MINI introduced the MINI Cooper S XXL, a climousine featuring an integrated whirlpool at the rear; In 2009, Honda introduced the Dog Friendly™ package for the Element, which included features like a cushioned pet bed and spill-resistant bowl. Sadly there’s more.

    Just adding more options to a module in a system will not make it more robust. The options need to be qualified and scoped to the responsibility of the module. Adding more options without proper qualification will lead to diminishing returns over time. In economics, this is called the Law of Diminishing Returns. This law suggests that at some point, the addition of more options leads to reduced benefits or increased complexity within the module without a proportional gain. With the vehicle example, the more options that are added, the more complex the maintenance will be over time. This is quickly becoming an issue with the auto industry due to the gluttony of electronic and software options they are adding to the vehicle. The Law of Diminishing returns states that soon the maintainability and extensibility of the vehicle will be quickly compromised due to the overwhelming complexity of the entire number of options available. Ever take your car in because of some software issue and have the mechanic tell ya “we don’t know how to fix that.” It’s happened to me many times already, and will probably only get worse.

    Truth Seeking

    Sadly the quantifiable ideal is way more prevalent in our society than one would wish. In my industry, “data driven” is oversaturated with quantifiable thinking. Everybody wants more data! However more data usually means more noise. A wise man once asked me this important question:

    What’s the difference between data and information?

    His answer blew my mind: information is qualified data! Or, information is data that leads to truth. The opposite of information is noise. Noise distracts us from truth. Our aim should always be to pursue truth. In business, rather than merely striving to be data-driven, we should prioritize truth-seeking. When we focus on truth, we can better discern between meaningful information and irrelevant noise. This clarity enables us to gather insights that lead to more effective solutions for our clients.

    This principle aligns closely with Christian teachings: Jesus emphasized the importance of truth and living in alignment with it. In John 14:6, Jesus declares:

    I am the way and the truth and the life. No one comes to the Father except through me.

    To fully connect with God, one must seek truth. In the relationship between consumer and provider, truth illuminates the path forward, guiding decisions and enabling us to qualify options effectively. These judgments, I believe, are revealed to us. Similarly, as I write this book, I find that silencing the mind is essential to gaining insight. In my article Creating New Ideas Through Boredom, I explore how quieting the mind creates space for inspiration and fosters creative problem-solving.

    So if we’re limited in how much optionality we can add to a module, but we have to add optionality to a system to make it robust against black swan events, how do we properly provide optionality to modules in a system? I believe that there is another aspect of optionality that helps with maintaining the quality of a system in that it helps make modules reusable. However, there is another level of quality that will help us to ensure the ability to create positive black swan events in the future: this concept is generics.

    Generics

    Asking people to define “generics” has been an interesting endeavor. The overwhelming response to this question went something like this: a cheap knockoff of a name brand pharmaceutical. It always came back to pharmaceuticals, specifically! In any case, the heart of the definition that is prevalent in our culture is that it has to do with a cheap or lesser alternative to an original. This, I believe, is a devastating definition to a concept that is so important.

    Here’s is a definition of “generic” from a complex systems perspective:

    A module in a system that is highly versatile and can provide in many unforeseeable ways that are valid to its responsibility.

    This definition is more about the quality of how a dependency provides value. A complete contrast to todays definition that is culturally prevalent is more focused on quantity; allowing for a cheap copy allows manufacturing to provide more of something at a cheaper cost. This can be seen as a good thing, but I believe its really a symptom of an deeper issue within the pharmaceutical industry: drugs are researched and designed to solve specific problems. True generics should be able to solve many unforeseen problems.

    A hammer, for example, is a generic tool. Its so generic, it can be used to create or destroy. It can be used it to create a shed in your back yard, but it can also be used to create a space shuttle to take humans to the moon. What’s the responsibility of a hammer? To deliver impact to an object. Use your imagination to dream of different types of solutions that a hammer can be used to solve that don’t exist yet. That’s generics!

    Another example of generics are motor vehicles. The responsibility to a motor vehicle is to get a person or people from one point to another. What makes motor vehicles generic is that it allows people to go to just about any place on land. By contrast, trains and trams can take people to only specific places due to its reliance on rail. Due to the generic nature of motor vehicles, they have been the de facto mode of transportation, especially in rural areas. The way they are built provides many unforeseeable ways that a person can get around.

    In my industry (software), we have another word for genericizing a solution: productization. When creating a solution for a client, we naturally create a specific solution. This one solution will address the one client’s need, but won’t for any other client since not everybody has the exact same problem to solve. Productization is the process of genericizing a solution so that it will solve many more problems. An example in the software industry: we could create a custom website for selling t-shirts for a client that only sells t-shirts. Or we can create a more generic e-commerce framework that would allow clients to sell general products, such as t-shirts, but any other type of product. By genericizing the solution, we can provide a solution to many more clients without much effort or cost. But generic solutions are usually an 80% solution. I’ve never been able to create a generic solution that will accommodate all requests for a client.

    Productization forces us to create more complicated solutions. Creating that generic solution, while also keeping it simple to use, is incredibly difficult to accomplish. The best generic solutions can provide many options without much complexity. It needs to provide way more benefit than costs. The optionality that is using a generic solution needs to be asymmetric.

    Asymmetric Optionality

    Here is where I admit that the definition of Optionality that I provided earlier is not that of Nassim Taleb’s. In fact, its quite the opposite of his concept. I’m sure that if he was reading this, he wouldn’t have gotten this far just out of sheer disgust: calling me a fragilista or worst, an economist. Taleb spends a huge portion of his book Antifragile: Things That Gain from Disorder qualifying his concept of Optionality. One of his main points in defining Optionality is on asymmetry: the idea that certain options or strategies provide disproportionate benefits relative to their downsides, especially in uncertain or volatile environments.

    In essence, asymmetric optionality is a cornerstone of Taleb’s broader concept of antifragility: systems, people, or strategies that thrive and grow stronger in response to uncertainty and adversity. It encourages embracing opportunities with a large potential upside while guarding against excessive risk.

    An example of this is writing books: The effort and cost of writing are limited, but a successful book can generate significant income, recognition, and influence for decades. Another example is Venture Capital: Venture capitalists often invest small amounts in many startups. Most of these startups fail, but the few that succeed provide massive returns, more than compensating for the losses from the many failed startups.

    To contrast this, the definition that was discussed earlier was primarily a quantifiable approach to the concept. Meaning, add more options without judging the quality of the option. Sadly, as discussed before, this is a natural reaction to solving problems without discipline or experience. Taleb’s beautiful concept is a qualitative idea wrapped in systematic thinking. It’s about improving the quality of the system.

    To the motor vehicle example, they have many upsides (like being able to go to any place on land) with few downsides (just need gas). However, there is a downside to motor vehicles that urban areas are only now starting to realize: motor vehicles as a transportation module doesn’t scale very well. Congestion is becoming an exponential problem in all modern urban areas. The only way to solve this is to increase optionality at a higher level in the system: motor vehicles need to be one option with micro mobility, train, trams and buses. By providing more options at a higher level, we are increasing the upside while decreasing the downside.

    Optionality relates to choosing or creating options that provide way more “upside” than “downside”. It is qualifying the options in a way that will help or hurt the system in the future. Generics, on the other hand, is about providing options that can be used in unforeseeable ways. The difference is subtle, yet substantial. Asymmetric Optionality can contain specific and generic solutions. However, generic solutions are needed in order to fully achieve what the majority of businesses can only dream of happening: a positive black swan event.

    Positive Black Swan Events

    As a software engineer, my career has been centered around building tools. There’s an incredible sense of satisfaction when I see clients using the tools I’ve developed, especially when they do so with ease and intuitive understanding, without encountering much friction. But there’s a remarkable experience I’ve had the privilege of encountering a few times in my career: clients using the tools I designed to accomplish things I never anticipated or imagined. That feeling is nothing short of euphoric.

    Earlier we discussed what Black Swan Events are and that these events can be positive or negative. We also discussed how Optionality can help with negative Black Swan Events by allowing us to easily adjust and adapt different modules within the system to negate the negative consequences. However, we didn’t really talk much about positive Black Swan Events.

    The concept of generics is, I believe, central to the creation of positive Black Swan events. Let’s take a look at some examples of positive Black Swan events in history. One of these is the introduction of Apple’s iPhone. When Apple introduced the iPhone in 2007, it redefined the smartphone industry, creating an entirely new ecosystem of apps and services and revolutionizing how people interact with technology. Another example is Google’s Search Engine. While there were earlier search engines, Google’s algorithmic innovation led to unparalleled access to information and transformed how people navigate the internet. What these two examples have in common are that they are generic solutions: they can be used in many unforeseeable ways. The iPhone can be used for making phone calls or managing your blood pressure. The Google search engine solves the general problem of “finding information,” enabling use cases ranging from casual queries to academic research and even e-commerce optimization.

    All the examples of positive Black Swan events that I’ve researched share a common thread: they are deeply connected to the concept of generics. From The Printing Press to The Internet, positive Black Swan events were caused by generic solutions that provide unforeseeable solutions. These generic solutions are remarkable because they serve as foundational frameworks, capable of addressing a wide range of problems, many of which were entirely unforeseeable at the time of their inception. In each case, these positive Black Swan events illustrate how generic solutions, by their very nature, create fertile ground for innovation and emergent possibilities. They provide a flexible, scalable foundation that adapts to unforeseen challenges and opportunities, often reshaping industries and societies in profound ways.

    Although these positive Black Swan events have profoundly shaped humanity, their origins are deeply ironic. Each of these widely transformative innovations began as a solution to a highly specialized problem before evolving into a more generic application.

    The printing press, originally designed to replicate religious texts, eventually enabled the mass production of books, newspapers, and educational materials, democratizing access to knowledge. The steam engine, first invented to pump water from coal mines, became the driving force behind locomotives, ships, and industrial machinery, powering the Industrial Revolution. The internet, initially created for secure military communications, expanded into a global network that connects billions of people, facilitating commerce, education, and social interaction. Computers, originally developed to break encrypted codes during World War II, evolved into general-purpose machines that now power everything from personal devices to artificial intelligence. Vaccines, first developed to combat smallpox, laid the foundation for immunology, leading to the prevention of countless diseases and the extension of human lifespans.

    All of these breakthroughs started as niche solutions before evolving into broadly applicable technologies. It was only through this transformation that they became the world-changing innovations we recognize today. This highlights the critical role of adaptation. Whether in technology, where we call it “refactoring” in software development, or in personal growth, as Christianity emphasizes being “Born Again.” The ability to adapt is what allows solutions to transcend their original purpose and become universally impactful, more generic!

    Interestingly, this insight wasn’t mine but came from a close friend who was reviewing a presentation I was making on this very topic. He quickly noticed that my list of generic solutions had all originated as highly specific ones, sparking a deeper realization about the power of adaptation. And this is exactly why it’s so important to allow people to critique your ideas. Sometimes, the most valuable insights come from an outside perspective.

    These, and other examples of generics are more technology related our discussion. However, is there an equivalent idea at the social or intellection level?

    Meekness

    Much like how the definition of generics has been misconstrued over time, the meaning of meekness has also been distorted. Our current western culture seems to conflate meekness with weakness. Terms like “submissive” or “pushover” are often used to describe a “meek” person. Some dictionaries, like Merriam-Webster, describe how a meek person is “dominated”: “a meek child dominated by his brothers.” However, these interpretations sharply contrast with the original meaning of meekness, which aligns more closely with the idea of generics.

    The original Greek word often translated as “meek” in the Bible is πραΰς (praus). This term can be found in texts such as the Sermon on the Mount where, in Matthew 5:5, Jesus states:

    Blessed are the meek, for they shall inherit the earth.

    The word “praus” was originally used by the ancient Greeks to describe a wild horse that had been tamed and brought under control. These were strong and powerful animals, but their energy and strength were harnessed and guided, not broken. The term conveyed the idea of power under control: a horse that retained its strength and spirit but was disciplined and obedient to the rider’s commands. This was important when the ancient Greeks rode these tamed wild horses into battle: the wild spirit of the horse gave them energy while the skill developed through training allowed the horse to endure harsh battle environments. Spirit and training are at the heart of the original term for meekness. Or, the horse had to be ready for many unforeseeable situations so that it can fulfill its responsibility: transporting the warrior into battle.

    Here’s a more abstract definition of praus: preparing to be applicable, or adaptable in many unforeseeable ways in order to fulfill responsibilities. At the heart of meekness is generics. The ancient Greek horses had to be trained so that it could be adaptable under stressful situations in battle. They needed to be adaptable and agile. If the horses were specialized, then the horses would struggle outside of their narrow focus. For example: a horse trained exclusively for racing might excel on an open field but become agitated or ineffective in close up combat. Preparedness for the unknown was essential!

    The ancient Greeks understood that their horses needed to be more generic. This adaptability ensured that their resources could meet the diverse needs of their society efficiently. Eventually the concept of “generics,” would spread beyond their equestrian practices to other aspects of their lives, including politics, philosophy, and interpersonal relationships. For this idea to take root and influence in so many facets of Greek life, it was deeply embedded in their educational system. The Greeks were pioneers in the concept of a well-rounded education, which was the foundation of the their educational system that they created called the “liberal arts.”

    Liberal Arts Education

    The liberal arts has been the at the root of the western educational system since the 5th century BC in Greece. Philosophers like Plato emphasized the need for an education that went beyond practical skills to include the arts and sciences that were considered essential for a free citizen. The curriculum was designed to cultivate a well-rounded individual capable of independent thought and civic engagement. This idea was inherited in the early Christian Church where early Christian scholars like St. Augustine (354–430 AD) and Boethius (c. 480–524 AD) were heavily influenced by classical education. They embraced the liberal arts as a tool to understand and explain Christian theology.

    During the early Middle Ages, Christian monasteries and cathedral schools became the centers of learning. They adopted the Trivium (grammar, rhetoric, and logic) and Quadrivium (arithmetic, geometry, music, and astronomy) as the basis of their curricula. By the 12th century, the liberal arts had become the foundation of the curriculum in the first European universities, which were established under the auspices of the Church. Christians integrated the liberal arts with theology, seeing them as complementary rather than conflicting.

    The liberal arts curriculum was designed to cultivate versatility and critical thinking, preparing individuals to excel in a wide range of fields and challenges. By training citizens to think broadly and adapt principles across domains, the liberal arts became a vehicle for spreading and reinforcing the value of generics throughout one’s culture. Unlike specialized training, which hones skills for a singular purpose, the liberal arts emphasized the development of universal skills—such as logic, rhetoric, ethics, and mathematics—that could be applied across disciplines. The Greeks, followed by the Christians, believed that by fostering a well-rounded intellect, individuals would not only be better prepared to address the complexities of their immediate roles but also adaptable to new and unforeseen contexts, making them more “generic.”

    In his book You Can Do Anything: The Surprising Power of a “Useless” Liberal Arts Education, George Anders explores the value of a liberal arts education in a rapidly changing job market. Anders argues that the core strengths of liberal arts education are becoming increasingly essential as new job categories emerge and traditional ones evolve. Due to the exponential growth of technology, how the economy is evolving faster than ever. Anders demonstrates how the diversity of job types has grown exponentially, emphasizing that we’re living in an era of unprecedented opportunity and transformation in the labor market. Liberal arts graduates are uniquely positioned to succeed in this rapidly changing landscape due to their adaptability, critical thinking, and ability to learn quickly in unfamiliar contexts.

    Even though our ancestors understood the benefits of generics, focused on the virtue of meekness, and built an educational system based on generics that flourished for centuries, our modern culture has lost this understanding. We are hyper-focused on specialization and vocational training. Our university system has slowly changed from a focus on creating well-rounded citizens to training people for specialization with the introduction of the “major” in 19th century Germany. This shift, over the last century, has led to a narrowing of perspectives, where students are increasingly prepared for specific jobs rather than for the broader challenges of life and citizenship. While specialized knowledge is undoubtedly important, it risks leaving individuals without the critical thinking, adaptability, and ethical grounding necessary to navigate the complexities of a rapidly changing world. The result is a generation of highly skilled professionals who may struggle to engage with broader societal issues or think across disciplines, ultimately weakening the social fabric and the capacity for innovation in our culture. However, there is still an opportunity to reconnect with the wisdom of a more holistic education, where the principles of generics and broad-based learning can help shape the next generation of leaders, thinkers, and innovators who are equipped not just with specific skills, but with the deeper understanding and adaptability to thrive in a complex world.

    Overview

    Generics is a module in a system that is highly versatile and can provide in many unforeseeable ways that are valid to its responsibility. This is essential for not only creating a maintainable and adaptable system, but it is a necessity for creating a system that can create positive Black Swan Events: rare events that positively alter the course of history. This basic concept of generics is infused in our western values through our religious and educational systems by the virtue of meekness.

  • Creating New Ideas Through Boredom

    Creating New Ideas Through Boredom

    Creative problem solving, on the spot, is a pretty difficult task. Solving problems is difficult enough, but to be creative in your solutions is a whole other level.

    Early in my career I was fortunate to stumble on some ways of generating creative solutions. Now there is some good science coming out showing there is a great way of creatively solving a problem: boredom.

    Walking For Solutions

    Back when I was just starting my career, I worked in an office that was next to a residential area. During lunch, when the weather was nice, I would go for a walk to get my mind off of work. After a few walks I noticed that some problems I wasn’t able to solve during work hours would magically solve themselves when I was out on my walk. I wasn’t even thinking about the problem and a solution would just pop in my mind.

    Now whenever I would get into a situation where I’m having a hard time coming up with a solution, I will go out for a walk. Many times I will get a solution before reaching the end of the block. Why!?!?

    Active Mind At Rest

    New neurological research has revealed quite a bit about how our brains work. Recent research, according to
    Olga Mecking’s book Niksen shows that our brain is actually more active when it is at rest.

    the brain when people were not doing anything in particular, and instead of less activity, he saw areas with increased activity.

    Olga Mecking. “Niksen.”

    Essentially, our brain is more active when we are bored. When doing a task, the mind will shut down other processes to help focus resources to complete the current task. This limits the ability for the mind to create new neural connections. Olga continues “I was surprised to find that when you engage in a task, some areas of the brain actually decrease in activity.”

    Hare Brain Tortoise Mind

    Similarly, in his excellent short book “Creativity“, the famous John Cleese talks about how his “unconscious was working on stuff all the time, without being consciously aware of it”. This he labeled the Tortoise Mind, from the book “Hare Brain, Tortoise Mind” by Guy Claxton

    The traditional concept of the brain, the part that processes information using logic and reasoning on deliberate conscious thinking he labels the “Hare Brain”. But, according to Cleese we have another brain: the “Tortoise Mind”.

    [The Tortoise Mind] proceeds more slowly…It is often less purposeful and clear-cut, more playful, leisurely or dreamy. In this mode we are ruminating or mulling things over, being contemplative or meditative. We may be pondering a problem, rather than earnestly trying to solve it.

    This Tortoise mind isn’t as clean and refined as the Hare Brain. It’s pretty easy to get into the Hare Brain mode of thinking: just start concentrating on something. The Tortoise mind, however is more “aimless”. This “aimlessness” is “particularly suited to making sense of situations that are intricate, shadowy or ill defined…when we are not sure what needs to be taken into account, or even which questions to pose—or when the issue is too subtle to be captured by the familiar categories of conscious thought—we need recourse to the tortoise mind.” This is called creativity.

    The Tortoise mind has been a mode of thinking that has been a part of all cultures for some time. This is something that Olga Mecking talks about in her book Niksen.

    Niksen

    In her book, Olga Mecking describes niksen as a daily Dutch concept that involves “doing something without a purpose, like staring out of a window, hanging out, or listening to music.” Niksen is sprinkled throughout the Dutch culture. This boredom helps not only to reduce stress and anxiety, but it also helps creative problem solving. Olga shows that “boredom literally makes us more creative, better at problem solving, better at coming up with creative ideas”

    The Dutch aren’t the only culture to have boredom built in. Here are some other ways around the world people have integrated boredom into their culture:

    Sabbath – God rested on the 7th day of creation, thus we should rest 1 day a week.

    Siesta – people in Spain and France, during the hottest part of the day, would rest and take a nap.

    Dolce Far Niente – Italian for “sweet doing nothing.” It means the essence of doing nothing and enjoying it. This is at the core of the Italian culture for enjoying a stress free life.

    Wu-Wei – Chinese for “non-action”. From the teachings of Lao Tzu and is at the heart of what it means to follow Daoism. Wu-wei refers to the cultivation of a state of being in which our actions are quite effortlessly in alignment with the ebb and flow of the elemental cycles of the natural world.

    What To Do

    Here are some ways to use boredom to help solve problems:

    Walks – When you’re stuck on a problem, stop what your doing and go for a little walk. Don’t think about your problem! Just enjoy the walk. You’ll be surprised how quickly your Tortoise Mind finds a problem. Some of our greatest thinkers where walkers: Albert Einstein, Charles Dickens, Steve Jobs and Friedrich Nietzsche.

    Naps – I know you’re not a 3 year old, but naps is another way to activate your Tortoise Mind. John Cleese in his book Creativity recounts how Edison used sleep to help come up with his creative ideas:

    [Edison] found that he got his best ideas in that funny no man’s land between being awake and being asleep. So he used to sit in a comfy armchair with a few ball bearings in his hand and a metal bowl underneath. When he dropped off to sleep his hand relaxed, the ball bearings fell on to the plate and the noise they made woke him up. He’d then pick up the ball bearings again and sit back and get into that same drowsy, dreamy frame of mind that he’d just been in.

    Delay Decisions: John Cleese points to a study done by the Psychology department at the University of Sussex on creativity showed that architects that ranked high in creativity “always deferred making decisions for as long as they were allowed”. This allowed their Tortoise Mind time to come up with fresh ideas.

    Play: Those same architects in the University of Sussex study also knew how to play. How they define play is “the ability to get enjoyably absorbed in a puzzle: not just to try to solve it so that you can get on to the next problem, but to become really curious about it for its own sake.” Or “exploring, not knowing where they’re going, and not caring either.”

    Limit Interruptions: one of the greatest killers of creativity is interruption. When you are using your Tortoise mind, setup your environment to limit any interruptions: set your cell phone to airplane mode, turn off the TV, etc. John Cleese points out that “research has shown that, after an interruption, it can take eight minutes for you to return to your previous state of consciousness, and up to twenty minutes to get back into a state of deep focus.” The Tortoise mind requires time and “the longer you sit there, the more your mind slows and calms down and settles.”

    What Not To Do

    Don’t do any activities that stimulates your brain. Neurologically this means any activity that will release dopamine. This includes visiting Facebook or watching YouTube videos. A great rule of thumb is anything that will give you the sense of being productive or active.

    Overview

    A great way of creatively solving a problem is through boredom. If you are having a hard time coming up with a solution, simply stop what you’re doing and let your mind wander. Neurologically your mind is more active when you are not using it. You’ll find that a creative solution will show itself when you are no longer thinking about.

  • Office Tribes

    Office Tribes

    Stress, depression and anxiety have been a major problem in the modern world. Suicide rates continue to climb without much promise of decline. Most of us can agree that there is something wrong.

    Maybe understanding our history might help. I’m not talking about our immediate history, but evolutionary history.

    Wait!!! Don’t leave yet! I know that word is pretty taboo lately, but please hear me out. Maybe, just maybe we can achieve a better way of living by learning about tribes.

    Millions Of Years Of Tribal Living

    Humans have lived in tribes for a very long time. Around 2 million years humans descended from the trees and lived on the open lands in Africa. We would live in smaller groups, usually 150 people or smaller.

    In contrast, our modern way of living is pretty recent in the history of the universe. We only started living in larger groups 10,000 to 12,000 years ago with the birth of agriculture. This is a fraction of time compared to our tribal living.

    For those 2 million years tribal living was fundamental to our way of life, but these past 12,000 years we’ve forgotten that way of living.

    Tribe Economies

    It’s weird to think of hunter gatherer tribes as having an economy, but in his book My Ishmael Daniel Quinn compares our traditional concept of an economy to tribes.

    At the core of our current economies is production. In order to get food, one must produce. Without production, one cannot get basic necessities like food and shelter. One must be “productive.”

    Tribes have a different core concept to their economy: human energy. This human energy is through unconditional support for all people in the tribe. Making sure that all people in your tribe receives all that they need makes sure the tribes survives.

    Wealth in our economy is capital. But tribal wealth is something else entirely: security from death. To achieve this, there are 2 fundamental laws.

    Tribal Laws

    Here are the two main laws regarding tribes:

    1. Each member will give their all for the tribe
    2. The tribe will take care of all members

    Every member must help the tribe. If the tribe fails, that means DEATH. If the member is kicked out of the tribe, that means DEATH. One must contribute to the success of the tribe!

    On the flip side: it’s in the best interest of the tribe to take care of every member. In My Ismael: “The rest of the tribe won’t turn its back on you as you struggle with this problem. They know that a problem shared widely becomes almost no problem at all—and they know very well that each of them will someday need similar help with one problem or another”. Every member is needed for the tribe to survive.

    Humans evolved into these rules due to necessity. These rules are fundamental for a tribe. Give your all to the tribe and the tribe will take care of you. With this security, all tribes people live without fear. No anxiety, no stress, no depression. Just security.

    Give your all to the tribe and the tribe will take care of you.

    Here’s the modern problem: these laws are inherited within us and we apply them unknowingly. We apply these tribal laws to many parts of our modern way of living and it’s causing our stress and anxiety.

    Company Tribes No More

    We naturally are constantly seeking membership into a tribe. We are constantly looking for tribal security. Companies used to provide a tribal experience: work hard for us and we will provide for you until you die with a salary and a pension.

    Expulsion from a tribe means DEATH, and we have either been excluded from a tribe or never been in one.

    Those days, unfortunately are gone. Companies, for the most part, no longer provide pensions. The average length of employment is around 4 to 6 years. More and more employers are looking to hire contractors instead of full time employment to save money due to high health insurance costs. Companies are no longer acting like tribe leaders.

    Tribal Conscious.

    Expulsion from a tribe means DEATH, and we have either been excluded from a tribe or never been in one.

    After having something go wrong at work, have you ever over reacted? Ever thought “their gonna fire me” when logically that would never happen? It’s happened to me a few times over my career.

    When something goes wrong, employees instinctually fear being excluded from their tribe. Expulsion means DEATH and we all fear DEATH. However, if tribal members feel taken care of, they will give their best effort. Tribal members have to give their best or the tribe will fail, which means DEATH. This, I believe, is core to our psychology of motivation.

    3rd Level Of Motivation

    Daniel Pinks great book “Drive: The Surprising Truth About What Motivates Us” talks about different types of motivation.

    1. Motivation of necessity (hunger, shelter)
    2. Sticks and Carrots (Rewards and punishment)
    3. Autonomy, Mastery, and Purpose

    The last level of motivation is key for motivating creative types such as software engineers. However, this last level of motivation doesn’t work unless the employee is using it to further secure the tribe (purpose). When they are given autonomy and a chance to master their craft, they are given an opportunity/purpose to secure the future of the tribe. This is instinctual. Autonomy and mastery within a void will only cause stress and anxiety since it will soon be clear that their purpose will NOT help the tribe. Freedom without purpose is not freedom, but can become a detriment to happiness, because you are no longer helping the tribe, yourself or anyone for that matter.

    The Future

    People in tribes lived in security without fear and anxiety. No, we don’t need to go back to living as hunter gatherers, but we can start living in tribes again. Let’s use this knowledge to change how our companies, families, and churches behave. Warning: we must be careful with the power of tribal thinking.

    Living as tribes can be bad if we’re not careful. In My Ishmael, Daniel Quinn points out that “there is no operational difference between a tribe and a cult.” People die for cults…that’s the power of tribal thinking. A nefarious tribal leader can lead the tribe to ruin; people can mistake the tribe for the leader. Just look at our current political environment.

    But if we can harness these laws, people can be motivated well beyond their potential. As Ishmael says in My Ishmael: “People have died for [tribal support]. People will die for that—not because they’re crazy but because this is something that actually means something to them.”

    Overview

    Humans have lived in tribes for million of years to survive. Because of this there are 2 tribals laws that have been ingrained in us: the tribe will take care of its members, and the members will give their all for the tribe. Our modern workplace used to accommodate these laws, but in recent years businesses have been moving further and further away from them, thus explaining the degradation of motivation and the increase in stress and anxiety in our culture.

  • Generalizing Specialists and Transactive Memory

    Generalizing Specialists and Transactive Memory

    In the last decade I’ve been fortunate, or unfortunate depending on your view, in going through multiple company transitions from Waterfall to Agile practices for organizing software development work.  Most…no, all the transitions didn’t go very well.

    What they all had in common was that they hired a “certified” scrum master to lay down the rules for the new Agile practice. (yes, that is ironic)

    All the scrum masters that I worked with preached an idea that I always took issue with: all developers are to be treated as generalists.  Any developer in the team should be able to pick up the top user story in the backlog and do it.

    This never worked for any of the companies I was at. Developers are good at different things. Some developers are really good in front-end code, others are CSS gurus, and some were strictly database developers which only knew SQL.  Software is so complex and diverse, that there is no way that developers are going to be awesome at all the different domains needed to create great software.  Imagine telling the SQL guy that he has to do CSS development.  Ha!

    Transactive Memory

    It is inefficient to have every module within a system store and retrieve the same information.  Evolution figured this out a long time ago.  One way it figured this out, is through the concept of Transactive Memory.

    It is inefficient to have every module within a system store and retrieve the same information.

    Transactive Memory (Wiki) is a memory system of collection, storing and retrieving knowledge throughout a group.  This is a form of specialized division of labor.  Instead of retaining a piece of complex information, like say, how to create indexes within a stored procedure in a SQL database, I know that Bob over in the corner desk is really good at it.  When I need to get that information, I talk to Bob.

    Separating domains of knowledge within different parts of the memory system allows the system to build a more complex and potentially effective knowledge base.

    This is one reason why the generalists approach to development never worked within the dogmatic Agile approaches sited above.  Not everybody can be great at everything and transactive memory develops naturally within a group of individuals, such as a development team.

    Generalizing Specialists

    The latest buzz word in the tech industry is Generalizing Specialist. The term generalizing specialists has come to mean an individual who has a particular area of deep expertise, but also has experience in a large number of other areas that may not be directly related to their core area. (AgileAdvice) Gaining more generalized knowledge outside your particular career path, is very advantageous.

    In his book Range: Why Generalists Triumph in a Specialized World, David Epstein argues that generalized knowledge is a requirement for solving complex problems or creating complex solutions. “The more contexts in which something is learned, the more the learner creates abstract models, and the less they rely on any particular example,” writes Epstein.

    Epstein sites many examples of Generalizing Specialists outperforming Specialists.  One was that of a team of E. coli specialists vs a team of  “scientists with chemistry, physics, biology, and genetics backgrounds, plus medical students”.  Both teams were tasked at creating general solutions for E.coli research.  At one point both teams encountered the same experimental problem with regards to protein measurements getting stuck in filters. The generalists team was able to solve the problem the same day, due to one of the team members drawing on knowledge from their medical degree.  The specialists took weeks to solve the same problem, even though this was their area of expertise.

    Overview

    Expecting a software developer to be a generalist, that is good at developing in all software domains isn’t realistic.  Through the concepts of Transactive Memory, teams naturally segregate knowledge to individuals within the group.

    High powered software teams consists of “generalizing specialists” that have a high knowledge of a particular domain, but a breadth of broad generalized knowledge.

  • When To Stop Looking at Code Coverage – Goodhart’s Law

    When To Stop Looking at Code Coverage – Goodhart’s Law

    All companies want to know if their investment will bring them value.  In order to understand how much value they are getting, the company will implement some sort of measurement.  This is common sense: I invest, show me what I’m getting with my investment.  However, a measurement can have an adverse side affect in the creative process, particularly if it is a requirement.

    Code Coverage

    A number of years ago, Test Driven Development (TDD) spread throughout the software industry as a way to increase software quality.  Tests were written first, then the software was written to satisfy the tests.  To see how much of the software was covered by the tests, the test runners would give a number that would represent the percentage of how much of the code was covered by tests.

    Research showed that this percentage correlated with high quality code in the industry. Because of that correlation, many businesses believe that they have to have a high percentage of code coverage, in order to get high quality code.  High code coverage was then set as a requirement for many software shops.

    Goodhart’s Law

    Economist Charles Goodhart, while criticizing the United Kingdom government of Margaret Thatcher in a 1975 article for trying to conduct its monetary policy on the basis of targets, created a simple law:

    When a measure becomes a target, it ceases to be a good measure.

    Goodhart saw that when a feature of the economy is picked as an indicator of the performance, then it inexorably ceases to function as that indicator because people start to game it. (https://coffeeandjunk.com/goodharts-campbells-law/)

    Examples of Goodhart’s Law

    This simple law is applicable to many industries.  Here are some examples of setting measurements as targets:

    Search Engine Optimization – Once web masters found out that the quantity of keywords on their website would increase their search engine rankings, they would duplicate keywords countless times and have the text color be the same as the background color so that the users wouldn’t be confused about all the random text.

    No Child Left Behind – Once schools understood that in order to get proper funding their students had to do well on standardized tests, the schools started teaching to the tests instead of continuing to learn content.

    Dieselgate – In September 2015, the EPA found that Volkswagen had intentionally programmed turbocharged direct injection (TDI) diesel engines to activate their emissions controls only during laboratory emissions testing which caused the vehicles’ NOx output to meet US standards during regulatory testing, but emit up to 40 times more NOx in real-world driving. (Wikipedia)

    When Code Coverage Is A Bad Indicator

    Once the goal of a developer is set to hit a high code coverage number, the developer will get pretty inventive.

    One shop I was at, that had code coverage as a requirement, I was spotting this all over in the codebase:

    [System.Diagnostics.DebuggerHidden]

    I tried to step debug into some code, but couldn’t.  The previous developers started to hide code from the debugger, in order to increase the code coverage percentage, since the test runner used the debugging framework to assess if the code was hit during testing.

    This was obviously against the spirit of code coverage, but they were also under really tight deadlines. Having the measurement as a requirement made them do bad things to the system.

    Overview

    Once a measurement becomes a requirement for your dev team, it ceases to be a good measurement. Developers will start coding to the measurement instead of what’s really important: business value.

  • Software Principles and Misintegrated Thinking

    Software Principles and Misintegrated Thinking

    All these software principles and practices can be hard to keep up with when developing applications. They can be even harder to implement. One thing that makes it difficult is figuring out when not to follow them. Like a good database architect would say: it takes experience knowing when to denormalize data.

    One problem that I admit having is prioritizing software practices and principles over what should be the true purpose of writing code: to make a great product.  Why did I, and other developers, sometimes fall into this trap?

    DIM Thinking

    In the book The DIM Hypothesis: Why the Lights of the West Are Going Out, Leonard Peikoff outlines 3 different fundamental modes of integrating new ideas/data into a whole: Disintegration, Integration, and Misintegration.  They are defined as such:

    • Integration: data is integrated through rational means.
    • Misintegration: data is integrated through a prism of ideas.
    • Disintegration: data is integrated through no means. (nihilism)

    The one mode that affects us is Misintegration. Misintegration has its roots from the philosopher Plato concept of Idealism.  This states that “Eternal truths exist in the realm of Ideas rather than in what we would call the natural, physical world.”  This type of thinking places a priority in ideas over reality.

    There are some big problems with prioritizing ideas over reality. Leonard Peikoff shows in his book that the Misintegration mode is linked to the outcome of the Medieval period, the rise of the Nazi party and Stalinism.

    Placing Principles ahead of Product

    Software principles are ideas.  They are ideas that help us make better maintainable software.  But, they are not the reason we make software.  If by following software principles we make more complicated software to maintain in certain situations (yes, this does happen), then we probably shouldn’t follow it.

    Following software principles blindly without rationally assessing context and/or situation is a great example of Misintegration mode of thinking.

    67191c8a506e176e26685aeb624135a4460fe775a50719dfdb01d75d4d2b4592

    Unfollowing Principles Example

    Our main frontend application is an AngularJs application. We needed to create a badge input where one can type a string and the control would see if the string is in a valid list of badges.

    When creating the control, I pushed that the control should be as reusable as possible: a badge-input control.  The control should know nothing about what its data is and where it got it.

    The developers did a great job creating the control!  It was a very well made control that was easy to use.  However, AngularJs doesn’t make it easy to practice inheritance and polymorphism with components/directives.

    Later our product owner wanted the new component to allow the user to add a badge to the database.

    giphy.gif

    Our beautiful reusable control wasn’t created to do that.  Well, do we try to keep it generic and have some very confusing configuration options for doing this?

    After a short talk we all decided to make the control specific to the database entity.  So now its a badge-label-input instead of a badge-input.  If AngularJs provided a better way to practice inheritance and polymorphism, then we would have kept it reusable and extended it.  However, since the framework limits us, we decided not to follow the very good Object-Oriented Principles that I preach, even in my blog.  The irony is is that the application is still very easy to maintain and pretty easy to enhance, even when we purposely didn’t follow OOPs.

    Overview

    Creating great applications that are maintainable and extensible should be a higher priority than implementing software principles and practices.  Knowing when to not follow them is a sign of great experience.

  • To The Cloud!  Optionality For Quick Fixes

    To The Cloud! Optionality For Quick Fixes

    Full disclosure: I love working in the Cloud!  I’ve been at a few companies that have their infrastructure in the cloud, including my current position.  The cloud makes it incredibly easy to create servers and environments, and that really helps when one is in a pinch.

    Speaking of a pinch: recently I got myself into a sorta big pinch: we converted our WebAPI environment to docker containers, but we forgot to have it run our Node server with “Node” permissions instead of “root”.  Well, images that were uploaded into our environment had “root” permissions, which needless to say our asynchronous job for optimizing the images for the web failed.  Bigger problem: they failed gracefully without alerting us. 😦

    Three weeks of customer images, over 14,000 of them, where not web optimized!  Holy CRAP!!!

    cmGndrC

    Optionality

    Optionality, the potential for many options, is important when dealing with complex systems.  This is something I practice at every level of our development systems, including at the server level.  For IT, the Cloud provides many wondrous options, including options for me to quickly optimize these images without slowing down production servers.

    With a click of a button, I was able to duplicate our asynchronous job environment and its queue (SQS).  After that was created, I spammed it with the 14,000 job requests for web optimizing the images.  Within 15 minutes, I had a new job environment crunching on the production images!

    Screen Shot 2018-06-18 at 2.13.13 PM
    Look at the new environment go!

    Production is still humming along without any knowledge that there are 4 other servers crunching away.

    Agent-Smith-Evil-Laugh

    Paying for More Servers, NOOOO!!!!

    It took a little while, but after a few hours my new environment web optimized all 14,000 images.  Well, I really don’t wanna pay for those 4 servers, so I deleted the new environment. I only had to pay for a few hours of time for those servers, so the cost was pretty minimal.

    Overview

    So, if you are thinking about switching to the cloud, include in your discussion the added optionality your team/company will have, including the ability to quickly spin up servers/environments when needed.

  • Javascript, Inheritance And Polymorphism

    Javascript, Inheritance And Polymorphism

    With my object oriented background coding in C#, I’ve been looking for a good way to do inheritance and polymorphism in Javascript that is similar to object oriented languages.   Because of my object oriented background, I’m not really fond of the prototype syntax.  My big problem was trying to find a strategy that would allow my extended class and allow me to call the “super” or “parent” methods, even in override methods.  Below is a strategy that will do just that.

    Inheritance

    There are a few different ways of practicing inheritance is Javascript.  The one I prefer is similar to the Parasitic Inheritance model:

    function ClassA(){
      this.doSomething = function(){
        console.log("something done");
      }
    }
    
    function ClassB(){
      ClassA.call(this);
    }
    
    var classB = new ClassB();
    classB.doSomething(); //something done
    

    Polymorphism

    To polymorph in Javascript class is a little more complicated.  I really needed a model that would allow me to call the parent (or super) methods if needed, just like a C# or Java.

    Here’s how I did it using JQuery:

    function Rectangle(){
      var width = 0;
      var height = 0;
    
      this.setWidth = function(newValue){
        width = newValue;
      } 
    
      this.setHeight = function(newValue){
        height = newValue;
      }
    
      this.getSize = function(){
        return { width: width, height: height };
      }
    } 
    
    function Square(){
      Rectangle.call(this);
      var parent = $.extend({}, this);
    
      this.setWidth = function(newValue){
        parent.setWidth(newValue);
        parent.setHeight(newValue);
      } 
    
      this.setHeight = function(newValue){
        parent.setWidth(newValue);
        parent.setHeight(newValue);
      }
    } 
    
    var square = new Square();
    square.setWidth(10);
    console.log(square.getSize()); // { width: 10, height: 10 }
    
    

    This method allows us to polymorph a class and give us the ability to call “super” methods if needed.

    If you don’t want to use JQuery, here’s an example of keeping references to the parent methods:

    function ClassB(){
      ClassA.call(this);
    
      //create parent and set all method references
      var parent = {};
      var keys = Object.keys(this);
      for (var key in keys) {
        parent[keys[key]] = this[keys[key]];
      }
    }
    

    Its a bit more code, but it does the same thing.  It will allow you to call the parent methods and polymorph your extended class.

    Enjoy!

  • SOLID/OOPS vs YAGNI

    SOLID/OOPS vs YAGNI

    Usually when I talk to other developers about my Proactive Lazy Developer concept, a debate starts: putting extra time and effort to build a highly abstract system so that the developer can be lazy later is a violation of YAGNI!

    Here I will try to argue that YAGNI fits well with the art of being Proactively Lazy and argue that the SOLID ,Object Oriented and YAGNI principles are to be used together, but with different priorities.

    What Is SOLID, OOP AND YAGNI!?!?

    This post is assuming that you have some familiarity with SOLID Principles and YAGNI.  If so, you can skip this section.  However, I’ll do a quick overview:

    SOLID Principles (Wiki)

    SOLID is an acronym that stands for the five basic principle of object-oriented programming introduced by Michael Feathers:

    The intention is that if a developer follows these principles, then they will be able to create a highly maintainable and extensible software system.

    OOP (Object-Oriented Programming) (Wiki)

    OOP is a programming language model organized around objects rather than “actions” and data rather than logic.

    YAGNI (Wiki)

    YAGNI is an acronym that stands for “You aren’t gonna need it.”  It’s a principle that states that developers should not add anything to a system that is not deemed necessary.  This principle helps prevent the developer from putting in too

    The Conflict

    XP co-founder Ron Jeffries has been quoted about YAGNI: “Always implement things when you actually need them, never when you just foresee that you need them.”  So, if a developer is not supposed to implement things only when needed, how does a developer apply the SOLID/OOPS Principles without being in conflict with YAGNI?

    How can I be a proactive lazy developer and still follow both sets of principles?

    Proactive Lazy Solution

    What I propose is this:

    SOLID/OOPS principles should always have a higher priority than YAGNI

    SOLID and OOPS are principles to help build maintainable and extensible systems.

    YAGNI is a principle to help build maintainable systems, but doesn’t help with extensibility.

    Remember, we want to make life as easy as possible later on so we can be lazy.  If our system isn’t extensible, then we can’t be lazy in the future.

    WebAPI Example

    Let’s say that we need a WebAPI to create and get an article in a MongoDB database.  We also need it to log the behavior for audit purposes.

    YAGNI Example

    Below is an example that applies YAGNI only to a NodeJs WebAPI:

    var express = require('express');
    var app = express();
    var mongoose = require('mongoose');
    var loggly = require('loggly').createClient({settings: process.env.logglySettings});
    
    app.get('/api/articles/:id', function(req, res) {
     loggly.log("Retrieving An Article");
     var articleId = req.params.id;
     mongoose.connect('mongodb://localhost/test');
     var ArticleModel = mongoose.model('Article', { name: String });
     ArticleModel.findOne({ _id: articleId })
       .exec(function(err, article) {
         res.json(article);
       });
    });
    
    app.post('/api/articles', function(req, res) {
     loggly.log("Creating An Article");
     var articleId = req.params.id;
     mongoose.connect('mongodb://localhost/test');
     var ArticleModel = mongoose.model('Article', { name: String });
     var article = new ArticleModel(res.body);
     article.save(function(err, updatedArticle) {
       res.json(updatedArticle);
     });
    });
    
    

    YAGNI as applied to it’s structure:

    • Everything is in one file.
    • Monolithic methods: one method for each function needed.

    YAGNI as applied to it’s function:

    • It gets an article
    • It creates an article
    • It logs the two functions desired.

    This WebAPI was very quick to create.  It does only what was needed (create and get an article) and nothing else.  Copy and paste it into a NodeJs/ExpressJs project and it’ll just work.  Straight to live I say!!!

    However, this example violates most SOLID principles:

    • The code has too many responsibilities: providing an interface and updating a database.
    • It is dealing with strict implementations of logging vs an abstract.

    SOLID Before YAGNI (The Proactive Lazy Way)

    Now let us set a higher priority on the SOLID principles.

    <strong>//Logger.js</strong>
    var loggly = require('loggly').createClient({ settings: process.env.logglySettings });
    
    class Logger {
      log(message) {
        loggly.log("Retrieving An Article");
      }
    }
    
    <strong>//ArticleRepo.js</strong>
    var mongoose = require('mongoose');
    var logger = new(require('./Logger'))();
    
    class ArticleRepo {
      get(articleId) {
        logger.log("Retrieving Article From MongoDB");
        return new Promise(function(resolve, reject) {
          var ArticleModel = mongoose.model('Article', { name: String });
          return ArticleModel.findOne({ _id: articleId })
            .exec(function(err, article) {
               return resolve(article);
            });
        });
      }
    
      insert(article) {
        logger.log("Inserting Article From MongoDB");
        return new Promise(function(resolve, reject) {
          var ArticleModel = mongoose.model('Article', { name: String });
          var insert = new ArticleModel(article);
          insert.save(function(err, newArticle) {
            return resolve(newArticle);
          });
        });
      }
    }
    
    <strong>//app.js</strong>
    var express = require('express');
    var app = express();
    var repo = new(require('./ArticleRepo'))();
    var logger = new(require('./Logger'))();
    
    app.get('/api/articles/:id', function(req, res) {
      logger.log("Retrieve Article Requested");
      repo.get(req.params.id)
        .then(function(article) {
          res.json(article);
        });
      });
    
    app.post('/api/articles', function(req, res) {
      var articleId = req.params.id;
      repo.insert(res.body).then(function(addedArticle) {
        res.json(addedArticle);
      });
    });
    

    SOLID application:

    • Single responsibility applied for the interface, logging, and persisting data to database.
    • Dependency Injection principle used by classes using abstract logging, and repo classes.

    YAGNI as applied to it’s function:

    • It gets an article
    • It creates an article
    • It logs the two functions desired.

    Yes, there are YAGNI violations.  But, they are there because of the priority of satisfying the SOLID and Object oriented principles.

    How Does This Make Us Proactively Lazy?

    Now we have some code that is better suited for proactive lazy development.  Now you may ask: how does this code help with being proactively lazy?

    Reusable Code

    There are 2 pieces of code that was created: Logger and ArticleRepo.  These two classes have a distinct responsibilities: logging a message and persisting article data.  Now that we have created them for this WebAPI, we can now used them any where else in the code that will need either logging and/or article data persistence.  The best part, we won’t have to keep retesting that code since we already made it work for the articles WebAPI.  That will make use very lazy later on!

    Extensible Code

    Since we have abstracted out the Logger and ArticleRepo, we can now extend them to do more if needed.  Let’s say we need to fully qualify a logo that is stored in the article.  We can easily extend the ArticleRepo to add the logic to fully qualify the logo path.  Other parts of the system that is using the ArticleRepo will still work as expected and we can use the extended version to fully qualify the logo url were needed.  Now we can be lazy with regards to extending features in our system.

    Testable Code

    To make our code better maintainable, the abstraction of the Logger and ArticleRepo now makes our code better testable.  Having automated tests helps us lazy developers push out more code faster since we can rely on automated tests to tell us if we messed something up.

    We can unit test the WebAPI interface to make sure it will always call the correct repo methods.  We could also write integration tests with the ArticleRepo to make sure it will always persist and query data as expected.  Once we get these tests in place, we can be very lazy in the future since we know this code will always work as expected.

    Overview

    Two important principles, YAGNI and SOLID/OOP, are needed to create great maintainable and extensible systems.  However, when you get into a situation where  SOLID/OOP and YAGNI are in conflict, SOLID/OOP should aways take priority.

  • Proactive Lazy Developers

    Proactive Lazy Developers

    The best software developers are lazy developers.  Let me clarify.

    There are different types of developers out there.  In my experience though, there are two basic types: “Hard Worker” and “Proactively Lazy” developers.

    Hard Worker Developer

    One type of developer is the “hard worker” developer.  They are the type that spends 60 plus hours coding each week.  Maybe they’ll code through the weekend to get their project done.  They will be constantly heads down at their desk, hardly ever taking a break. 

    Proactively Lazy Developer

    The other type of developers are what I call the “proactively lazy” developers.  They might put in their 40 hours. They might work the weekends.  But, if they have to go above and beyond, they will be incredibly upset.

    By these definitions, one would think that the “Hard Worker” developer type would be the better of the two. 

    You would be wrong. 

    The Problem With Hard Worker Developers

    Most people would agree that common sense dictates that if a developer puts in long hours, he is therefore a good developer.  Well, as a developer I would have to ask: “Why is the developer putting in those long hours?” 

    There could be many answers to this question, but it usually boils down to these:

    1. The business/management is giving them too much work.

    2. The developer doesn’t know what they are doing.

    This article isn’t about handling the issues with number 1 other than suggesting to hire a great Scrum Master.

    Let me talk about number 2.

    Software Developer Is More Art Than Science.

    It used to be that software development was a very “left brain” activity.  It included a lot of math, and resembled putting together a puzzle. It was very logical and task oriented.  Code was very linear and procedural.  A developer could simply read the code as a paper, from top to bottom.

    Coding today is very different.  There’s very little math and developers are faced with highly complex abstractions.

    Abstraction In Coding

    Since coding is so abstract, this requires the developer to use both right and left hemispheres of their brain.  They need to be able to understand the entire system at a high level before they can write a single unit of code.

    Here is a list of patterns and principles I need to be aware of while coding a simple web app:

    • Object Oriented Principles
    • SOLID Principles
    • Repository Pattern
    • Model View Controller Pattern
    • Model View View Model Pattern
    • Client Server Pattern

    These are just patterns and principles on how to code.  On top of that, there are the frameworks.  Once a developer fits in the frameworks needed, then there’s are the third party system integrations.  And on top of that, providing a great user experience with the GUI.  Not to mention the endless list of different technologies that are used to make a single web app: HTML, CSS, JavaScript, servers (ASP.NET, Java, PHP, NodeJS, etc…), databases (SQL Server, MongoDB, MySQL, etc…).

    Putting all this together to create a product/system that is usable, efficient and highly maintainable will take more than just a left brain mentality with the developer.  It’s a wholistic endeavor that requires both logical and creative thinking to be able to compare and contrast form (how code/systems fit together) and function (what each unit of code does) to create a work of art.

    Here is where I point out why musicians/artists make better software developers than scientists.

    Hard Worker Developer And Abstraction

    The “Hard Worker” developer is usually the one that has a difficult time with abstractions.  They code in a linear/procedural way, thus writing code that is not extensible.  When they have to add more features, they have to add the features in a way that will compromise the older fully functioning features, making both brittle.  After a year or two of adding features, one will find themselves in a position where there are more bugs that feature requests.  And when a bug is fixed, more bugs appear.  With all these issues, it’s not hard to see why these types of developers have to put in the long hours.  This is the result of a lack of wholistic thinking in the development of the application. 

    Proactive Lazy Developer

    The “proactive lazy” developer is a developer who will put in the extra time up front (proactive) to build a highly abstract and efficient system so that they can be lazy in the future.  They thrive on seeing they’re productivity soar as they add features to their system.  They love seeing their bug list empty, or that they can fix bugs in minutes, not in days. 

    Laziness As A Virtue

    When I say lazy, I don’t mean that they don’t do anything.  A “proactive lazy” developer isn’t totally lazy.  They love to code and probably loose themselves while they do.  What I mean is that they don’t like to have to continually put in the hours to achieve a goal.

    One reason is doing this type of coding is exhausting.  A “proactive lazy” developer is going to do anything they can to reduce their overall energy expenditure over time.  They will even write and provide documentation to those with questions so that they won’t have to be bothered.

    The laziness will also be reflected in their work.  Software should make life easier, and a lazy developer is all about making life easier.  You will see that a “proactive lazy” developer will focus on making the system as easy as possible to use.  They might even put in some easter eggs (hidden features) just to allow them to more easily use or test the system.

    Final Thoughts

    So when you’re hiring a developer, ask them if they are lazy or hard worker.  If they say lazy, HIRE THEM!