Re:Thirteen Years of Bad Game Code
by philbarr on Friday March 31, 2017 @06:04AM
(#14002399)
Best one liner I've ever seen in "professional" code:
[ Parent
| on HN ]
Not sure I'd say it was he best, but it was certainly memorable:
boolean alanIsABastard = true;
As I was the only person in the company with that name it was clearly meant for me! :-)In my current project at work, I still have a class named:
public class ClassWithBadNoGoodNameForSharingStuffCommonToHandlers { //TODO rename
One day soon, I'll figure out what abstraction it represents and rename it...git blame to the rescue!
Re:Thirteen Years of Bad Game Code
by sillysaurus3 on Friday March 31, 2017 @06:19AM
(#14002446)
I liked enum Boolean { TRUE, FALSE, FILE_NOT_FOUND };
What's convenient is that TRUE is false, FALSE is true, and FILE_NOT_FOUND is also true.
Well the last is basically what NULL means...
I was horrified to see:
public void encryptCreditCard(int[] cc) {
int tmp = cc[0];
cc[0] = cc[6];
cc[6] = tmp;
// and so on...
}
Decrypt version just did the steps in reverse, of course.I once had to implement "encryption" that consisted of rot13(base64(data)). The class ended up being named SecurityTheatreUtils, to ensure no one else in our team ends up thinking it does any actual encryption...