News for hackers. Stuff that matters.
Re:What Makes Code Hard to Read: Visual Patterns of Complexi... by ajuc on Tuesday March 11, 2025 @02:52PM (#43335810)
I love code golf as much as anyone, not sure it's worth it on such small methods tho. Any of the propositions would be fine. Anyway:

    def oddness(n):
      return ["Even", "Odd"][n % 2]
BTW this trick with replacing if-then-else with a lookup is sometimes very useful. Especially if there's many ifs.
Re:What Makes Code Hard to Read: Visual Patterns of Complexi... by pasc1878 on Wednesday March 12, 2025 @05:54AM (#43341436)
Or your write in APL