Re:MIT claims to have found a “language universal” that ties...
by AnimalMuppet on Thursday August 06, 2015 @03:23PM
(#10018743)
I agree that you don't (shouldn't!) have the redundancy in computer languages. But I think the point of the article is that some word orderings cause less load on our brains. I think that's directly applicable to function parameters. For example, if I have a function that takes an array, a starting offset, an ending offset, and a value to search for within those offsets, then
int limitedSearch(int *array, int startOffset, int endOffset, int searchValue)
causes less cognitive load than
int limitedSearch(int *array, int searchValue, int startOffset, int endOffset)
simply because the offsets "go with" the array to make up one concept (where you're searching).
There may be other reasons why some parameter orderings are better than others, but I think the article is directly relevant.
There may be other reasons why some parameter orderings are better than others, but I think the article is directly relevant.