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.

Looking at some camera metadata on Windows File Properties there are (along with a few more) two Properties named Focal length and 35mm focal length.

I'm developing software that will make use of these two Properties. So far I have created a Property named FocalLength for the first, but I cannot seem to find a proper name for the other one.

I have thought of _35MmFocalLength or ThirtyFiveMmFocalLength, but I think there might be a better suggestion.

Any ideas?

EDIT:

Downvoters PLEASE state your reasons, it's no use downvoting if not helping me learn something.

share|improve this question
1  
I have thought of asking on stackoverflow, but it really looks like a general programming question about naming standards and numbers. C# tag is used to provide some context. –  Souvlaki May 22 '13 at 12:48
add comment

2 Answers

up vote 3 down vote accepted

Well, (in my opinion) you're tripping over two basic programming naming conventions:

  1. You shouldn't start variable names with numbers, and my opinion on this is that variable names shouldn't have numbers at all.
  2. The _variable name should be reserved for private variables.

There are many many, MANY standards. If you're using Visual Studio you should consider using the StyleCop Addon. It will keep you straight for code quality and conventions.

As for the name of your variable, I suggest FocalLengthThirtyFiveMilimeter

I don't like using abberviations in my variable names but that's personal.

share|improve this answer
3  
Downvotes please explain why. –  Kenneth Garza May 22 '13 at 12:39
    
Yes, I also use _ for private variables, but it was the only way to use "35" in the variable as far as I could look into it. I'm not a native English speaker so your suggestion did not cross my mind at all, but I'll keep it in mind because it seems to solve many naming problems I usually come across. Also thanks for the add-on suggestion. –  Souvlaki May 22 '13 at 12:44
2  
How about FocalLengthThirtyFiveMillimeter? (typo) –  Dan Pichelman May 22 '13 at 12:54
    
I am constantly baffled why in programming we insist on noun first, adjective/descriptor second when you would never say things this way in english... In english you would refer to your thirty five millimeter focal length, but programers constantly demand it be focal length thirty five milimeter.. I didn't down vote, this is just a petty annoyance heh –  Jimmy Hoffa May 22 '13 at 16:51
2  
@Jimmy:By using FocalLength, FocalLength35mm...FocalLength19mm the names are grouped, especially nice in intellisense. Whereas, FocalLength, ThirtyFivemmFocalLenght, NineteenmmFocalLength then names are scattered all over and it is more effort to find what you want or your options. –  Dunk May 22 '13 at 21:38
show 3 more comments

Following two suggestions:

  • Swap names and use FocalLength35Millimeter (Note of not using the abbreviation, to allow better readability)
  • Be more techy and use EquivalentTo35MmFocalLenght
share|improve this answer
    
Thanks for the nice suggestions, but the other answer was a bit faster and had something extra to look into. –  Souvlaki May 22 '13 at 12:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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