4 ms·
"Randomly capitalize the first letter of a syllable in the middle of a word. For example ComputeRasterHistoGram()." I do this by accident all the time. And th
by tomelders 15y ago
"Randomly capitalize the first letter of a syllable in the middle of a word. For example ComputeRasterHistoGram()."
I do this by accident all the time.
And this is the funniest thing I've read on the internet all year:
"Make sure that every method does a little bit more (or less) than its name suggests. As a simple example, a method named isValid(x) should as a side effect convert x to binary and store the result in a database."
- pkteison 15y agoI wish I still thought that was funny, instead of just painful. I can't tell you how many times I have been burned on Is or Get methods with incredible side effects, like IsValid also automatically logs the user in, creates them if they don't exist, and retrieves their birthday from the database to make sure it's valid. (edit: yes, that really happened.)
- msellout 15y agoThat "isValid(x)" line is my favorite as well. I'm sure discovering these bizarre side-effects has taken days (weeks, months?) of all our lives.
- FuzzyDunlop 15y agoI've done this a couple of times just through sheer stupidity. Then I forget about it. It always makes me laugh when my colleague ends up going through it to add another method and can't get his head around the fact one of mine has a hidden dependency obscured by an autoloader, with irreverent comments like `// lets get some validation up in this bitch` littered all over it. PHP autoloaders and magic methods are a great source of such frustration when pulled off right.