Leveraging Instincts in Software Engineering

Leveraging Instincts in Software Engineering

Before we venture into the thrilling world of instincts, let’s have a proper chinwag about how this crazy brain of mine functions. To be honest, half the time, I’m not sure I fully grasp it myself. I’ve binged my fair share of YouTube videos – the ones that harp on about inner monologues, visual thinkers, and all that jazz. Sometimes, I feel like juggling between a mental picture book and a chatty internal radio show. Quite the circus, right?

But here’s the kicker: while I’m navigating this mental maze, my goal is to journey from conscious incompetence (the good ol’ “I know that I don’t know” phase) to unconscious competence (the “Look, Ma, no hands!” moment). I've heard whispers of a legendary state called "conscious excellence", but let's park that one for another wild ride.

Now, with that prelude out of the way, let's explore how I let my belly (and occasionally other parts of my anatomy) lead the way in everything from Rocket League face-offs to jamming on a six-string. Strap in; it's going to be a bumpy yet hopefully enlightening ride.

Video Games and Predictive Instincts 🎮

Ever find that some games become less of a mental exercise and more of an instinctual dance? When I’m in the thick of it with Rocket League, it's as if my brain’s taken a wee sabbatical and left my instincts in charge. It’s not some sporadic magic. No, it’s the culmination of hours... okay, maybe days worth of gaming, where every miss, every goal, and every aerial flip has been etched into my fingers. The controls? They're less about "press X to do Y" and more about feeling the flow of the game.

This isn’t limited to Rocket League, either. Whether I’m in the heat of a Call of Duty match or dodging a flurry of attacks in Brawlhalla, it's like I've delegated the hard thinking to my hands. Thanks to countless hours in front of the screen, they've been trained to anticipate and react without needing explicit instructions from upstairs.

Now, there's a concept from "The Blind Watchmaker" that resonates with this. Our bodies have these remarkable built-in systems, instinctual safety nets that go beyond our conscious control. Ever had a speck of dust hurtling towards your eye? Before you even register it, your body's already on the case, blinking it away. Only in the aftermath, if you're really observant, do you appreciate what's just happened. Similarly, my hours in gaming have fostered a kind of reactive intelligence in me. It's less about actively strategizing and more about letting those well-practised instincts take the wheel.

Feeling the Music 🎸

Much like gaming, my guitar escapades aren't dictated by a strict note-by-note playbook. The early days? Sure, it was a bit like a duck out of water, clumsy and amusing. But now, when I wield my 7-string guitar (thanks, Dream Theater obsession) or that 6-string bass of mine, it's all about vibe and emotion.

I'm a massive fan of progressive music, with its intricate rhythms and ever-shifting time signatures. Dream Theater, for instance, constantly throws musical curveballs. It's exhilarating and sometimes maddening, but it’s taught me to be in sync with the flow rather than painstakingly processing each chord.

When I'm in the zone, playing these tracks, it's pure hyper-focus mode. My eldest often asks me, "How do you hold your focus so well?" 🤔. To which I usually respond with a cheeky grin. Guitar playing, for me, is that oasis after a taxing day. It's not always a smooth ride, mind you. There are times when my fingers decide to have a mind of their own, not aligning with my mental groove, and oh, the frustration! 😅

But then, in those moments when everything syncs up - the rhythm, the notes, the emotion - it's pure bliss. It’s my way of switching off from the world and immersing in a realm of melodies and harmonies.

Wandering and Trusting the Gut 🧭

Adventures into the unknown can be quite thrilling, right? But how often do you truly let go and rely on your instincts in unfamiliar terrains? Let me share a little anecdote that captures this spirit.

My Project Manager, Beth, and I were in Liverpool for a client meeting some time ago. Fresh out of the train station, we found ourselves amidst the towering concrete giants, trying to navigate our way to the client's office. Now, I had this vague sense of the direction we should be heading in. The challenge with cityscapes? Those tall buildings sometimes play tricks on you. Like trying to head towards the water, your reference points can suddenly vanish behind a skyline of bricks and mortar.

On multiple occasions, I found myself pointing and saying, "I feel like it’s that way." Beth, bless her, with a mixture of amusement and scepticism often in her eyes, would double-check on her maps app. And honestly, I don’t blame her. There's a fine line between trusting your gut and ensuring you're not late for an important meeting! 😄

