views:

113

answers:

7

For the phone number: 234-567-8901, I would name variables like:

areaCode = "234";
exchange = "567";

What would an appropriate variable name be for "8901"?

+3  A: 

It is called the line number.

Byron Whitlock
Good name, but... Yahoo Answers?
deworde
A: 

I think the phone number segments are: area code, exchange, and extension. So, the third would be the extension.

This also has the last four digits referenced as the 'subscriber' number or 'station code'.

kchau
But extension usually means something else... i.e. more numbers after the number answers, such as 234-567-8901 x234
JoelFan
Extension usually refers to an exchange within a phone system, e.g. 555-5555 ext. 55
Nick T
+11  A: 

Wikipedia calls it subscriber number.

JRL
A: 

There is a large Wikipedia article (http://en.wikipedia.org/wiki/Phone%5Fnumber) that gives a lot of history but no clear term for this part of the number. It may, in some cases, be a subscriber number and in some cases an extension.

peter.murray.rust
"Extension" is technically correct but it would likely cause confusion since it has become a term more commonly associated with an intra-phone system extension number (i.e. 555-1212 x123).
Robert Cartaino
A: 

Depends on why you're doing it.

  • If it's just for you, you can call it "mysticdragonnohala", as long as you can remember it.
  • If it's to be memorable within a team project, check with the other developers who'll have to deal with it.
  • If it's client-facing, then check with whoever deals with the client the most.
  • If it's for a uni course, just make sure it makes sense (or funny) and that it's clearly commented.

Personally I'd go for "line". But "personal", "specific", "individual" "final" and "local" would all make sense.

deworde
A: 

I've always heard it referred to as the "suffix".

Joe Koberg
+4  A: 

Unless the software is to be used inside a telecommunications company (who would know the correct term), I would go for readability over technical correctness.

Since there is no consensus on the exact term or at least a commonly used name, I would choose something like "fourDigits" over a technically correct term "line number", "extension", "suffix", or "Subscriber line number (SLN)."

Robert Cartaino