Question

Title says it all. Can't seem to find what is most common out in the world.

I'm brand new to programming.

If the answer is "it depends", I would love to know what it depends on. Here to learn.

Was it helpful?

Solution

Stick to the convention of the language and the framework - in your case, React.js seems to be follows the Javascript conventions so there is no conflict. camelCase for variables and functions, PascalCase for types(classes), and UPPERCASE_SNAKE_CASE for constants.

OTHER TIPS

It doesn't matter. All that matters is that you make a choice and stick to it.

When you are using a framework, it can be useful to copy its convention to get more consistent code, but when you are using more than one and they follow different conventions, that's futile.

Software engineers, both new and experts, should use all use a software 'beautifying' tool to clean up their code. I like and use Jetbrains - Resharper. Your entire team should use the darned thing, put away their petty software format eccentricities, and get with the program of making their software homogeneous with the team.

The only way to enforce it is to give up your preconceptions of what you think is 'right' and let a machine force the standard on everyone.

This way the code is consistent and nobody complains because someone indented 4 spaces and someone else indented six spaces ...

Licensed under: CC-BY-SA with attribution
scroll top