This instinct to explore is something that has always been a part of me. Contrasting this with my wife's approach to new places is interesting. She prefers the comfort of familiarity. Venturing into the unknown isn't her cup of tea ☕. I respect that, and often, our trips are wonderfully organized thanks to her penchant for planning. But when I'm solo, that's when my curiosity truly unfurls its wings.

While Beth and I made it to the meeting on time in Liverpool (thanks partly to modern technology and my “feels”), this journey underscored an interesting perspective. Sometimes, you need to venture off the well-trodden path, guided by your instincts, even if it means occasionally getting lost or having to reassure sceptical companions. Because the truth is, sometimes it’s in the wandering, in the detours, that we find the most memorable moments.

Trusting Your Gut in Decision-Making 🤔

I've often wondered: How much of our decisions are logical, and how much is driven by that niggling feeling in our gut? And when I dive into historical anecdotes, the power of intuition in decision-making truly stands out.

Let's first take a little detour to 1983. Stanislav Petrov, a lieutenant colonel in the Soviet Air Defence Forces, faced a terrifying situation. The early warning systems indicated that the US had launched missiles towards the Soviet Union. While machinery and protocol demanded an immediate retaliatory strike, Petrov, trusting his intuition, dismissed these as false alarms. He prevented what could have been a catastrophic global thermonuclear war!

From averting global crises to navigating the intricate art world, instincts have their say. In Malcolm Gladwell's "Blink", the story of the Getty Museum's Kouros statue comes to mind. This statue, believed to be an ancient Greek masterpiece, passed several scientific examinations and was purchased by the museum for a significant sum. Yet, when art historians and experts laid their eyes on it, something felt off. Without knowing precisely why, they believed it was a fake. And, as further examinations unfolded, their intuitive suspicions were confirmed.

So, the gut feeling plays its role in the high-stakes environment of international defence or the refined corridors of art museums. In my professional journey, I've come across new technologies and tools; more often than not, my initial reactions are instinctual.

But, as with the situations mentioned above, there's a dance between intuition and analysis. Both have their moments of glory and pitfalls. And mastering this dance, understanding when to trust the gut and when to step back for a deeper look, is where the magic happens.

Applying Instincts to Emerging Technology 📱

Taking our discussion on intuition a step further, how do these gut feelings manifest in the dynamic sphere of technology? It's one thing to trust our instincts when perusing art or avoiding global conflict, but it's a whole different ballgame when we're evaluating the newest coding platform or the latest software breakthrough.

As a senior software engineer, a piece of new tech, a groundbreaking framework, or a revolutionary tool pops up every so often. But here's the cheeky thing: Often, before I even get a chance to delve deep into the specs, my gut gives its own quick review. A mental thumbs-up or thumbs-down is akin to swiping left or right in the tech world. 👍👎

Now, why is this? Over the years, we have constructed a sort of 'mental model' based on past experiences, both triumphs and failures. So, when a new technology aligns with something in this vast repository of memories, our subconscious forms an opinion before our conscious mind can even chime in.

However, while efficient, this 'tech intuition' isn't infallible. Sometimes, it might not capture the full essence of a new tool. That's why ensuring we're not jumping the gun is essential, whether in dismissing something prematurely or giving it undue praise.

And then there are those times when technology is so avant-garde that the subconscious hits a wall. It's like being handed a tool from a sci-fi movie and being told it's the future. 🛸

In such instances, a hands-on approach is best. Play around, experiment, and soon enough, the instincts will catch up, offering insights on whether it's a technological gem or just another shiny object.

Speaking of which, in the intricate realm of software engineering, sometimes our instincts chime in when staring at mere lines of code. It's fascinating how even the tiniest coding quirks can set off our internal alarms. Let's dive into a few examples to demonstrate how our gut can react to the nuances of programming.

Gut Instinct in Action 🧠💡

We often talk about the instincts we develop in various aspects of life - from Rocket League matches to playing complex riffs on a 7-string guitar. But how does this all translate to software engineering, you ask? Let's illustrate using a Gilded Rose Kata example, starting with some test expectations:

it('should decrease the sellIn and quality for normal items', () => {
    const gildedRose = new GildedRose([new Item('normal', 10, 5)]);
    const items = gildedRose.updateQuality();
    expect(items[0].sellIn).toBe(9);
    expect(items[0].quality).toBe(4);
});

it('should increase quality for Aged Brie', () => {
    // ... test logic ...
});

// ... more tests ...

With these expectations laid out, let's journey through some code snippets:

The Drifting Logic Issue

if (this.items[i].name === "normal") {
    this.items[i].quality -= 1;
    this.items[i].sellIn -= 1;
}
if (this.items[i].name === "normal") {
    this.items[i].quality = this.items[i].quality - 1;
}

Instinct: Wait, didn't we just decrease quality above?

Over-Complication Overload

function updateQualityForNormal() {
    this.items[i].quality = (this.items[i].quality - 1) + (this.items[i].sellIn - this.items[i].sellIn);
}

Instinct: Isn't there a more straightforward way to do this?

Muddled Responsibilities Mayhem

if (this.items[i].name === "Aged Brie") {
    this.items[i].sellIn -= 1;
    this.items[i].quality += 1;
    sendUpdateNotification(this.items[i]); // Not related to updating quality
}

Instinct: That notification function seems out of place. Shouldn't updating quality and notifying be separate?

Contradicting Intents Conundrum

if (this.items[i].name === "normal" && this.items[i].quality > 0) {
    this.items[i].quality -= 1;
} else {
    this.items[i].quality += 1;
}

Instinct: Hold on! Why would the quality increase for a normal item?

Missing Context Mystery

if (this.items[i].sellIn < 0) {
    this.items[i].quality = this.items[i].quality - 1;
}

Instinct: Quality decreases faster when sellIn is less than zero, doesn't it? This seems incomplete.

The Sly Conditional Snake

function updateLegendaryItem(item: Item) {
    if (item.name === "Sulfuras, Hand of Ragnaros") {
        // Legendary items' quality doesn't decrease, but for some reason...
        if (item.sellIn < 5)
            item.quality -= 3;
        else
            item.quality = 80; // fixed legendary quality
    }
}

Instinct: Sulfuras' quality shouldn't decrease, but there's a sneaky conditional without curly braces that might be doing just that.

The Redundant Route Riddle

function updateConjuredItem(item: Item) {
    if (item.name === "Conjured") {
        item.quality -= 2;

        if (item.sellIn <= 0 && item.quality > 0) {
            item.quality -= 2;
        }
    } else if (item.sellIn <= 0 && item.name !== "Conjured" && item.quality <= 0) {
        // This block will never be executed because non-Conjured items with quality <= 0 have no specific logic.
    }
}

Instinct: There seems to be a block that may never run. It's lost in the midst of other logical branches and could be overlooked.

The Concealed Conflict Conundrum

function updateBackstagePasses(item: Item) {
    if (item.name === "Backstage passes to a TAFKAL80ETC concert") {
        if (item.sellIn < 10) {
            item.quality += 2;
        }
        if (item.sellIn < 5) {
            item.quality += 3;
        }
        if (item.sellIn <= 0) {
            item.quality = 0;
        }
        item.sellIn--;

        // A well-intentioned but conflicting rule...
        if (item.sellIn === 9 || item.sellIn === 4) {
            item.quality = item.quality / 2;
        }
    }
}

Instinct: Wait, there's a tricky rule that's halving the quality when sellIn is 9 or 4. This might conflict with the previous logic and needs a second look.

All these examples feel a bit off, don't they? Just like when you're navigating unfamiliar streets or discerning a fake artefact in a split second, a developer's gut instinct nudges them when something's amiss in code.

Small and crafty bugs often camouflage in the dense forest of code, waiting for unwitting prey. These can sometimes be the hardest to spot, especially when buried deep within larger, primarily correct code. But trust your instincts and knowledge; you might catch these elusive critters.

As with our musical experiences, where instinctive play results from hours of practice, so does our code review proficiency. We gradually move from conscious incompetence to unconscious competence as we train our brains with various code patterns.

The next time you're reviewing a pull request, and something feels off, remember: it might just be your developer's instinct sounding the alarm bell. Trust it, and take a closer look.

Uncertainty and the Uncharted 🌍

