In lieu of a speaker last month, a group of us gathered wrote down some pieces of code-writing advice. Some of them were purely a New Year's Resolutions, as they're something we intend to stick with, and some other items were more like recommendations to a younger version of yourself. And some are things we keep telling ourselves but just can't hear enough!
- Avoid side effects and unrelated actions
- Keep the logic close in lines of code (so you don't have to go down the rabbit hole)
- Stay focused on the task at hand
- Leave good comments
- Leave good in-line documentation
- Write good commit messages! Links to a bug, or explains what's really happening in the change.
- UI bugs are a big deal! If they bother you, they'll bother your users.
- Follow the system that works for you. Maybe it's paper!
- Don't be afraid to test a change, no matter how trivial it seems.
- You're a pro: use Dash or a powerful document browser
- Subscribe to helpful dev mailing lists (digests like iOS Weekly)
- Spend 1 hour a week learning something
- Take time AFK for non-code work
- Take notes for yourself and leave breadcrumbs ("Left off on <technical error>")
- Clean up prototypes and keep them for later!
- Try not to hate Swift
- Keep your timesheet better: improve bookkeeping
- Avoid ill-defined projects
- DocumentĀ why you're doing something and why not something else
- Remember: the best place for documentation is in the code
- Automate UI Testing!
- Don't forget your quarterly estimated taxes š
- Learn back-end best practices (logging, microservices, unit tests)
- Test-driven development
- Try out different frameworks and look for other solutions
- Finish a side project
- Keep editing your coding standards / pull request guidelines
- Maybe the dice *are* loaded! (SceneKit life lesson: don't use die with divots.)
Also, we had a spirited conversation about obscure code involving John Carmack's algorithm for calculating the square root of a float in Quake 3. It's here if you're curious!