Write the most clever code you can

(buttondown.com)

17 points | by todsacerdoti 3 days ago ago

7 comments

  • hinkley 2 days ago ago

    > I am proposing writing clever code as a means of practice. Being at work is a job with coworkers who will not appreciate if your code is too clever.

    We are what we pretend to be, so we must be careful about what we pretend to be.

    Clever is, however, about all that a CS degree prepares you for. So you're going to be leaning on it for as long as it takes you to find someplace else to stand. Just don't take too long to get out of it.

  • undefined 2 days ago ago
    [deleted]
  • lambdaone 2 days ago ago

    Unironically giving that prime number routine as an example of clever code is not a great look. So bad on so many levels.

  • mmcromp 2 days ago ago

    "clever" is objective and cultural. Some people will say ternary operators are overly clever. Other will say OOP patterns are overly clever. It depends on what paradigms and patterns you're used to.

  • mathgradthrow 2 days ago ago

    I still dont know what clever means here.

    • RaftPeople 2 days ago ago

      > "I still dont know what clever means here."

      Maybe a better term is "syntactic compression"

    • atoav 2 days ago ago

      When talking about code calling code "clever" typically means someone is needlessly complicated and unreadable code that (this is the accusation) serves mostly the purpose of showing off the skill of the programmer, and rhis usually means using more advanced language features. So when code is clever, people usually think it is too clever.

      Sometimes code is also called clever undeservedly so. E.g. I don't think list comprehensions in python are necessarily harder to read than most for loops, but people unfamiliar with them might think of them as too clever.