| I don't know if this list is useful for "learning to code", but I have been at this for the past 20 years and I'm still learning to code! These are my own silent confessions. YMMV. 1. Condition yourself to be sharply aware and mindful whenever you're "copying and pasting". It's a big code smell. Stop, think and ask if you can refactor sensibly into reusable functions, views, models etc. 2. Be ruthless with naming conventions. If a table, function, API name doesn't sound like what it is supposed to be doing or used for, change it before it's too late. You'll be very sorry if you let this type of procrastination pass as it will confuse you later or worse may have cascading effect on poor naming conventions because one object was named incorrectly at the start. 3. If you find your own code difficult to enhance and modify the next time you visit it, spend the time immediately to refactor. Next time it's easier to continue. Avoiding this will result in two things: 3.1 You'll subconsciously develop a strong aversion to visiting the piece of code again (often resulting in all sorts of compensating hacks. Unhealthy holy cows can emerge.) 3.2 You'll doom your successor for sure. 4. Don't write programs with no runtime configuration capabilities. 5. Don't write programs with more than 2 runtime configuration options. If your program needs more than 2, ship - then add as enhancement. 6. Condition yourself to always think of loading resources as late as possible and release as early as possible. Make this an OCD type of habit. It pays off. 7. Finally, don't be intimidated by the experts in the field. Don't ever strive to be better than or compare yourself competitively with anyone else. The experience is for yourself. Your programs are your own works, and your curiosity, creativity and insight should drive your passion to improve daily. (The last point applies to bodybuilding to, I suppose.) |
That 10 times over.