post: rewrite the first series post closer to my voice, less punchlines and one real number story
All checks were successful
Deploy to OVH VPS / deploy (push) Successful in 57s
All checks were successful
Deploy to OVH VPS / deploy (push) Successful in 57s
This commit is contained in:
parent
feaf5c1d4e
commit
68f6156271
1 changed files with 19 additions and 20 deletions
|
|
@ -10,7 +10,7 @@ On April 1st I opened a new Rust workspace.
|
|||
<br/>
|
||||
No, it was not a joke, even if the date was suspicious 😄
|
||||
|
||||
The plan was very small: learn Rust by scraping the public notice board of **one** municipality, Scicli, a town 15 minutes from my house. One town, one website, one crate.
|
||||
The plan was very small: learn Rust by scraping the public notice board of **one** municipality, Scicli, a town 15 minutes from my house. One town, one website, one crate, that's it.
|
||||
|
||||
Six months later the numbers are these:
|
||||
|
||||
|
|
@ -20,46 +20,45 @@ Six months later the numbers are these:
|
|||
- **2,161** commits
|
||||
- three products and one new job title
|
||||
|
||||
So... something went a bit out of control. Too many things for one post, so this is the first of a small series, mostly for future-me, because I already forget the details of things I did in May.
|
||||
So... something went a bit out of control 😅 and there are too many things for one post, so this is the first of a small series, mostly for future-me, because I already forget the details of things I did in May.
|
||||
|
||||
## What an "albo pretorio" is
|
||||
|
||||
In Italy every public body has an *albo pretorio*: an online notice board where they must publish their acts. Council decisions, spending approvals, tenders, public works, the money for the town festival, everything.
|
||||
In Italy every public body has an *albo pretorio*, an online notice board where they must publish their acts: council decisions, spending approvals, tenders, public works, the money for the town festival... everything.
|
||||
|
||||
It's public by law. Anyone can read it.
|
||||
It's public by law and anyone can read it, at least in theory.
|
||||
<br/>
|
||||
In theory.
|
||||
In practice every municipality buys its website from a vendor and every vendor built its own notice board, in its own way and with its own bugs, so there is no standard and no API. If you want to know what happened in 7,896 towns you have to open 7,896 websites, one by one, every day. Good luck! 🙃
|
||||
|
||||
In practice every municipality buys its website from a vendor and every vendor built its own notice board, in its own way, with its own bugs. There is no standard, no API, no feed. You want to know what happened in 7,896 towns? Open 7,896 websites, one by one, every day.
|
||||
|
||||
So I built albopretorio.io: a crawler that does it for you and one place where you can search everything.
|
||||
So I built albopretorio.io, a crawler that does it for you and one place where you can search everything.
|
||||
|
||||
## About Rust (and about honesty)
|
||||
|
||||
The original idea was a strict "learning mode": I asked Claude to be my Rust tutor, explain the compiler errors and **not** write code for me.
|
||||
The original idea was a strict "learning mode". I wrote a file with the rules for Claude: be my Rust tutor, explain the compiler errors and **do not write code for me**. It even says which HTTP client to use (`ureq` and NOT `reqwest`, to avoid async at the start) and that `.unwrap()` is fine "for now".
|
||||
<br/>
|
||||
That rule lasted less than I want to admit.
|
||||
The funny part? That file is still in the repo and it still says that we are in "Phase 1" and that "Lorenzo is writing the crawler" for Scicli 😁
|
||||
<br/><br/>
|
||||
The truth is that the Scicli scraper was already committed on day one and on day three there was an LLM reading the PDFs of the acts... so, let's say the rule didn't last long.
|
||||
|
||||
When the project became bigger than a toy, I switched to the same way of working I described in the [Astro migration post](/blog/from-angular-to-astro): I decide what to build, the agent writes a lot of it, I review, I test, I fix what it doesn't see.
|
||||
When the project became bigger than a toy I switched to the same way of working I described in the [Astro migration post](/blog/from-angular-to-astro): I decide what to build, the agent writes a lot of it, I review, I test and I fix what it doesn't see.
|
||||
|
||||
Did I learn Rust? Yes, but in a different way than I planned. I learned to *read* it very well, I learned ownership by fighting with it on real problems, I learned why `Result` and `?` are better than try/catch. I didn't learn it by writing every line.
|
||||
<br/>
|
||||
I'm fine with that. The goal changed on the way.
|
||||
Did I learn Rust? Yes, but not in the way I planned. I learned to *read* it very well, I learned ownership by fighting with it on real problems and I learned why `Result` and `?` are better than try/catch, but I didn't write every line and I'm fine with that, because the goal changed on the way.
|
||||
|
||||
What I would say to anyone doing the same: **the agent is great at adding, you must be the one who checks.** Every time I trusted a number without looking at the data myself, the number was wrong. Every time.
|
||||
What I would say to anyone doing the same is that the agent is great at adding things, BUT you must be the one who checks them, especially the numbers.
|
||||
|
||||
## What I learned (so far)
|
||||
|
||||
- **Start with one town.** Scicli was the right size to learn. Then the second town teaches you more than the first.
|
||||
- **Measure twice.** Every number I shared too fast was wrong: visitors, empty municipalities, costs.
|
||||
- **AI agents make you fast, not right.** Being right is still your job.
|
||||
- **Boring infra is still good.** Rust binaries, Postgres and a couple of machines on OVH. Nothing fancy. And it holds 5 million acts.
|
||||
Starting with one town was the right call, Scicli was small enough to understand every page of it. The second town taught me more than the first, because it looked the same and it wasn't.
|
||||
<br/><br/>
|
||||
About numbers... it happened again while writing this post! The first draft said 1.7 million acts, taken from notes of July without checking, today they are 5.1 million. Same story with visitors, empty municipalities and costs: every number I shared too fast was wrong.
|
||||
<br/><br/>
|
||||
And the infra is almost boring: some Rust binaries, one Postgres and a couple of machines on OVH, nothing fancy. It holds 5 million acts anyway 🤓
|
||||
|
||||
## Closing
|
||||
|
||||
Six months ago I wanted to learn a programming language.
|
||||
<br/>
|
||||
Now I know which vendor runs the notice board of a town of 300 people in the Alps, how many *sagre* there are in Puglia in August and which public domains are selling pills.
|
||||
Now I know which vendor runs the notice board of a town of 300 people in the Alps, how many *sagre* there are in Puglia in August and which public domains are selling pills 💊
|
||||
|
||||
Not what I planned, but I'm happy it went this way.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue