Notes
Investigating challenging problems and bugs is an exciting experience that often leads to remarkable discoveries and personal growth. As a engineer, I’ve always found joy in decoding complex issues and diving deep into the unknown. The thrill of the hunt, the satisfaction of piecing together clues, and the ahá moment when everything falls into place are unique.
One of the most rewarding aspects of problem-solving is the opportunity to learn new things. Every bug, every system failure, and every unexpected behavior is a chance to expand your knowledge and skillset. It’s like being a detective in the digital world, where each case brings its own unique challenges and lessons.
The skills developed through problem-solving and investigation are not only valuable in professional settings but can also be applied to personal life. Embracing the challenge of investigating problems and bugs not only makes us better professionals but also equips us with valuable life skills. It teaches us to be persistent, adaptable, and open to learning.
While the truths we uncover can be difficult or painful, they ultimately lead us to growth and a deeper understanding of ourselves and the world around us.
Indeed, these problem-solving skills can sometimes lead to unexpected and challenging discoveries in our personal relationships.
Slightly inspired by this thread: https://twitter.com/rosapolis/status/1828014752112545924
I’ve never been enthusiastic about the AI revolution.
However, this week, I started using Zed.dev together with their AI assistant integration. I’m surprised by the experience and efficiency gains. I still have reservations, but it can be valuable allies in tackling programming challenges and routine tasks.
For example, a few days ago, I was working on a tool that needed to parse ClickHouse explain output1, an easy task requiring recursively transverse all the properties looking for some specific properties.
With a simple prompt, the model wrote a working version.
Write code to extract all primary key granules from explain_result. An example of explain_result here:
{…}
def extract_primary_key_granules(explain_result):
def traverse(node):
granules = []
if isinstance(node, dict):
if 'Indexes' in node:
for index in node['Indexes']:
if index.get('Type') == 'PrimaryKey':
granules.append({
'Keys': index.get('Keys', []),
'Initial Granules': index.get('Initial Granules', 0),
'Selected Granules': index.get('Selected Granules', 0)
})
for value in node.values():
granules.extend(traverse(value))
elif isinstance(node, list):
for item in node:
granules.extend(traverse(item))
return granules
return traverse(explain_result)
# Example usage:
result = extract_primary_key_granules(explain_result)
for granule in result:
print(f"Keys: {granule['Keys']}")
print(f"Initial Granules: {granule['Initial Granules']}")
print(f"Selected Granules: {granule['Selected Granules']}")
print()
The task was relatively easy and I had to make changes and improve the initial code. Despite that, this saved me at least an hour of back-and-forth writing the function and running some tests to see if it worked as expected!
I started using Zed AI assistant with ChatGPT integration. A day after they released their own integration that I’m now testing together with Anthropic’s Claude model. I’m not even using Google for simple searches anymore.
Footnotes
-
This is how a ClickHouse explain output looks like ↩
-
So You Want To Build A Browser Engine — This article goes deep into all the complicated things involved in making a browser engine. It’s amazing how browsers keep getting better and adding more features while maintaining all the required complexity.
-
Databricks, Snowflake and the future — This piece tells you about the recent meetings of Snowflake and Databricks. It focuses on how they are putting money into Apache Iceberg.
-
The time I spent three months investigating a 7-year old bug and fixed it in 1 line of code — This is an interesting story about someone spending three months trying to fix a really old bug. And how they only needed one line of code to solve it. Nice read about debugging software and hardware.
-
Local, first, forever — An insightful article on the local-first philosophy and the implementation of services without reliance on a centralized server. Includes an introduction to CRDT and a sample implementation.
-
What Goes Around Comes Around… And Around… — A retrospective review of the evolution of relational database management systems over the past two decades. It gives a good overview of how things are and how have evolved.
-
A write-ahead log is not a universal part of durability — Explores the concept of durability in databases, challenging the notion of a write-ahead log as a universal component.
-
Unix’s fsync(), write ahead logs, and durability versus integrity — Expands on Phil Eaton’s post about database durability, incorporating the crucial aspect of integrity into the discussion.
-
The Right Kind of Stubborn — Paul Graham talks about two types of stubbornesss: persistence and obstinacy. He explains that it’s good to keep going when you need to, but it’s bad when you won’t change your mind.