We've all heard of programming conventions. Every language seems to have it's own take on how you should name something; should you use camelCase or PascalCase for the class name? How about a method? In C# you'd use PascalCase for method names whereas in Python uses lowercase_seperated_by_underscores also known as snake_case.
Naming conventions and indeed all style related conventions in programming are important.
bUt WhY?
- It improves readability.
- It speeds up development.
- Onboarding new team members is faster. <!--kg-card-end: markdown-->
Readability
When scanning through a file it makes it easy to pick out the various members by just looking at how they're named. This shouldn't be underestimated as we read code way more than we write code.
Velocity
Naming a variable, method, field? Having naming conventions mean you don't even have to think about these things. You know what it should look like, you just have to come up with a good name. Good naming is another article in itself!
Onboarding new team members
You're joining a team that uses a new language? Cool, go and see how they name their members and then just follow suit. Obviously, if they're doing something crazy with their naming then you might want to discuss it without blindly following along.
Top comments (0)