I've been noticing in some posts from other college students that identifiers and, at times, indecipherable to me (another
Java Beginner). My textbook and the three Java for Dummies books I own
indicate that identifiers should be meaningful. Obviously, the experienced people here on Java Ranch understand the identifiers, because their understanding of Java is far greater than mine. It's similar to be able to untangle someone's typos (in English-language posts) when you are fluent in English.
Anyway, my question is this. (Yes, I know you were wondering when I would get around to it.) In the Real World of Programming for a Living, what are the guidelines for creating and/or using meaningful identifiers? For example, I've worked in Retail, therefore I know that stock isn't something you buy through a broker as an investment; it is synonamous with inventory. Also, Cost is the same as Price but both are ambiguous, as you can have wholesale, retail, or sales prices/costs.
I created identifiers like retail, salesPrice, unitCost, and inStock because of my past experience. However, my instructor gave examples of code with identifiers like cost. Now, I don't want to waste my time nitpicking something that is a waste of time. I really just want to understand.
Any advice, suggestions, or other pearls of wisdom (as I do not count as swine, these are safe to dispense )?