Why 10 is placed after 1 and not after 9. Folder naming quickload menu

gamaliwa Member Posts: 20 Newcomer

Hello, it's me again with the "quickload" saga questions, anyone have an idea how it's like that ? On purpose feature?

Best Answer

  • EvilDragon
    EvilDragon Moderator Posts: 947 mod
    Answer ✓

    The answer is "because natural sorting for lists was never implemented in Kontakt". I have no info on if this will change or when.



  • Sunborn
    Sunborn Member Posts: 1,187 Expert

    That is a common nonsense, not only on many programs and applications but in Windows too! (maybe on MAC too, i don't know...)

    The only way to avoid this nonsense is to use 0 before the first 9 numbers:

    01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11 etc. etc.

  • Kubrak
    Kubrak Member Posts: 2,461 Expert

    It is not nonsence, it is correct order for string of 'signs'.... 10 is not mathematical ten, it is sign 1 followed by sign 0. 1 is not mathematical one, it is sign 1.

  • gamaliwa
    gamaliwa Member Posts: 20 Newcomer

    So you are telling me we have artificial intelligence in 2023 but we can’t figure out a way of having 10 after 9?

    IT IS nonsence in the sens that user experience is making the machine adapt to us and no the opposite

    And btw windows folders don’t behave like that. The quick load folder in windows explorer shows 10 after 9

  • Kubrak
    Kubrak Member Posts: 2,461 Expert

    Win folders used to behave like that... But you are right, that now they get sorted in wrong way. ;-) 10 should be before 9, not after.

    If one want it sorted numerical way, the best is to use 0, or 00, 000, .... prefix.

  • gamaliwa
    gamaliwa Member Posts: 20 Newcomer
    edited June 20

    yep I started using 001 etc.

    when you say 10 should be before 9.. it’s because there are stubborn soft devs that we end up with softwares that have terrible user experience sometimes.. just saying. But sure you are « fundamentally » right, if that’s the end goal

  • JesterMgee
    JesterMgee Member Posts: 2,129 Expert

    Like what @Kubrak said, it is the logic in how code parses strings.

    It is simply basic programming and the fact it is reading a STRING not an integer since data has to be held as a "type". In other words, it is looking at the binary value given to a character followed by the next character and not the number as a whole since it is not a number. it is actually the opposite of "nonsense" and perfectly logical when understood, hence why we refer to operations in code as "logic"...

    If one cares to know why...

    Usually most code will have functions that can correct this problem to appease humans (because we are a sensitive and not always logical bunch) BUT there may be cases where you do not want to correct this ordering because of other potential issues, often there is rather complex regex used to order things correctly when you have differing alphanumeric cases and want to have things appear in a more expected way.

    In the above example, the names are strings and NOT numbers so code will look at the order of characters and order accordingly based on their position in the ASCII table:

    _9999 ABC

    01 ABC

    1 ABC

    10 ABC

    1000 ABC

    11 ABC

    1111 ABC

    1122 ABC

    12 ABC

    2 ABC

    9 ABC


    Special characters come before numbers which come before letters so this is how things will be ordered. To humans, this looks like an incorrect mess but to programmers and code, this is perfectly logical and the fix is simply to proceed numbers with 0 to reorder.

    In code to correct this, numbers will be read as a combined string and elevated higher than characters so if the following character is a number, concatenate this to the first character and check if the next value is a number, if so repeat.

    Where this gets complicated is when you want to order things Correctly by Decimal, Hexadecimal and string values since 1A is larger in value than 12.

  • Sunborn
    Sunborn Member Posts: 1,187 Expert
    edited June 21

    Sorry, but those are "western mathematics", in the same way you have the, totally strange and illogical habit when you writing dates, to put the month before (!!!) the day (Which for us, here in the Mediterranean is totally incomprehensible, by the way)! ^_^

    The people who actually invented mathematics, the Babylonians, the Greeks, the Egyptians, the Mayans, and later the Arabs, used the natural order (0,1,2,3,4,5,6,7,8,9 etc) that we still use on our education system (at least in Greece).

    The 00+ system is learned only on a higher level of education, has absolutely no practical value in everyday life, and the only reason that we are even talking about it, it is because it is used in the computer language.

    About Windows, the folders, indeed they don't do it any more, but, almost everything else it does. Just try for example to auto-create a numerical list on Notepad or elsewhere. Or your music compilations who have more than 10 tracks and you numbered them, as 1 - artist - title, instead of 01 - artist - title. And numerous more cases! There, the 10 is always before 2, the 20 to 29 is always before 3, the 30 to 39 is always before 4 etc. etc. which is might be correct on some form of Mathematics but in real life it is totally insane, annoying, even frustrating some times! So to avoid all this nonsense, i had to learn to always put a 0 before the nine main numbers (1-9).

    To see how frustrating is that nonsense system just try to create automatically a list between 0Hz and 5000 Hz, in decimal numbers and... good luck with that :-p

    0 Hz

    0.01 Hz

    0.02 Hz

    0.03 Hz

    0.04 Hz

    0.05 Hz

    0.06 Hz

    0.07 Hz

    0.08 Hz

    0.09 Hz

    0.10 Hz

    0.11 Hz

    0.12 Hz

    0.13 Hz

    0.14 Hz

    0.15 Hz

    0.16 Hz

    0.17 Hz

    0.18 Hz

    0.19 Hz

    0.20 Hz

    0.21 Hz

    0.22 Hz

    0.23 Hz

    0.24 Hz

    0.25 Hz

    0.26 Hz

    0.27 Hz

    0.28 Hz

    0.29 Hz

    0.30 Hz

    0.31 Hz

    0.32 Hz

    0.33 Hz

    0.34 Hz

    0.35 Hz

    0.36 Hz

    0.37 Hz

    0.38 Hz

    0.39 Hz

    0.40 Hz

    0.41 Hz

    0.42 Hz

    0.43 Hz

    0.44 Hz

    0.45 Hz

    0.46 Hz

    0.47 Hz

    0.48 Hz

    0.49 Hz

    0.50 Hz

    0.51 Hz

    0.52 Hz

    0.53 Hz

    0.54 Hz

    0.55 Hz

    0.56 Hz

    0.57 Hz

    0.58 Hz

    0.59 Hz

    0.60 Hz

    0.61 Hz

    0.62 Hz

    0.63 Hz

    0.64 Hz

    0.65 Hz

    0.66 Hz

    0.67 Hz

    0.68 Hz

    0.69 Hz

    0.70 Hz

    0.71 Hz

    0.72 Hz

    0.73 Hz

    0.74 Hz

    0.75 Hz

    0.76 Hz

    0.77 Hz

    0.78 Hz

    0.79 Hz

    0.80 Hz

    0.81 Hz

    0.82 Hz

    0.83 Hz

    0.84 Hz

    0.85 Hz

    0.86 Hz

    0.87 Hz

    0.88 Hz

    0.89 Hz

    0.90 Hz

    0.91 Hz

    0.92 Hz

    0.93 Hz

    0.94 Hz

    0.95 Hz

    0.96 Hz

    0.97 Hz

    0.98 Hz

    0.99 Hz

    1.00 Hz

    ...and all the way up to 5000 Hz! Unless you have the patience of a monk, i guarantee you that after 2 hours of trying to put things in a logical order, you will throw your laptop from your window!

  • Paul B
    Paul B Member Posts: 41 Helper
    edited June 21

    While the explanations of why it is logical to sort the way shown in the OP are valid, they miss the point.

    Mac Finder sorts folder names that begin with string representations of numbers as though they begin with numbers.

    This is because there are two possible logical contexts. One is computer logic, where they are strings and should be sorted as strings. The other is human logic, where they begin with numbers and should be sorted as such.

    Which sorting to apply is dependent on which logic should apply. In a case like this, human logic should apply – the GUI part of software is written for people, not computers. As a software developer I understand this, and would sort numerically (with additional string sorting for any that begin with identical numbers).

    Some people may see this as adding unnecessary complexity and potentially introducing problems elsewhere in the software because something somewhere might expect the data sorted as strings. But it's not complex at all. In terms of level of complexity in software development, it is one of the simplest things to apply number based sorting for graphical representations and string sorting for non-humans.

    So yes, the user can enforce human-focused ordering by prepending a 0. This is so ingrained in me from years of Windows doing it wrong (using string sorting) and having tracks in my music collection incorrectly ordered if I did not, that I do it by habit. But this doesn't mean the software is doing the right thing. Software intended for human use should consider the needs of the human user and take all reasonable steps to meet those needs.

  • EvilDragon
    EvilDragon Moderator Posts: 947 mod
    Answer ✓

    The answer is "because natural sorting for lists was never implemented in Kontakt". I have no info on if this will change or when.

  • Kubrak
    Kubrak Member Posts: 2,461 Expert

    OK, what sorting order should have:



    1.development Ltd, 2U, 11, 1, 25, 9, Song1, Song11, Song9

    or what about

    1, II, VIII, 6, 9, 11, ...

    and what about Indians, Chinese, ... and their numbers?

    Simply, there are many 'sound' ways to order text strings. Because of many reasons, the text approach without understanding meaning of the text is used. It is technically the most effective and least ambiguous... Imagime one needs to sort hundred millions of strings....

  • Kubrak
    Kubrak Member Posts: 2,461 Expert


    those are "western mathematics", in the same way you have the, totally strange and illogical habit when you writing dates, to put the month before (!!!) the day

    It is not western, just anglosaxon... It is used just in english speaking countries. And maybe even not all. I agree, it is rather strange to use such a ordering. But they have much more pecularities, like imperial measures and weights, driving on left and so on.

    By the way, one satelite has smashed to Mars surface few years ago, because SW has been developed by two groups one working with metric system and the other imperial.... And they forgot to make conversion when data were exchanged between those parts....

  • Paul B
    Paul B Member Posts: 41 Helper
    edited June 21

    In response to the various possible complications presented:

    • There is no reason to support Roman numerals because very few people use them (I do occasionally in certain places; I do not expect software sorting to recognise them; I don't even expect most people to know how to sort them).
    • Support for mixed numerical systems makes no sense, just as support for sorting in multiple languages at once makes no sense. What would the rules be for sorting text in a combination of the English and Russian alphabets? How about Russian and Chinese? It would not be a reasonable user expectation.
    • Support for natural sorting (thanks EvilDragon for reminding me what it's called) can be coded by region if regional language support is part of the application; if regional language support is not available, the expectation is the user understands English and the related number system well enough to use the software, and will not expect it to understand anything else.

    Natural sorting is already in use in various graphical applications. Apple uses it in Finder. I use it in software I have written. I am sure it is used in many other software applications. Some number systems will be more complicated to sort. That doesn't mean the problem cannot, or should not, be solved.

    EvilDragon's answer is correct. The reason Kontakt sorts this way is not due to some technical limitation, but because it wasn't coded to use natural sorting.

  • Kubrak
    Kubrak Member Posts: 2,461 Expert

    Most of programs do not use "natural sorting". And if they do not, one may use 0 prefix to help program to order strings as "expected".

    "Natural sorting" is rather dangerous concept, as one newer knows how exactly items will be sorted....

    Because, once someone may suggest, let's expand it a bit further. Include date, time, roman numbers (yes, chapters are still sometimes numbered using roman numbers, or articles in contracts, floors and so on...), numbers expressed by word, whatever else, .....

    Good to know Win has started use it, if I will not be able to find the file, at 'normal' possition I will have a look at 'natural' possition. ;-)

  • Paul B
    Paul B Member Posts: 41 Helper
    edited June 21

    Natural sorting is not remotely dangerous. With natural sorting I know exactly how things will be sorted. I also know how they will be sorted with strict text sorting. The difference is that the former offers no surprises to a human familiar with the number system in use. The latter is a surprise in this context, because it goes against the way we expect numbers (which is how humans see them regardless of the internal computer representation) should behave. So even though we understand how text sorting works, there is a conflict because we see numbers treated as text.

    Your comments about suggesting to extend it are a perfect example of inventing imaginary scenarios to support a weak argument. No one is asking for any of that, and none of those are reasonable expectations. Sorting things that look like numbers as numbers is reasonable.

    Software intended to be used by humans should not be written as though a machine is the primary audience.

  • JesterMgee
    JesterMgee Member Posts: 2,129 Expert
    edited June 22

    BTW, happens in windows too, I guess we can argue what is and is not normal, but this is where people differ, code is code

    This is likely due to the fact the folder names do not start with a number, so the rules on how to sort are broken but it still works when you consider logic in how things are being sorted, just not natural logic.

    You can get yourself lost in a sea of regex expressions trying to make everything appear as every individual would expect in a list, someone will always have a different idea.

    Your comments about suggesting to extend it are a perfect example of inventing imaginary scenarios to support a weak argument. No one is asking for any of that, and none of those are reasonable expectations. Sorting things that look like numbers as numbers is reasonable.

    Hexadecimal, especially when dealing with binary stuff is an expected notation I would have, but usually this is not counted as a number. Roman numerals I would not expect but hex yes, in old days on XP there was a registry mod to allow explorer to order by hex and I needed to do that as SFX libraries I was creating started with a hex number for the ID and it was desired to see files listed in this order but this was not a "normal" way of sorting.

Back To Top