F
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 In
4 Comments
annaf73
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_lopez
That PHP 7 to 8 migration guide highlighted strict types.
4
jessica331
jessica33114d ago
Honestly, I kinda miss the wild west days of loose typing.
1
rowanw91
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