- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
No, I wouldn't, actually. I'd assume that it's a callback that handles (the result of) the generation of the key, so we pass it as a callback (mechanism depending on the language) to some generator function.
Admin
Same here. If I wanted a key generated I'd expect something like GenerateRSAPrivateKey or RSAPrivateKeyGenerator.Generate or PrivateKeyGenerator.GenerateRSA etc.
Edit Admin
It would depend on what class/file it's in. If it's in a class named something like
PrivateKeyGenerator, sure, you would probably expect it to be called after the key is generated. If it's in a class of HTTP request handlers, then you would expect it to be the method that's called when the user sends aRSAPrivateKeyGenerationrequest, which I would guess is a request to generate a key (though as mentioned, something likeGenerateRSAPrivateKeywould be a better name).Admin
So the lesson here: avoid the generic "handle" in your method names, and pick a more descriptive verb. How is your method handling the thing?
Admin
I make sure as many of my methods as possible are named
HandleThing. That way, if the handling behaviour or thing type change I don't need to update the method name. This is what is known as self documenting codeAdmin
Honestly, I think the issue here is slightly different than what Remy suggests. Still not great, and perhaps I'm being a bit pedantic here. However, I think that in a lot of minds, "RSA key" has become a generic trademark for any sort of public/private key, similar to Kleenex for facial tissue, Jell-o for flavored gelatin, etc., and I think that's what's going on here. Not sure if it makes it slightly less of a WTF or not, though.