Designing an unreliable RPC framework in Rust
My latest side project is a distributed application with real-time features. A single authoritative server contains the system-wide information used by a few clients to run the application logic in sync. Nodes are required to exchange time-sensitive data at fixed intervals: information must arrive on time and expire as soon as a new message is received. In this setting, I want a lightweight, fast, and versatile communication protocol that doesn't get in the way. UDP is arguably a better choice
3 lessons learned from implementing Raft in Go
As part of my continuous learning journey, I recently picked up a Distributed Systems class from MIT that uses Golang in its labs. The course is great: all the lesson registrations and supporting materials are available online and are summarised in the syllabus. I especially liked the idea that I could learn something new about distributed systems, fine-tune my Golang skills and build something cool by developing the take-home assignments at the same time. I wasn't disappointed. After taking up
Exactly-Once Upon a Time
Implementing exactly-once processing in a distributed system Exactly-once delivery is impossible in a distributed system. This unfortunate reality is shown by a variety of mind experiments, among which the two generals' problem is one of the most famous. However, this is where we engineers had to set aside our differences and cooperate for the greater good. Namely, we solved the exactly-once delivery problem in a brilliant way: by avoiding caring about message delivery altogether! First of all
Italy's stop to ChatGPT is BS
As a teenager, I soon had to come to terms with a rough truth: Italy is seldom first. It's highly unusual to see the name of my country connected to profitable companies, technological breakthroughs, or at least pop culture mainstays. The grandeur of the Roman Empire and Renaissance city-states is long gone and even the Italian economic miracle of the 60s, an industrial and social revolution that gave Italy a respectable seat in the G8, is now a distant memory. I can barely believe that just 30
Into the modern coder cockpit: my take on Github Copilot
Despite covering some neat ChatGPT feats a few months ago, I didn't take the next logical step to try Copilot, Github's AI coding support tool. However, my interest was sparked last week, as a coworker of mine shared a screenshot of an AI-generated test suite. The prompt was reasonably simple and the generated test cases were relevant: enough to make me want to subscribe to GC free trial and contribute to the advent of the singularity event. I will avoid covering in detail what Copilot can or c
5 reasons to ban leetcode questions from interviews
Today coding challenges are the bread and butter of software engineering interviews. They are also known as leetcode problems, from the name of a popular platform that provides an interactive tool to test candidates. They consist of a broad range of standardized questions that should be answered on the spot and within a limited timeframe: generally, they only have one "correct" answer, that requires the application of very specific data structures or algorithms. Despite their popularity, I beli
The Unbearable Lightness of 2D Jumping
After implementing a simple shooter game as my most recent Godot endeavor, I wanted to increase the difficulty level a little and go for a 2D platformer. I started the project full of enthusiasm: fighting with TileMaps and laying down the main level tiles, creating a Player object affected by physics, implementing horizontal movement, and adding appropriate animations for each action. Setting up the game's basic elements was a breeze, at least initially. For instance, I was already prepared to
Designing my first Godot game
In last week's post, I talked about my first impressions of the Godot game engine. While I still have some reserves about the code generation and support for C# (I can't put accept the idea of working in GDScript, sorry), I have to say I was very pleasantly dragged into developing in Godot. I will explain what I did last week, but if you are impatient you can play my game here - as promised. Game Design The majority of my game dev hobby projects failed for the same reason: I aimed too high,
A weekend with Godot
This weekend I was totally sidetracked by the Godot game engine. After writing about my game development endeavours in a previous post, I was inspired to give another go to this old itch of mine. But where to start from? I heard great things about Godot in the past, so I decided to give it a chance. Godot is different than other popular engines because it is geared towards indies, it's open-source, and it's free (like really free, no royalties are demanded at all for using it). There is also an
Stop "teaching" ethics to software engineers
With the privilege of being part of an organized profession, there are some annoying duties as well. For instance, as a new associate of the Order of Engineers, I was strongly invited to participate in a semi-mandatory 6-hour seminary about ethics in the engineering realm. The mere prospect of enduring an endless sequence of slides about vapid theoretical moral principles was, frankly speaking, bewildering: do we seriously think we can lecture adults about ethics? However, as I am a quite ratio
How I manage spatial data for my wildfire detection dashboard
A few weeks ago, I shared the story behind the creation of the Fire Alert dashboard. In case you are not familiar with it, you can go and read about it now. I Built a Tool to Track Wildfires: This Is WhyOnce or twice a year, I have a ritual of leaving the big city to return to my home village, in south-eastern Sicily. During these retreats, I have the chance to disconnect from the bustling, relentless Milano, and enjoy a place where industriousness isn’t the only religion. Clean air, warmerLori
A Pact With the Devil: What I Learned from Clean Code
You may hate him, you may love him, but it's unlikely you never heard of him. Such is the destiny of polarizing characters like Uncle Bob, alias Robert C. Martin: programmer, speaker, and teacher in the ways of Agile and Object Oriented Programming. His fame already preceded the man when I read Clean Code, one of its most famous books, eager to find out about the crown jewel of this author and become an unstoppable dev. I was barely moving my first steps in IT when I read - no, devoured - this
My 20yo Love-Hate Relationship with Game Dev
It is said that sometimes being bored is necessary to cultivate oneself and foster creativity: it certainly was the case for me, as this was why I started programming. I think I was 8 or 9 years old at the time, my family had recently bought a new PS2, and I had plenty of time on my hands. It's sad to think it was almost 20 years ago! Ironically, what brought me to experience game development for the first time was that I had very few games. As a child, I didn't have access to the Internet or t
I Built a Tool to Track Wildfires: This Is Why
Once or twice a year, I have a ritual of leaving the big city to return to my home village, in south-eastern Sicily. During these retreats, I have the chance to disconnect from the bustling, relentless Milano, and enjoy a place where industriousness isn't the only religion. Clean air, warmer temperatures, and chirping nightingales: in other words, I created my own flavour of the Roman otium to work peacefully and meditate on my next steps. On a quiet morning like others, I was immersed in this
New Year, New Me, Same Blog 🥂
I feel a special connection to New Year's Eve, even more so than with Christmas itself. I guess part of it is the pleasure of turning the calendar year into a new, unseen number: it's like I am suddenly living in the future! This is a time when I generally have high hopes, I playfully think about plans for the following year (not with anxiety, but as foretasting pleasant experiences), and celebrate with others our achievements for the past year. Additionally, I have this ritual of making a big w
Is AI the Ultimate Philosopher?
My high school teacher often claimed that everyone should study Philosophy. She disagreed with the mainstream vision of Philosophy as a pointless divertissement reserved for out-of-touch and entitled elites or just as a boring discipline from academia, too abstract to be appreciated by street-smart laymen. All in all, she continued, anyone is a potential philosopher because all we need to practice it is already inside ourselves: a rational mind and a genuine curiosity towards the universe we inh
Too Lazy to Learn Alone? Ask ChatGPT to Join You
You may have noticed that, in the last few years, the Rust language has become a true Intenet darling. Developers with backgrounds in Javascript or Python are rushing to make Rust their second, third, or Nth language over weekends, advocating for its crushing superiority on the grounds of its irrefutable performance and reliability. Sassy content creators are filling the metaverse with playful thumbnails featuring Ferris, the adorable crab mascot spearheading Rust into stardom. Even supposedly r
I Automated my AWS Lambda Artifacts with Go
I'm having some fun with AWS Lambda lately. It is cheap, easy to integrate with other services or APIs, and almost effortless to get up and running. Almost.
Programming my Tello Drone with Arduino and Goodwill
Among all the impulse purchases of this year, my quadcopter is one I don't regret at all. In general, I was always fascinated by drones (it's understandable, they are flying robots after all) and I like programming stuff - so I decided to get the best of both worlds and go buy my own. The market offers a few alternatives, but my ideal drone had to feature the following must-haves: * it would be programmable in a full-fledged language like C or Python * it would have at least a camera, and may
The Beauty of Test Pyramids
I hate bugs. Please, don't misunderstand me: I don't necessarily despise looking into errors and fixing them. In fact, sometimes investigating bugs can be exceptionally rewarding and makes me feel like a hard-boiled detective. No, what I hate is that they break my illusion of being some kind of magician, muttering powerful spells in the shape of lines of code and bending reality to my will. According to my ideal, microservices should harmonically run together, with no hiccups, no breaks, and no
The Swap file Trick
«Hey, look at what I made! » I said triumphantly, addressing a friend of mine «It's online. Just open the link!». I was so proud of my work. After a couple evenings of frantic work, I finally put together my small project and I was ready to show it to the world. «But I don't see anything!» my first user replied, revealing a hint of skepticism «Screen's blank». I was appalled. I felt betrayed and frail. My amazing personal website was already down after just a few hours and I hadn't any idea why
Building a Simple Forex App with AWS Lambda and Telegram Bots
If you work as a freelancer in the digital economy, it is likely that you have a global perspective when looking for new prospects and collaborators. A huge, worldwide pool of potential clients and opportunities is available to you. For this reason, it's not uncommon for Designers, Marketing Specialists, Web Developers, or Sales Reps to work with business partners which are based in different countries. Sometimes, a client may be willing to pay you in its local currency only. Of course, this is
A Perspective on the Future of Software Engineering
Mass layoffs at Stripe and other fintechs. Elon Musk progressing towards his villain arc at Twitter. Bullish companies like Meta and Amazon announcing hiring freezes throughout this year. Now, do you also feel this sense of impending doom? Regarding Twitter’s reduction in force, unfortunately there is no choice when the company is losing over $4M/day. Everyone exited was offered 3 months of severance, which is 50% more than legally required. — Elon Musk (@elonmusk) November 4, 2022 As soft
Publish Your First Package With Gradle and GitLab
We are approaching the holiday season and, if you somehow celebrate, you will likely have to think thoroughly about this year’s round of gifts and how to delight family and friends. I admit, I sometimes feel that consumerism has spoiled a little the innocence of the gifting ritual. At the very least, I feel that I should personally wrap my gift boxes to give them a personal touch and earn back the joy of donating something. If we can take care of the physical envelopes of our gifts, why not lea
Learning Tries with Dinosaurs
A cool thing about being a software engineer is that there is always something new to learn. Although I was familiar with some common data structures like Lists, Stacks and Trees, I was guilty of not knowing about Tries. As the name suggests, Tries are essentially a type of Tree. They are optimized for searching and retrieving keys organized in hierarchical structures: each node would store a key value and have a varying - although limited - number of children that represent valid successors in
Designing a distributed AgTech application with IPFS
While building Smart Contracts I realized how some trivial decisions in the context of centralized programming can rapidly become a first-class concern. For instance, where should I store my files so that any involved party can see them and verify their integrity? How to make sure no one can withhold an important document I am interested in? In the past, I tried to avoid the need of reference files altogether, or to store just a hash on the ledger and confide in the kinship among the network par
Smart Contract Javafication: Web3j Wrappers and Other Sorceries
Recently I was dabbling with Quorum, an open-source suite of tools, APIs, private key managers and clients to operate a private Ethereum network. My main goal was to figure out how to build applications on top of the Ethereum blockchain and how to correctly interact with Smart Contracts. I chose a Quorum version using Besu, an Ethereum client maintained by the Hyperledger Foundation that implements private transactions for enterprise use cases. As a first step, we would need to prepare the tool