834 B
834 B
title | pubDate | permalink | tags | ||
---|---|---|---|---|---|
Types and static analysis saved me today | 2023-01-01 | daily/2023/01/01/types-and-static-analysis-saved-me-today |
|
Today I was writing Pulumi code in Typescript, and I although I have autocompletion, I mistyped the name of a property.
But, because of the types that I'd declared and how I have Neovim configured, the error was immediately shown, and I was able to fix the typo and what would have been a compilation error if I'd tried to run it.
It only took a second or two for me to make and fix the mistake.
I didn't need to run the code or commit it and push it to a CI pipeline to find out that there was a bug.
I found out and fixed it immediately, and moved on as if I hadn't written the typo at all. This is why I like types and static analysis.