Dante’s Code Hell Inferno: the Nine Layers
Torments of Software Engineering Through the Prism of the Circles of Dante’s Inferno as a Satiric Thought Experiment on Best Practices
Having previously introspected how The Software Engineer is a Creator of Universes and delved a bit into the philosophical realm with Plato’s Republic Of Software Engineering, I stumbled upon how well the sins of software engineering can be expressed through Dante’s work for added artistic touch.
The next chapter of this series is Code Purgatorio: Ascension to Clean Code.
In Dante Alighieri’s “Inferno” (part of the Divine Comedy), souls traverse through the nine circles of Hell, each representing a unique sin and its perpetual punishment to the mortals who dared do them. You can read the Divine Comedy in its entirety in Project Gutenberg.
Did You Know?
In Dante’s Inferno, the sins aren’t categorized by their worldly severity but by Dante’s view of spiritual maliciousness. While violent sins might seem worse, Dante placed treacherous sins in the deepest circles instead, believing them to be most indicative the spiritually corrupt.
Code Hell
Let us go through a fun and somewhat sobering thought experiment of layering the daily life of the software engineer over these sins where developers must forever troubleshoot issues in a legacy system, written in an obsolete language, with no documentation, on painfully slow servers. Every fix introduces three new, even more cryptic bugs. The keyboards are all sticky with soda, and the only available search engine is one from the 90s that spams animated GIFs instead of useful results.
If you like this content, please consider clapping, following and subscribing to my newsletter.
The circles of Hell become layers of Hell that the software engineer has to journey through before reaching Purgatorio and Paradiso:
- Limbo — Debugging Abyss
- Lust — The Allure of Shiny Frameworks
- Gluttony — Bloated Code
- Greed — Hoarding Dead Code
- Wrath — Compiler Rage
- Heresy — Ignoring Best Practices
- Violence — The Brute Forcer
- Fraud — Copy-Paste Coding
- Treachery — Betraying Trust in the Code
First Layer: Limbo — Debugging Abyss
Engineers here find themselves lost in a purgatory of endless debugging and callback hell. Armed with infinitely long recursive stack traces that offer more mystic questions than answers and breakpoints that never quite seem to trigger.
at Object.exports.runInThisContext (vm.js:78:16)
at Module._compile (module.js:511:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at runFn (node.js:743:12)
at startup (node.js:241:18)
at node.js:814:3
at nextTickCallbackWith0Args (node.js:453:9)
at process._tickDomainCallback (node.js:423:13)
at tryCatcher (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/promise.js:510:31)
at Promise._settlePromiseAt (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/promise.js:584:18)
at Promise._settlePromises (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/promise.js:700:14)
at Async._drainQueue (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/project/node_modules/rainbow-colors/node_modules/bluebird/js/main/async.js:15:14)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
at ... (30 more lines)
Console logs litter the code like breadcrumbs, yet they lead only to more confusion and as they randomly spit out output or nothing at all.
def callback_hell(callback):
return callback(callback_hell)
callback_hell(callback_hell)
Second Layer: Lust — The Allure of Shiny Frameworks
In this realm, developers are incessantly captivated by the newest, shiniest released frameworks without fully understanding them, forever starting new projects, refactoring and rewriting code end-to-end but never finishing anything.
Grace Hopper, known for her invention of the compiler, is often seen warning developers not to jump into every new framework’s bandwagon that is trending, advice that falls on deaf ears.
Dev A: Just rewrote my entire web app in Flutter!
Dev B: Flutter? That’s so last hour. I’ve moved to QuiverDartX++.
Third Layer: Gluttony — Bloated Code
Efficiency is merely a distant memory here. Programmers gorge on cross-dependant spaghetti libraries and dependencies for the simplest of tasks.
The gluttonous developers who never optimise their code reside here in perpetuity, waiting for programs that will never finish to run.
def wasteful_function():
data = [i for i in range(1000000)] # Extravagantly large list
return sum(data[:10]) # Only using a tiny fraction of it
npm install left-pad rainbow-colors is-odd is-even array-flatten string-reverse capitalize-first-letter is-zero
Fourth Layer: Greed — Hoarding Dead Code
Why delete that old function when you might use it someday? The desktop overflows with unused scripts and commented-out functions, all kept “just in case.”
This layer is where the comment code collectors, the “Might Need Later” enthusiasts and redundant function guardians come to be punished.
// Keeping this here, might be useful in future
// function oldCode() {...}
Fifth Layer: Wrath — Compiler Rage
An incessant battle between developers and compilers. No matter how meticulous the coder, the compiler finds a way to lash out with cryptic errors, each more unreadable than the last.
Error: no match for 'operator+'
In file included from main.cpp:5:0,
from universe.cpp:3,
from existence.cpp:2,
from quantum.h:6,
from <unknown>:2147483647:
dimensional_plane.h: In instantiation of ‘void AstralPlane<T>::conjoinDimensions(T, T) [with T = void*]’:
reality.h:42:71: required from ‘void Reality::interweave<AstralPlane<void*> >(AstralPlane<void*>) [with T = void*]’
existence.cpp:25:9: required from here
dimensional_plane.h:56:12: error: no match for ‘operator+’ (operand types are ‘void*’ and ‘void*’)
result = firstDimension + secondDimension;
^
Sixth Circle: Heresy — Ignoring Best Practices
For those who thought they knew better than decades of collective software wisdom, who never read about design patterns and for which algorithms are a foreign concept. To the join engineers ignoring version control, dismissing security guidelines, and scoffing at testing end up here.
passwords = ["password123", "admin", "letmein"];
In this layer, developers experience a story on a loop of their boss asking them to urgently fix an issue by the end of the day in a codebase littered with variable names like thing1
and x
.
Seventh Layer: Violence — The Brute Forcer
Reserved for those who commit acts of violence against their codebase, their users, and even their fellow developers. Those who brute force their way through problems without any elegance or thought for scalability. They might solve a problem, but in the most violent and resource-wasting manner possible deployed all the way to production.
The programmers here might have done something like this with a complexity of O(n³):
# Brute-forcing finding 3 numbers in a list that sum to a target
def find_pairs(nums, target):
for i in range(len(nums)):
for j in range(len(nums)):
for k in range(len(nums)):
if i != j and j != k and i != k and nums[i] + nums[j] + nums[k] == target:
return (nums[i], nums[j], nums[k])
return None
Instead of at least doing O(n²):
def find_pairs(nums, target):
n = len(nums)
for i in range(n-2):
seen = set()
for j in range(i+1, n):
needed = target - nums[i] - nums[j]
if needed in seen:
return (nums[i], nums[j], needed)
seen.add(nums[j])
return None
This layer also welcomes those who commit without comments, ignore the documentation process, or push to master without reviews or testing and of course those known to break the build and leave for a vacation.
Eighth Layer: Fraud — Copy-Paste Coding
Why understand the code when you can simply copy it from Stack Overflow?
In this layer, the copied code never quite fits the need, leading to more deception, hacks and endless frustration.
// Copied from Stack Overflow, not sure how it works but it does!
function magicFunction() {...}
Ninth Layer: Treachery — Betraying Trust in the Code
In this final chilling layer, developers committed grave sins like pushing untested code to production or dropping the entire production database with no backups.
Those who create viruses, backdoors and scamming software find their permanent home in this layer.
let userExpression = prompt("Enter a math expression:");
let result = eval(userExpression);
alert(`The result is: ${result}`);
In this layer of Hell code rearranges itself randomly and threads freeze unpredictably to bring unending pains to treacherous developers.
The Layers of Code Hell serves as a cautionary tale, encouraging us all to not become evil engineers. Our journey through the nine circles of Code Hell reminds developers of the pitfalls to avoid, and the standards and best practices to embrace.
The line between digital heaven and hell is but a single line of code.
The next chapter of this series is The Code Purgatorio: Ascension to Clean Code.
Dear Reader,
Please clap, follow and join my newsletter if you like this content and you would like to support 🙇🏻♂️. You can connect with me on X (Twitter), Linkedin, Instagram & Github, and find out more on nenuadrian.com!
If you liked this article, you may also enjoy:
- Dante’s Code Hell Inferno: the Nine Layers
- The Code Purgatorio: Ascension to Clean Code
- How To Not Be a Run-of-the-Mill Software Engineer
- Plato’s Republic Of Software Engineering: A Philosophical Perspective
- Code 💻: The Modern Driving Skill — Why It’s as Crucial Today as Driving 🚙Was in the Past
- Diversify your Experience as you would your Investment Portfolio!