Ad
  • Default User Avatar

    Noted! Thanks for replying as well, and I would definitely be in favor of more rating categories.

    I actually found myself 'looking' for them intuitively when I recently joined the site.

    Another thing I noticed that you also mention is the difference between languages and the fact that just because someone is solving a kata in Python, that doesn't mean they know or care about Python conventions. Especially in the earlier kyus I assume, since they might be used to their other languages' conventions more.

    Take that together with how programmers at different levels have different priorities and the fact that a 3rd kyu in Java might have decided to take up a new language and solve some 7th kyu katas first, and you have a beautiful mess of all kinds of solutions.

    Anyway, I'll just keep all this in mind and go at it step by step.

  • Custom User Avatar

    One of the mistakes Codewars made in the beginning was thinking that you could divide code up into "Best Practices" and "Clever" and the internet would be able to agree on what those meant. The internet doesn't agree on anything, especially code.

    If it were to be redone (and this hopefully will happen one day in the near future), a rubric would be given and users could rate on things like Readability, Edge Case Handling, Reusability, Efficiency, Coding Conventions, etc. All of these aspects are what would be considered maintainable/best practice - but everyone weights them differentely.

    What you find readable may not be what someone else finds readable. You might see functional gibbersh in someone else's solution while they may see object-oriented madness in yours. You may think something is better because it is more easily extendable later while someone else may think you should always keep code concise and refined only to exactly what it needs to be for right now, and think anything more is pre-mature optimization.

    Different companies, different industries, different technology communities, they all tend to have different philosophies. Ruby thinks more ways to do something is expressive and therefore better, Python considers that completely against their values.

    So don't take any up-voted solution as the end-all be all, you will need to figure out what makes the most sense for you, your style, and the people that you will be working with.

  • Default User Avatar

    Ok, wow, thank you once again for your comprehensive reply! Your reply really gave me some insight from a broader perspective.

    I'll make sure to keep it in mind and try to aim for such a level of fluency myself :)

  • Custom User Avatar

    Mostly, more chars is more reading, more to decipher, ... And actually more to maintain too.
    So when you're comfortable enough with the language, so that you almost read (simple) codes like you'd read a book, you don't wanna see tons of variable declarations, morover if they are 10 chars or more long each time. That doesn't ofc mean you use only single chars identifiers, but there is an underlying idea about something like... "if you use this variable at only one or two contiguous places, there is no need to call it indexInTheStringIWannaIterateOn" -> it'd just be annoying and distracting.

    (It's pretty caricatural, ofc... Like, "less chars" used has a mantra will lead you to garbage code too. Anyway, at some point there are other matters at stake, that are far more important than the compacity of the code or the number of chars. Like the structure of your code, the decomposition into how many functions, articulated together this or that way, ...)

    Anyway. No truth in there. Just ideas and a lot of personal tastes.

  • Default User Avatar

    Thank you for replying! I will stick to the books' guidelines for now then for my own sake (don't break the rules until you've mastered them and all that), but would you mind explaining a bit more why an experienced programmer might like a different style more?

    It could help me understand the solutions better if I knew where the experts are coming from.

    Cheers

  • Custom User Avatar

    Depends on your knowledge and habits. In some time (weeks? months?) when you'll be familiar enough with your language, you'll get them and most of them (not all) won't look like "hackery" things anymore. Then you'll just go: "yeah, good..".

    A code that is considered best practices (if that ever actually can mean anything...) by beginners will generally be considered crap by an experienced users and vice versa. And you'll get all the intermediates too.

  • Default User Avatar

    [Honest Question here]

    Why are all the top kata solutions so 'hackery'? Like good job for getting it in one line, but who would ever want to read or debugg THAT code??

    Is hackery code a lower kyu thing?
    Is it a codewars thing?
    Or, and I really hope this isn't true, but is it maybe an industry-wide phenomenon?

    I'm a n00b, so if the above opinion is seriously wrong for some reason, by all means, please correct me. It's just that so far, every single resource I've used to study has hammered on the importance of readability, following the style guides, using proper, easy-to-understand names for things, etc.

    And as a learner especially, it'd be great if I could wrap my head around the top answers without having the decrypt the freaking variable names first.