The Archeology of Apex: Digging Through Layers of Old Code
By Kodelens Team
•September 13, 2025

Your first day on a new project. You open the Salesforce org, and it's not a greenfield; it's an ancient city, half-buried in the digital sand.
You've been handed a rusty pickaxe, a faded map, and told to find the "Lost Temple of Billing Logic." In that moment, you realize you are no longer just a developer. You are an archeologist.
Every Salesforce org older than a few years is a digital dig site. It has geological layers of technology, forgotten ruins of past features, and mysterious artifacts left behind by previous civilizations (i.e., the developers who came before you). Exploring this digital ruin is one of the most challenging, and sometimes frustrating, parts of our job. This is a tribute to the developer-archeologists and a look at the tools that can make your next dig more successful.
The Geological Layers of a Salesforce Org
As you start to dig, you'll notice distinct layers, each with its own unique style and technology.
The "Classic" Stratum (The Ancient Ruins)
This is the deepest, oldest layer. Code written before Lightning was even a glimmer in Salesforce's eye. Here you'll find artifacts like apex:pageBlockTable, actionFunction, and JavaScript buttons that perform cryptic rituals. This code was often powerful and effective for its time, but it was built with patterns that are now considered anti-patterns. It's the Roman ruin at the bottom of a modern city—still functional, but from another world entirely.
The "Early Lightning" Stratum (The First Settlements)
This layer represents the awkward teenage years of the platform. It's filled with Aura components and the complex, event-driven architecture that came with them. You can see the struggle in the code as developers tried to adapt to a whole new paradigm. It works, but the logic can feel tangled and difficult to follow, like a medieval city's winding, illogical streets.
The "Declarative-First" Stratum (The Lost Cities of Clicks)
Perhaps the most dangerous layer of all. This is an era where everything was built with Process Builder and Workflow Rules. This stratum is treacherous because the logic is completely invisible to a developer looking at the codebase. It's the source of mysterious performance issues, recursive bugs, and field updates that come from "nowhere." It's a lost city, hidden from your tools, that can silently sabotage your work.
The "Modern" Stratum (The New City)
This is the top layer, the gleaming modern city. It's full of clean Lightning Web Components, well-structured Apex trigger frameworks, and proper unit tests. This is the code you are writing. But it has to coexist with all the ancient layers beneath it, and its foundations must be carefully placed to avoid disturbing the ruins below.
The Artifacts You Discover on Your Dig
As you explore these layers, you'll uncover a number of famous artifacts.
- The God Trigger: The huge, monolithic temple at the center of the city that all roads seem to lead to. It handles everything from account validation to case creation, and its inner chambers haven't been fully explored in years.
- The Cryptic Scroll: A complex, 800-line Apex class with no comments, written by a developer who left the company five years ago. Its name is vague, and its purpose is a complete mystery, but you know it's important because it's referenced everywhere.
- The Cursed Tomb: A piece of code that everyone on the team is afraid to touch. Legend has it the last person who tried to change it brought the entire system down for a full day. It sits there, untouched, accumulating digital dust.
- The Booby Trap: A legacy Workflow Rule that silently overwrites a field value after your brand-new Apex trigger runs perfectly. It undoes your work without a trace, causing you to spend hours questioning your sanity and your skills.
The Tools of the Modern Archeologist
For decades, the tools for this job have been primitive. You had your pickaxe (Ctrl+F), your brush (manually reading code line-by-line), and a lot of patience. This method is slow, and one wrong move could cause a tunnel to collapse.
But what if you had better tools?
- Ground-Penetrating Radar: Imagine a tool that could scan the entire dig site from the surface and show you a complete 3D map of all the hidden chambers, forgotten tunnels, and dangerous voids. This is what a true code discovery tool should do.
- The Universal Translator: Now imagine you could point this tool at that Cryptic Scroll (the old Apex class) and have it instantly tell you its purpose in plain English. This is the power of semantic search. Kodelens acts as your universal translator, deciphering the intent of past developers so you don't have to guess.
Conclusion: From Archeologist Back to Architect
Working on a legacy codebase can often feel like a thankless job of carefully digging through someone else's history.
But with the right tools, you can transform the experience. You can quickly map the old city, understand its layout, and get to your real job: designing and building the new one. The goal is to spend less time digging and more time being an architect.
Every developer deserves modern tools for a modern job. It's time to trade in your pickaxe for a GPS. Your next great discovery about your own codebase is just one search away.

