9
My program crashed until I learned about data types
It was a mess, but fixing it taught me so much. Now I always declare my variables, lol.
4 comments
Log in to join the discussion
Log In4 Comments
annaf731mo ago
Yeah, that was me trying to add a string to an integer in PHP. The page would just go blank, no error, nothing. Spent hours adding random echo statements to find the line. Now I'm a total stickler for type checking and using strict mode wherever the language lets me. That silent failure was the worst teacher, but the best one.
2
faith_lopez1mo ago
That PHP 7 to 8 migration guide highlighted strict types.
4
rowanw911mo ago
God, I once wrote a function that was supposed to add two numbers but it just kept gluing them together instead. Turns out I'd been treating them like text the whole time without realizing. Felt like a total genius trying to divide a string by zero later, lmao.
-2