Re:Thirteen Years of Bad Game Code
by zelos on Friday March 31, 2017 @03:13AM
(#14001752)
I learned that about 4 years ago. I wish someone had told me when I was first starting out as a developer.
[ Parent
| on HN ]
Re:Thirteen Years of Bad Game Code
by sillysaurus3 on Friday March 31, 2017 @03:40AM
(#14001840)
But it also means that what you're writing right now isn't that bad.
If you accept that your best is your best, then your best is good enough. The effort is what matters.
Re:Thirteen Years of Bad Game Code
by wingerlang on Friday March 31, 2017 @03:51AM
(#14001879)
> your best is good enough. The effort is what matters.
Not necessarily true, if you're (trying to be) a professional then it might not be enough.
Judging by some of the 'professional' code I've read over the years, I'd say that's not a particularly high bar...! At least if you're horrified by code you wrote, it shows you care, and that shows some promise :)
I concur. Especially if you define "professional" as "stuff people do at work, for money", the kind of code I saw in my career... well, it wasn't that much different from the code I was writing when I was 13.
Best one liner I've ever seen in "professional" code:
String myBoolean = "yes"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...