Code Feedback for Beginners from Google
We set up our spring class for a real challenge. During the very first week of the program they were challenged to build web projects for no-less than one of the biggest companies on the planet, Google. Super scary and challenging, but so rewarding. And damn how impressive the demo was.
Each group got one Google product as a client and got tasked to do their version of that product’s landing page. The results were stunning!
We have gathered some of the feedback Google’s web team gave our students. Remember this is for people who have coded for barely two weeks — great feedback for all beginners.
Five tips on how to write good code for beginners
#1 Pay attention to indentation
Make sure your code has the right indentation. It’s just so much easier to read and to debug.
#2 Readable HTML
You HTML-code should be easy to read. Try and remove your CSS and see of you still can understand what the code is about.
#3 Never duplicate code
Good code is reusable code. Try and write your code so that you don’t have to write the same thing twice. It will make your code easier to follow, and your websites faster.
#4 Alphabetical order inside a CSS selector
A good way of writing code is to put all the CSS that is a selector in alphabetical order.
#5 Put some time in when naming classes
Your code is likely to grow — a lot. Therefore, make sure to use class names that are easy to understand what they are for and not too similar to other classes in your code. That way your code documents itself.