3 ms·
> I have made this kind of typo maybe 2 or 3 times Pardon my french, but that is some straight-up horseshit. Even if you were the best programmer in the world
by that_jojo 7y ago
> I have made this kind of typo maybe 2 or 3 times
Pardon my french, but that is some straight-up horseshit.
Even if you were the best programmer in the world, I would be skeptical at you saying that you make that kind of typo less than two or three times a year or per project, much less over the course of fifteen whole years.
- gridlockd 7y agoI can see it, in the beginning I may have made that mistake more often for a while, but I don't think I've made this mistake in years. The difference is absolutely ingrained, just like I wouldn't mistake plus for minus. Perhaps it's different for people who read a lot of math. I would agree that having equals-assignments as valid expressions is bad, I just don't think it's such a big deal. If you are using such a language, you should be using a linter anyway. Using := would be very annoying for me, even though I can see the argument and would favor it in theory.
- com2kid 7y agoHow about JavaScript and '==' versus '==='? Or going back and forth between languages that use '==' and JavaScript? Let's say over all of history there have been a million C/C++ programmers, and each of them has made that mistake ~5 times, in total. And let's be generous and say that 95% of the time it was found before it got anywhere near production. That is still 250,000 bugs introduced. Not to mention how much time is spent tracking down the bug once it has been in the code base for awhile. If it goes unnoticed for a couple of weeks debugging becomes non-linearly harder.
- gridlockd 7y ago> How about JavaScript and '==' versus '==='? > Or going back and forth between languages that use '==' and JavaScript? That's a mistake I make often, but it's exactly because Javascript is different here from all other languages that I use. Let's say I had to use a language with ':=' as assignment, I would still accidently type '=' all the time. > Let's say over all of history there have been a million C/C++ programmers, and each of them has made that mistake ~5 times, in total. > And let's be generous and say that 95% of the time it was found before it got anywhere near production. > That is still 250,000 bugs introduced. Well, so what? That's 250,000 out of maybe a hundred million bugs. I'm not saying it's good language design to have this behavior, quite the opposite. I'm saying it's not a big deal, especially considering all the other footguns in these languages. It's also not like these languages are going change it.