Ad
  • Custom User Avatar

    Yes I typically spend a lot of time modelling in my head before writing anything.
    And when I get stuck I try to alternate which way I attack the problem from.
    So there is a balance between

    1. What is a reasonable way to call this function/instantiate this class and
    2. How much work does that put on the function/class?
      Nbr 1 explains itself, nbr 2 is because I might not get back to the code for a long time and as you know long/complex functions can be hard to understand.

    Thank you so much! This comment has pretty much made my week!

    Yeah, I think there is a lot of focus on either
    A) using some of the more obscure python/programming methods or
    B) trying to shorten the part of your code that does the actual work
    -to show off your skills and understanding. There is some fun in that but it's very had to read sometimes. That or it's just very very specific to this one problem.

  • Custom User Avatar

    I think it answers my question, it seems that having to write those tools that need to be extended later gives you a good thought process.

    It's funny that you say that you're not a developer because the way you write code is more elegant than the overwhelming majority of other solutions for this kata.

    Consider the most voted solution for example, it simply hardcodes the type relations... but this mapping grows exponentially as more types are added :(

  • Custom User Avatar

    Just saw that I forgot to remove the print statement, sigh

  • Custom User Avatar

    Thank you, means a lot!
    I work as a business support specialist, and not a developer. But I sometimes have to develop small tools quickly that can easily have more use-cases added. Don't know if that answers your question?

  • Custom User Avatar

    Now this is cool.

    What's your technical background, how did you think of this??