0

I'm trying to choose a name for a variable in my program that includes some number tandem. What is the difference between string and field in this case? For example, which one is better: "field of numbers" or "string of numbers"?

RegDwigнt
  • 97,231
  • 2
    What is the context? What are you trying to say? Neither of these is a common expression in ordinary English, and in mathematics and physics they are very different concepts. – Peter Shor Nov 16 '13 at 07:43
  • 3
    This question appears to be off-topic because it is about variable naming. – Jim Nov 16 '13 at 08:06
  • @Jim: Approximately you are right. But I needed my answer to have a good choose for my work. – Hoseyn Heydari Nov 16 '13 at 11:44
  • 3
    string is a 1-dimensional metaphor. field is a two-dimensional metaphor. Mathematically, field can be expanded to more than two dimensions, so it's a container metaphor, whereas string is linear no matter how you approach it. – John Lawler Nov 16 '13 at 15:00
  • @PeterShor Approximately you are right. I can change it to format of problems like [http://english.stackexchange.com/questions/125/when-should-into-be-used-rather-than-in-to-and-vice-versa]. Is it a right work. – Hoseyn Heydari Nov 16 '13 at 15:16

2 Answers2

2

string is a rope, field is a carpet

field contains string, but string doesn't contain field. like knitting, or typing a text, as soon as you use the return key, you start building up a field made out of a string. the field is a 2-dimensional organisation of a string. type a string of letters, or numbers, into a field.

0

I think it is likely to depend on context. From a scientific or computing viewpoint (given that you have asked about numbers), there is a difference.

Field is likely to define an area or container in which particular items may be found. A database or spreadsheet may contain a field which may only contain types of data (such as numbers, text, dates etc.) Graphical data may define one of its axes as a field.

String would represent a collection of similar or related items. In computing, a string represents a linear sequence of characters, numbers or other data.

So, you can have both a field of numbers and a string of numbers. What's more, a field of numbers is likely to contain a string of numbers! However, if you are asking about general phrase usage, I'd be likely to suggest a string of numbers.

long
  • 2,211