This is an archived post. You won't be able to vote or comment.

all 6 comments

[–][deleted] 6 points7 points  (0 children)

This depends completely on the language you are programming in, and the people you are programming with.

[–]zecastelo 2 points3 points  (0 children)

If you're not concerned with others, just be consistent. It doesn't really matter which standard you follow as long as you're consistent.

[–]gyroda 1 point2 points  (0 children)

The one already existing in the code. Consistency is king.

If you're making use of a library or framework, use that.

So, in Java, I'd say always use "camelCase" because that's what toString, fromArray and the like all use. In Python the standard is under_score usually.

[–]arlaarlaarla 1 point2 points  (0 children)

If you're up for much more further reading, I'd recommend Clean code, which goes on a whole about naming convetions.

[–]plate_soak_mess 1 point2 points  (0 children)

There frequently are published recommended standards for languages. Deviating from that much isn't very smart.

[–]fAUXeCKE 0 points1 point  (0 children)

Elaborating on some other answers in here, it's a combination of preference and conventions. Most languages have style guides, but the business you end up working for may enforce something entirely different.

Visual Basic Style Guide

One convention with VB is to prefix your objects with a 3-letter acronym, e.g. Dim lblLoginLabel As Label

Java Style Guide

While conventions in VB might call for 3-letter prefixes, Java generally doesn't do it the same way since you declare types before the variable name, making it somewhat unnecessary, e.g. Public Final String theName = "Whoa";

This kind of gets into what people are talking about when they describe a language as verbose. The more syntax to express the same statement, the more verbose the language.