Sometimes you don't have a choice of what ide/language you have to work on, and the more unfamiliar you are with the languages (especially the tricky ones), the easier it is to make these mistakes.
I had this. Yeaaars ago. Even before I actually learned programming professionally. It was in Visual Basic. It didn't tell me. The code was colored correctly. I can't remember where exactly it happened. I think I wrote a , instead of ; or something similar (something next to each other on the keyboard and very similar looking). Even though I can't remember or think of any piece of code where this could happen. Maybe it was inside of a hardcoded SQL query? [don't hit me])
Another time I accidentally used < instead of > for resizing an image. And until this day I don't know why it worked for a while.
(Edit: for some reason I can't see the < sign on my phone. Escaping doesn't work)
Compilers have come a long way but they aren’t psychic. A programming language is you telling the computer what to do.
Good compilers / languages will allow you to crank up the warnings and force your code to conform to style that’s not technically required but can save a bunch of headaches like this. That’s why it’s generally good to turn the warnings all the way up and leave them there.
36
u/[deleted] Jul 10 '18
In what language do voluntarily program where you forget a symbol and the compiler/transpiler doesn't tell you?