Going to codewars for motivation, leaving depressed after seeing all the one liners compared to my ugly code!

  • 5
    Id rather read ugly code than one liners
  • 2
    @sharktits but they show the potential of the language that I can't reach with the basics!
  • 2
    Ugly code > one liners

    I still don’t understand why would someone decide for one liners when there is no significant performance gain. Code should be written in a way that helps the next developer understand what you did.

    Now... don’t confuse ugly code with stupid code
  • 2
    Well the reason I hate technical interviews is because I have to solve problems elegantly that are in the end useless.

    LoC don't matter honestly... It's how efficient the code is and how much time it saves....

    I'll figure out an O(N) solution if you actually gave me **a real problem that needs it** A few milli/seconds saved ain't worth the brain power...
  • 2
    @matteusbrevik given that its not production code, being able to use one liners shows that you know all the fancy constructs. Lambdas, maps, zips...
  • 4
    @matteusbrevik in many code wars the point is not readable code but either fast, short or obfuscated code depending on the challenge.

    Most of those solutions, except the fast one, would qualify as the wrong solution in most production scenarios.
  • 4
    @Voxera exactly. You aim for the smart solution, not for the best one.
  • 2
    There’s a problem where someone did:

    from *some default module* import *a function that solves the problem* as *the name of the function needed*
  • 1
    @-vim- this beats all one liners and moves from smart to smartass 😆😆
Your Job Suck?
Get a Better Job
Add Comment