396
codeStyle (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] RustyNova@lemmy.world 36 points 2 years ago

Classes often have camelCase or PascalCase. Snake cases often are for variables or functions.

I don't remember the java standards, but it's enough to get it

[-] marcos@lemmy.world 9 points 2 years ago

The Java standard is ClassName, variableName, FINAL_VALUE_NAME.

It's derived from a popular C++ standard. (But C++ has many for you to pick.)

Python is the one that likes snake_case, but it's for variables, as you said. Classes are still PascalCase.

[-] RustyNova@lemmy.world 2 points 2 years ago

Rust is like Python, but actually tell you the rules instead of you doing whatever you want

[-] bassomitron@lemmy.world 6 points 2 years ago* (last edited 2 years ago)

In college and workplace, all java projects I ever worked with used camelCase. Whether that's the official stance of Java or not, I don't recall.

[-] BautAufWasEuchAufbaut 8 points 2 years ago* (last edited 2 years ago)

But also classes? In Java, I normally see camelcase (objects, variables, functions, ...) except for class definitions, which are PascalCase.
The package itself often is snakecase though iirc?

[-] ObsidianNebula@sh.itjust.works 2 points 2 years ago

That's exactly how I was taught Java styling in college. Idk if it was official styling or just professor preference though.

[-] CosmicCleric@lemmy.world 3 points 2 years ago

When you're telling a joke to a bunch of computer programmer nerds, you got to tell them what programming language the joke is in, or else it just falls flat.

[-] RustyNova@lemmy.world 1 points 2 years ago

Always type the name of the language after opening your joke block. If your language is known enough, you may have syntax highlighting as well!

this post was submitted on 01 Mar 2024
396 points (100.0% liked)

Programmer Humor

38576 readers
401 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS