I've been writing software professionally now for about a decade, but I feel like I've never learned how to do it 'properly'.
For example, I've never experienced agile methodology, never used unit testing on my code, and only just recently started using source control tools.
What are the current best practices I should consider following? And conversely, what worst practices and non-best practices should I avoid?
My projects have delivered just fine and my clients and employers have been happy with the work I've done, but I feel like I'm missing important techniques. I've mostly worked solo rather than on a team of developers so that might be a contributing factor.
Good unit tests are absolutely crucial to any kind of future refactoring effort. They are helpful at finding regressions and give you some confidence that you do not break the paths that are tested. If you work in a team larger than one, code reviews are a must. Code reviews allow both participating parties the opportunity to learn, improve the overall codebase, and catch bugs. I also think writing code comments and documentation is absolutely important. Mostly so the "next guy" understands why the code is doing what it is doing. Most of the time the "next guy" ends up being you.