2 ms·
What a terrible article. I feel dumber having read it. It's one of those articles that sounds good and takes more effort to correct than it took to write, and t
by mikeash 12y ago
What a terrible article. I feel dumber having read it. It's one of those articles that sounds good and takes more effort to correct than it took to write, and thus causes a net loss.
Just one example: "That gives every path to this function a 50% to 75% chance it will fail with just the inputs above." I mean, what kind of nonsense is this? This is pretty much saying that the odds of winning the lottery are 50%, because either you win or you don't.
Most of the article is spent on discussing the perils of a strcpy reimplementation. Yet there's no discussion of a fix. The author simply assumes the existence of a magical "safercopy" function that behaves correctly on all inputs. Of course the author doesn't provide the implementation of this function, because if he tried to write it, he'd discover that it's impossible.
In short: flagged for being awful.
- zedshaw 12y agoAuthor here. Let's deconstruct your comment and see if it makes me dumber having read it. P1: I'm sure the article is not the reason for you feeling dumber. P2: It's a probability, something that as a programmer I'm sure you don't really understand so I can let it pass for now. Incidentally, your last sentence in that paragraph proves this. P3: The safercopy does behave correctly on all the inputs, and these kinds of functions do exist. In fact I use them in the rest of the book and if you want to use them too there's libraries like bstring and safestring that do this. You could also just not use C. P4: Wow, you flagged it....for being awful? Does that make you feel powerful today? You should go ask for a raise too. And demand kinky sex from your partner...assuming you have sex that is.
- mikeash 12y agoBeing an asshole does not make you correct.
- zedshaw 12y agoYou actually were an asshole first my friend. You came in with a comment that was rude, not insightful, and seriously uninformed and then announce how you're going to flag it as awful. Everything about what you wrote makes you an asshole, and you started it. There were about a trillion different ways you could have written your comment in a polite yet still direct way to further the discourse along but you chose to be obnoxious. Don't be butthurt that I'm just better at being an asshole than you are.