This discussion is funny.
The problem isnât with sorting. The problem is with the data structure. If you want a hierarchy use one. Make a tree and sort the levels of the tree.
Take this shopping list for an example:
Wheat bread
White Bread
White Milk
Chocolate Milk
Itâs a list. If i sort the list iâll get:
Chocolate milk
Wheat Bread
White Bread
White Milk
Whaaah /cry the user says 'cause milk is seperated and not sorted propery!
Whaaah /cry the developer says âget used to itâ this is the way computers have worked since the iron age.
the problem isnt the sort, the problem is the list. What we want is a Tree:
Bread:
Wheat
White
Milk:
Chocolate
White
Then when we sort we sort each level of the tree.
When you sort the strings:
dumbuser10
dumbuser2
dumbdeveloper10
dumbdeveloper2
If you expect the result:
dumbdeveloper2
dumbdeveloper10
dumbuser2
dumbuser10
Then you are expecting the tree:
levels of the tree.
Take this shopping list for an example:
Wheat bread
White Bread
White Milk
Chocolate Milk
Itâs a list. If i sort the list iâll get:
Chocolate milk
Wheat Bread
White Bread
White Milk
Whaaah /cry the user says 'cause milk is seperated and not sorted propery!
Whaaah /cry the developer says âget used to itâ this is the way computers have worked since the iron age.
the problem isnt the sort, the problem is the list. What we want is a Tree:
Bread:
Wheat
White
Milk:
Chocolate
White
Then when we sort we sort each level of the tree.
When you sort the strings:
dumbuser10
dumbuser2
dumbdeveloper15
dumbdeveloper3
smartdeveloper1
If you expect the result:
dumbdeveloper3
dumbdeveloper15
dumbuser2
dumbuser10
smartdeveloper1
You are expecting a tree:
dumb:
developer:
3
15
user:
2
10
smart:
developer:
1
So fricken use a tree user and developer alike.