The intrepid explorer of old would stand at the edge of the known map, staring into the abyss of blank parchment, representing the uncharted. While they had the tools — compasses, astrolabes, and sextants — they also carried with them the most powerful tool: their instincts. Shaped by experiences, failures, and wild gambles, it led them through the uncertain waters and treacherous terrains.

As software engineers, our codebase is our map, and every new technology, paradigm, or methodology is uncharted. With every tech newsflash or latest release, we often find ourselves at the brink of the known, peeking into the expansive realm of the new.

So, how do we venture into the unknown? With confidence, caution, or gut instinct?

🔍
Gut Checks
When a new tech surfaces, the instinct cultivated over countless PR reviews and debugging sessions becomes our gut check. Just like I've explained before, it's like being in Rocket League — a first glance at the new library or framework, and something feels off. Is it the design pattern, the documentation, or just a gut feeling? Trust it, at least enough to dive deeper before diving in.
🎮
Treat it Like a New Game
Remember how we ease into new games? We don't just dive headlong. We test the waters, understand the mechanics, and experiment. When looking at an unfamiliar tech, think of it like that new round of Brawlhalla or Call of Duty. Get a feel of it, play around, and only then decide if it's a game (or tech) you'd continue with.
🌌
The Stars Don't Always Align
Sometimes, the most promising tech can conflict with our existing stack or team's capabilities. And here, instincts can't always be our guide. We need a mix of critical analysis, an understanding of our existing infrastructure, and a sprinkle of gut feeling.
🎸
Back to the Rhythms
Just as with my progressive music jams, understanding and integrating new tech can involve complex rhythms and time signatures. It won't always be a smooth 4/4 beat. It might be a challenging 7/8 or a mystifying 5/4, requiring a recalibration of our rhythm. But with patience and practice, the discordant can become harmonious.
🥴
Being Comfortable with Uncertainty
Not every journey into the uncharted yields treasure. But that doesn't make the journey worthless. The experience, the process of exploration, and the lessons learned pave the way for future expeditions. Embrace uncertainty as a necessary companion, much like my dear Beth's map-checking during our Liverpool escapade.

Ultimately, every uncharted territory in tech is an opportunity — to learn, adapt, and grow. So, channel your inner explorer the next time you're faced with an unfamiliar code or a new piece of tech. Set forth with your tools, experience, and instincts.

Wrapping It Up 🚀

As we draw this discourse to a close, a profound realisation has hopefully dawned upon us. Instinct, that deep-seated gut feeling, isn't something relegated to the mystics or the old-world explorers. It is an integral part of our modern digital realm and is especially pivotal in the tech industry.

From the seemingly incongruous dance of my fingers over a game controller to the meditative strumming of guitar strings, the parallels to software engineering might have seemed a bit uncanny at first glance. But now, it's evident that these instances are all manifestations of instincts honed over time and experience.

Every developer, at some point or another, will face a piece of perplexing code, a new technological challenge, or the uncertainty of the uncharted. And while knowledge, training, and logic are imperative tools in our toolkit, we shouldn't underestimate the power of our instincts. The pulses of our tech intuition are the subtle unease when a piece of code looks 'off', the slight apprehension about a new tech trend, or even the excitement of stumbling upon a promising new framework.

However, like any tool, instinct is neither infallible nor a substitute for due diligence and logical analysis. It's rather a complement, an added layer that gives depth to our decision-making processes. Whether you're deep-diving into a code review, playing with a new library, or simply navigating through the mazes of the tech world, let your instincts be your guide - but don't let them steer the ship entirely.

In the bustling world of tech, we are on a journey. A journey that is often filled with uncertainties, risks, and limitless opportunities. Just as our ancestors relied on their instincts to explore uncharted territories, we too, can harness this innate power to navigate our digital odyssey. Because, at its core, tech is not just about ones and zeros; it's about the people behind those digits.

And if there's one takeaway from our little chat, it's this: Trust in your experiences, value your knowledge, but also listen to that quiet whisper of instinct. For in the cacophony of the tech world, sometimes, that silent voice makes all the difference.

False Alarm - 27 September 1983
GitHub - emilybache/GildedRose-Refactoring-Kata: Starting code for the GildedRose Refactoring Kata in many programming languages.
Starting code for the GildedRose Refactoring Kata in many programming languages. - GitHub - emilybache/GildedRose-Refactoring-Kata: Starting code for the GildedRose Refactoring Kata in many program…