5 Good Habits That Will Make You a Better Coder
1. Focus on One Type of Language at a Time
If you are designing and developing for the web, there are often numerous different languages that you will need to familiarize yourself with, and it can be tempting to try to learn them all at once, especially considering how interconnected they all are.
I suppose that, to some degree, this is inevitable. But if you really want to improve quickly, I recommend focusing on one particular area of expertise. Do you want to get better at using CSS? Put your focus on that. Try using a single HMTL document and creating various layouts using nothing but styles. The CSS Zen Garden is a great example of how incredibly different your web page can become for the same markup. You can also focus your efforts by finding a list of elements and working through them. For instance, if you are comfortable with CSS2, but want to improve your understanding of what is possible with CSS3, you could study CSS3 properties and start working through them one by one. You can read the current CSS3 specifications. You can experiment with each module to see what it can (and cannot) do on what browsers.
You could use a similar approach to scripting languages like JavaScript and PHP, though trying to work through all of their functions methodically might be a little tedious. Another option would be to work through a number of tutorials specifically on these languages, preferably in the specific area that you work in the most.
Do you need to become better at WordPress development? There is a ton of tutorials about that. Want to learn more about server-side image manipulation? There are tutorials for that too. Find them, bookmark them, and work through them — just don't do it while you are also going through tutorials about CSS, HTML5, or any other web language so that you're not spreading yourself too thinly.
Pick one and stick to it until you master it, then move on to the next.
2. Write Your Logic through Comments
When it comes to coding, there are many tenets and ideas I stand by. One of this is that code is 95% logic. Another is that logic doesn't change when translated from human language into a programming language.
What this means is that if you can write it in code, you can write it in a spoken language like English or French.
For example, suppose that I wanted to write a function that would either lock or unlock something based on the time of day (for what reason, I'm not sure). Instead of just jumping into coding the function, I could step back and write the logic in plain English as comments.
Read full article from 5 Good Habits That Will Make You a Better Coder
No comments:
Post a Comment