• Dennis (unregistered)

    TRWTF: Changing from the correct order to some weird vertical-first order.

  • TopDown (unregistered)

    I assume CSS style 'grid-auto-flow: column' would have solved the problem in one line.

  • bvs23bkv33 (unregistered)

    except gamma comes before delta

  • Simon Clarkstone (unregistered) in reply to Dennis

    It's not that weird; it's the order you sort a telephone directory.

  • Church (unregistered) in reply to bvs23bkv33

    Yeah, not sure how we aren't talking about that WTF.

  • Worst Programmer Ever (unregistered) in reply to bvs23bkv33

    Yep, that was the thing that drove me the most nuts. I had alpha, beta, gamma, delta, etc.. drilled into my head in high school and can still recite the whole damned thing.

  • (nodebb)

    They should've hired some Greek people to sort it out. How did they expect to order Greek letters without an expert in the field?

  • thehugo (unregistered) in reply to Worst Programmer Ever

    Indeed, it was (still is actually) unclear why the second one is more alphabetical than the first (or vice-versa).

  • Little Bobby Tables (unregistered) in reply to TopDown

    I just assumed that the change they were implementing was from "clockwise from top left" to "anticlockwise from top left".

  • tbo (unregistered) in reply to TopDown

    Bold of you to assume it's not using table layout.

  • Factory Improvement (unregistered)

    Reminds me of a colleague who pulled an all-nighter to finish implementing an application.

    Later that week, when someone reviewed the code and complained about some method, he said: "I wrote this at 4am and it works, I'm NOT changing it"

  • Yeah, but... (unregistered) in reply to TopDown

    Pretty sure nobody who writes for this site would consider a CSS solution an "appropriate programming solution anyway." ;)

  • David Mårtensson (unregistered) in reply to Dennis

    No, the real WTF is using greek letternames without knowing the order of them in the greek alphabet.

    Unless they specifically wanted clockwize or counter clockwize order, but then sording byt name as a string is all wrong anyway.

  • Wumpusarama (unregistered)

    Simply make an integer enumeration of the Greek alphabet sorted correctly and use that.

  • Dennis (unregistered) in reply to bvs23bkv33

    Unless you're using the Greek letters directly, instead of writing them using the latin letters as done here, delta very much comes before gamma when sorting it alphabetically, which is the task, according to the article.

  • Dennis (unregistered) in reply to David Mårtensson

    The order is the greek alphabet is irrelevant when you're writing the name of the Greek letters using latin letters, and then sorting it alphabetically (as the task was, according to the article).

    However, I suspect it is mostly just badly chosen sample words.

  • markm (unregistered)

    Those were just sample words. They wanted alphabetical order, from top to bottom in the first column and then continuing in the second column, but what came out was alphabetic order across the rows first. Think of the index in a book; you get two columns per page, and it's annoying to find anything if it goes:

    a b c d ... z

    instead of

    a n b o . . . . . . m z

    This is a very old problem in computing. I recall when Knuth was inventing computer typesetting in the 1970's, he complained about lazy programmers doing it the first way, and I expect you'd find a discussion of it in COBOL textbooks from the 1960's.

  • markm (unregistered)

    Darn, the website took out the carriage returns and spaces that made columns. Not sure how to fix that... In any case, whenever you have a two-column page, the more readable form is down the first column to the bottom first - but to do that, you have to generate the whole page to a 2D array in memory before "printing". 60 years ago, that array would use an uncomfortably large part of your RAM. These days, it just takes more work, or knowing how to use whatever canned solution your compiler, library, or drivers offer.

  • (nodebb) in reply to markm

    Row-major order:

    a b
    c d
    y z

    Column-major order:

    a n
    b o
    m z

    Fingers crossed that I formatted this correctly.

Leave a comment on “Sorting Out a Late Night”

Log In or post as a guest

Replying to comment #:

« Return to Article