When coding in an interview context or when presenting code on your Github profile, it’s important to spend some attention on the following:
Basic code styling (Spacing, indentation, braces, etc)
Variable/method naming (prefix and spelling, clear naming)
Object-Oriented Design (encapsulation, scoping, class design, etc)
Be sure to look out for the following things:
Try to make sure all whitespace and indentation is properly formatted and consistent throughout the code. Try using an “auto-indent” within your text editor or IDE for your language.
Avoid any misspelled words in any methods, variables, comments, etc. This demonstrates an attention to detail in your code.
Try to include at least a few comments in your code to explain intent on certain key code blocks.
Make sure to include some reasonable code organization into objects, methods. Avoid long blocks of complicated unorganized code.
There are many great style guides online, you can check a few suggested language-specific ones below:
If you are working in a different language, you can often find them many of these as top results for
“[language] style guide” on Google.