Fake Code Advice
@FakeCodeAdvice
Helpful code advice from software industry professionals. Feel free to ask questions!
You might like
To make conflict resolution and git-blame easier, keep every word on its own line.
people sometimes ask why I write all my code as one giant main() method, that's because calling other methods is a sign of weakness
"title":"Welcome to the Company Store.","message":"WWDC hats are in stock."
while !isUniquelyReferenced(x) { x.release() }
Use Swift's optionals to make *absolutely sure* a variable isn't nil. func confirm(data: String???) -> String { return data!!! }
Avoid the overhead of math libraries by instead converting to negative and positive numbers using a hash table. neg[1] = -1, neg[2] = -2, &c
Prime-numbered lines are bad omens. Skip them.
Productivity tip: Word count of code (excl. comments) / typing speed in WPM / 60 = hours you should've spent on it. Train up to that point.
The secret to easy coding: All your clients really ever want is an Internet Explorer component in a window with their name. IE4 will do fine
The correct warning for when something cannot be undone is "No takebacks." Per UX Guidelines, the only button needed on this warning is "OK"
To be more expressive than cursing in comments, create a function qualifier with the empty macros #define GOD_DAMNIT & #define PIECE_OF_SHIT
When managing memory, always remember the Golden Rule of RAM: Users today have like 2GB. whatever you're doing wrong, they won't notice.
The "var++" syntax offered by some languages introduces a lot of memory overhead. instead, use "var = var + math.cosine(0)"
Save space calling niladic functions by creating a macro which includes the function name, parentheses, and a semicolon.
"PERL" is always written in all-caps. "basic" is always written in lower case. "PyThOn" is just weird.
For arrays, use hashes or dictionaries so that indexes are alphabetical. ary['a'], ary['b'], ary['c'], etc. this avoids number base issues.
Remember, @FakeCodeAdvice accepts questions and requests — we're your best resource for up-to-date information on best practices! Ask away!
Excellent advice that's been lost by time: Put your code every ten lines, so you can add more without screwing up your numbering.
Make logic easy to follow without adding comment bloat by whitespace coding. Indent integers one tab, floats two tabs, strings three tabs...
Normally you write unit tests for user-demanded features, and end users report bugs. Eliminate a step by having your users write unit tests.
United States Trends
- 1. South Carolina 20.3K posts
- 2. Texas A&M 19.3K posts
- 3. Shane Beamer 1,839 posts
- 4. Marcel Reed 3,512 posts
- 5. College Station 2,583 posts
- 6. Northwestern 5,426 posts
- 7. Semaj Morgan N/A
- 8. Underwood 2,873 posts
- 9. Michigan 41.2K posts
- 10. Elko 2,914 posts
- 11. Nyck Harbor 2,307 posts
- 12. Sellers 10.3K posts
- 13. TAMU 6,400 posts
- 14. Sherrone Moore N/A
- 15. Jeremiyah Love 4,013 posts
- 16. #GoBlue 2,602 posts
- 17. Malachi Fields 1,934 posts
- 18. Jordan Marshall N/A
- 19. Navy 29.1K posts
- 20. #GoIrish 3,709 posts
Something went wrong.
Something went wrong.