Coding requires constant learning. Here are some ideas to help with that:
1 - Be prepared to spend not just time, but mental energy.
2 - Find ways to get input:
- Other Opinions:
- Code Reviews - both having people look at your code, and looking at other's code.
- Read blogs
- Read articles
- Read the documentation. If you're using a collection, read the documentation to see how it suggests enumerating through or referencing it's items.
- Experiment on your own code
- Reflect back on your code
- Ask yourself, "does this make sense?". If your own code doesn't make sense to you, it probably won't make sense to others.
- Make sure that you're not re-inventing the wheel. Look for resuable components.
3 - Make the intent of your code clear so that others can help. If Bob doesn't know what you're trying to do, Bob can't easily help you.
- Use smaller methods
- Add helpful comments that explain intent, not just repeat the steps that the code is doing
- Abstract out context and dependencies such that it's easier for people to understand what you really want.
There's obviously a lot more to say on this, I'll make some follow-up posts.