1

The tag points .
Why is this so?

It's definitively wrong to say both are equivalent!

There are some programming languages that don't care about that difference or that offer a multi-dimensional indexing/slicing syntax, but internally the work just on one-dimensional array. But there are a lot of languages that care about proper data representation description.

The representation in memory and thus the physical addressing is completely different if you have a multi-dimensional array or an array nested in another array. Even in the programming language, you are using multiple indices in one access for multi-dimensional arrays e.g. myArray(row, column) compared to indexing nested arrays: myArray(row)(column).

10
  • 12
    You need to come up with a better argument why nested-array is not a synonym of multidimensional-array
    – KarelG
    Commented Sep 29, 2017 at 8:51
  • 1
    No, the representation in memory and thus the physical addressing is completely different if you have a multi-dimensional array or an array nested in another array. Even in the programming language, you are using multiple indices in one access for multi-dimensional arrays e.g. myArray(row, column) compared to indexing nested arrays: myArray(row)(column).
    – Paebbels
    Commented Sep 29, 2017 at 9:49
  • 5
    That sounds like an implementation detail of a language/compiler, and not something a lot of people would be aware of. In the scenario where we undo the tag synonym, don't you think it's likely that people will use the incorrect tag?
    – user247702
    Commented Sep 29, 2017 at 9:53
  • Yes it's a details, but a detail that every programmer should know about otherwise he has not understood was simple arrays and nested arrays are... I admin, I like programming languages and I work in a committee to develop new ideas in a hardware description language.
    – Paebbels
    Commented Sep 29, 2017 at 11:52
  • 3
    @Stijn The reason it is not an implementation detail is because a nested array allows for the creation of a jagged array, while a multidimensional array is always regular in the size of every sub-array for a particular dimension.
    – NetMage
    Commented Sep 29, 2017 at 18:29
  • @NetMage I feel a bit embarrassed now for not realising that :)
    – user247702
    Commented Sep 29, 2017 at 18:42
  • 3
    IMHO most people use nested and multi-dimensional interchangeably so we should keep it. If you want to talk about an array containing arrays of different sizes then we have jagged_array. Commented Sep 29, 2017 at 19:17
  • @NathanOliver What do we have for an array containing arrays of the same size that is not multidimensional?
    – NetMage
    Commented Sep 29, 2017 at 19:34
  • 2
    To me that is the same thing as a multidimensional array Commented Sep 29, 2017 at 19:37
  • 1
    @NathanOliver This discussion should not be about "for me" or "most people" is a simple technical decision and not about how people misuse the words in their mind just because is written wrongly in books or on websites ...
    – Paebbels
    Commented Sep 30, 2017 at 5:42

1 Answer 1

3

As you have pointed out, many languages simply don't make the distinction between jagged arrays and multidimensional arrays at all. PHP in particular has the audacity to call the following a "multidimensional array" just because it contains at least one array, because it calls any ordered collections of items "arrays":

$multidimensionalArray = [
    'a' => 'foo',
    'b' => [1, 2]
];

So the real problem here is that the term "multidimensional array" itself is overloaded — languages can't even agree on what constitutes an array, let alone a multidimensional one, but when it comes to nesting them the vast majority of languages seem to prefer calling them "multidimensional" over "nested" or "jagged" (probably because it sounds cooler). I don't think there is much Stack Overflow can do to solve this problem. The best we can do is accommodate it as much as we can within our tagging system. To wit: the reason points to is because we don't need two separate tags about the same, overloaded, term; if a user is working with "nested arrays", many languages are happy to call them "multidimensional arrays", regardless of what the user actually means.

And as far as most folks are concerned, a single-dimensional array whose elements are all arrays that can be relied on to always be equal in size is indistinguishable from a multidimensional array, regardless of implementation details.

If the distinction is important, for example in languages like C# that have separate notations for jagged arrays and multidimensional arrays:

int[][] jaggedArray;
int[,] multidimensionalArray;

... there's always the tag, I guess. Most people who even know the term "jagged array" probably understand the distinction between the two and can therefore use that knowledge to, say, retag mistagged questions.

And now I'm really bothered by the fact that is singular while and are plural but I can't do anything about it thanks to certain restrictions by the tag synonym system.

4
  • Languages like Ada and VHDL (and I'm a VHDL user and language designer ...) even distinguish between, single-dimension, multi-dimension and jagged arrays (which is also known as ragged array, but has no synonym! -> almost equal google hits 400k to 500k).
    – Paebbels
    Commented Sep 30, 2017 at 5:48
  • Sure you can do something about it. You can rename the tag.
    – Cody Gray Mod
    Commented Sep 30, 2017 at 10:47
  • @Cody Gray: I'm a little wary of renaming a tag that's attached to so many questions just to make a trivial pluralization change, but it's technically doable, I guess. I should have said "I'm a little hesitant to do something about it."
    – BoltClock Mod
    Commented Sep 30, 2017 at 11:03
  • Oh. I've done it at least once. I'm not afraid to push buttons. Nothing broke, as far as I can tell. Heh.
    – Cody Gray Mod
    Commented Sep 30, 2017 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .