4
freekid
4y

Java variables be like: UsersXwifesDogHandlersFirstName

Comments
  • 2
    This is how it's being told to us students.
  • 7
    Eurgh, that's awful.

    Variable names should always start with lower case.
  • 0
    @AlmondSauce what if it's a global class?
  • 5
    @melezorus34 What is a "global class"?
  • 0
    @Makenshi @lmgtfy Global Classes on Java
  • 0
  • 2
    @melezorus34 what's a global class? Not a thing in java judging by how you called it
  • 1
    @netikras guessing public static or something like that.
  • 2
    @ArcaneEye IDK man... He MAY have meant constants (in that case they would be CAPITAL_SNAKE_CASE names), but he said "classes".. so I'm confused :/
  • 1
    @AlmondSauce except for constants :) which are technically fields, not variables, so you're prolly right
  • 1
    @netikras I knew there might be someone who nit-picked over constants, so you get the prize ;-)

    I've still no idea what this "global class" variable name thing is though 😂
  • 3
    @melezorus34 There are no global classes in Java. You can only change the visibility of them.

    So don't "lmgtfy" me, thank you very much. :)
  • 0
    Lolz, just try to avoid creating more than 2 globals per file/library

    Cuz if you don't start uppercase with a import name, what's wrong with you? (Probs noting)
  • 0
    you mean "shitty devs naming java variables like:"

    I've never ever named a variable anything over maybe 15 chars.

    I also met very few devs that did anything near that.
  • 0
    If something like this happens it's usually because the dev doesn't understand proper design or patterns and calls his variables like:
    personalHomeAddress

    seems legit but its stupid if the design is ok.
    you'll end up with:
    x.personal.personalHome.PersonalHomeAddress
    instead of x.personal.home.address

    NOT AT ALL Java specific.. just a thing people dont get when starting oop.
  • 1
    Meanwhile in Dart variables
    ___thisIsAVariableWithALineAtStart
  • 0
    There's actually an abstract class in Spring called AbstractSingletonProxyFactoryBean
Add Comment