Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is something like this acceptable or is it frowned upon?

String newsSymbol

It just looks strange to me, but it's the best way to describe what the variable is and the data it will hold. I could rename it to something like

String articleSymbol

but then I'd have to rename a whole other bunch of variables.

What are your thoughts? Yay or nay?

share|improve this question

closed as primarily opinion-based by gnat, BЈовић, MichaelT, Dan Pichelman, ChrisF Jul 31 '13 at 9:12

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
It is what it is. If it's a newsSymbol it's a newsSymbol. Who cares. It's better than not duplicating it and having mistakes like 'RAISERROR' which just adds to the confusion. Thanks Sybase. –  CaffGeek Oct 6 '11 at 21:48
    
Just follow your selected Naming Convention. Even if it looks wierd. –  AJC Oct 6 '11 at 22:01
    
I misread this as newSymbol repeatedly until I read it in the monospace font in one of the answers. –  Michael Oct 3 '13 at 18:44
add comment

3 Answers 3

up vote 8 down vote accepted

I'd just go with newsSymbol. (Or, if you prefer, news_symbol. If local conventions prefer that style, of course.) Just remember to read as two words, not one.

But take care to not mulch the letters together! Going to newSymbol would be bad, as that's now read as “new symbol”, with a totally different interpretation.

share|improve this answer
    
Some languages allow true multi-word identifiers (i.e., with spaces in) but I'd advise avoiding them without good reason. The only truly clumsy case is when you've got acronyms and abbreviations in use… –  Donal Fellows Oct 6 '11 at 21:49
add comment

Looks great to me. Assuming the standard for you is camel case for your variable names. The main thing is to use your standard. Another option would be news_symbol.

share|improve this answer
add comment

If you can read it, and it communicates the appropriate information clearly, then we don't care if it "looks weird". :)

share|improve this answer
    
Ah I just wasn't sure if it was "accepted" practice ;) Good to know! –  congalong Oct 6 '11 at 21:47
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.