Item Sequence in Dropdown List



  • You have to love when a developer sorts a list of numbers as text.

     Dropdown list sequence



  • Don't be so fast to blame the developer.  Maybe it's the dba's fault for changing the field type to nvarchar, no? 



  • Sure, but couldn't the developer cast the value to ensure the expected type?



  • @plotevil said:

    Sure, but couldn't the developer cast the value to ensure the expected type?

    And what if actually a string is the expected type? What if actually that column supposed to store proper alphanumeric strings, like serials, for example FF1337LOL or something like that, and in that particular case they happen to be numbers? Maybe that particular client uses numbers for naming cost centres or whatever, but other client have letters in cost center names so having alphanumeric fields is a requirement. Without knowing what sort of data this list supposed to store, this might or might not be a problem

    The Real WTF here is the blue background and that the listbox displays more than 7 rows at the same time. Clearly this particular developer doesn't know much about proper UI design.


  • Winner of the 2016 Presidential Election

    A natural sort would be appropriate, then.



  •  @plotevil said:

    Sure, but couldn't the developer cast the value to ensure the expected type?

    In many languages that would involve casting it to a list of ints, sorting, then casting them back to strings in order to add them to the list.  Possible, but tedious and potentially very slow once the list grew large enough.



  •  In the company I work for now they hired a development house to build them a web-based data entry and retrieval system to replace all the little spreadsheets and bits of paper everyone was using to store information on.

    The application had numerous drop-downs, for selecting things like categories and choosing specific items, sometimes running into hundreds of items. None of these were sorted, they were simply presented in database row order.

    Sometimes developers just blindly code away without testing the application from a useability perspective.

    Thats why you have user acceptance testing I suppose :)



  • @Soviut said:

    In many languages that would involve casting it to a list of ints, sorting, then casting them back to strings in order to add them to the list.  Possible, but tedious and potentially very slow once the list grew large enough.
    How long do you tend to make lists for dropdowns?  They get pretty cumbersome at even 200 elements.  At some point, it's really better to make it a free form text box.



  •  @belgariontheking said:

    At some point, it's really better to make it a free form text box.

     

    c-c-c-c-combo box ...

     

    oh wait wrong website for that meme..



  •  Haha! Oh wow!



  • @belgariontheking said:

    @Soviut said:

    In many languages that would involve casting it to a list of ints, sorting, then casting them back to strings in order to add them to the list.  Possible, but tedious and potentially very slow once the list grew large enough.
    How long do you tend to make lists for dropdowns?  They get pretty cumbersome at even 200 elements.  At some point, it's really better to make it a free form text box.

    That's why I never use the "Select Tags..." button. That's an example of a list gone too big!


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.