Are Coding Standards Good for Beginners?

10 Feb 2022

Coding standards can be very useful once you get used to them, especially when combined with code inspections to alert you to issues while you are programming. While this is great for someone with programming experience, what about beginners?

A Novice Programmer

I do not think that a novice programmer should be using a coding standard. While code inspections can inform you about syntax errors before runtime, it adds a level of complexity that can be overwhelming if you are just starting out. Imagine having just learned what an if statement is, and then having code inspections complain about not having a space between the “if” keyword and the condition. What are the chances that you would even understand what it was even complaining about?

This is not to say that I think novice programmers get a free pass when it comes to formatting their code, I just don’t think they should be thrown into the deep end and be expected to have every keystroke scrutinized at such an early stage. When I am helping new programmers debug their code, I often see a lack of indentation, to which I tell them to go back and properly indent it before I take a look since it helps to visually see different code blocks when trying to understand what the code is doing. I consider this a gentle nudge in the right direction; with a little explanation behind the request to indenting their code, they usually stick with it moving forward. Anything beyond this might be too much.

Learning a New Language

The story is a little different for someone who already has programming experience. Since every programming language has its own formatting requirements, a tool that tells you when you are making a mistake can help you avoid silly runtime errors. A coding standard, in this case, can aid your learning, rather than hinder it. For example, Python is fairly picky about indentation; it is very useful to have code inspections alert you to issues with your formatting.

The Bottom Line

You need to walk before you can run, likewise, you need to learn to program before you should use coding standards.