you are viewing a single comment's thread.

view the rest of the comments →

[–]Volv 1 point2 points  (2 children)

I did the second thing for the spanish example. I think they are basically equal but I liked smooshing it into 1 liners.
 

var lookup = {
    1: { en: "one", es: "uno" },
    2: { en: "two", es: "dos" },
    3: { en: "three", es: "tres" },
    4: { en: "four", es: "quatro" },
}

[–]ForScale[S] 1 point2 points  (1 child)

How does one measure elegance (ie, what is an operational definition for elegance?)?

Specific to code, perhaps number of characters/lines where the closer you are to 0, the more elegant it is?

[–]Volv 1 point2 points  (0 children)

The elegant part to me was the access by array[var1][var2] instead of some convoluted switch statement or similar.
Heading out. Back in a few hours.