Ad
  • Custom User Avatar

    I think as far as "best practices" are concerned, it's what the code actually does that matters when voting, not the actual style of code employed when writing the solution.

    I don't think people are marking submissions as "clever" because someone deleted whitespace/newlines and shortened 3 lines of code into 1, they're voting "clever" because what the code is doing is clever - regardless of syntax, style and other cruft. It just so happens that in a lot of cases, particularly these easier problems, "clever" solutions consist of one line. In addition a lot of people seem to be going for code golf, though there's no benefit of doing that.

    In an actual codebase I think that, while most people would spread this snippet of code out, it would nonetheless be considered "best practice".

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Nope, this definitely does not qualify as best practices! It's incredibly presumptuous about the object values, so anything too far outside of what was explicitly tested in this kata would probably fail.

    Just having some fun with it :-)

  • Custom User Avatar

    That is a good idea, but would maybe make this kata more difficult than 7 kyu.