Ad
  • Custom User Avatar

    Sometimes the descriptions can be overworded or underworded. Information theory and the beginning of words is a very cool subject to research if you can. If you see kata with bad descriptions, you can leave a suggestion in the discussion section to help improve the understanding of the goal for other Code Warriors.

  • Custom User Avatar

    made me realize this kata is overworded

  • Custom User Avatar

    Hehe calculus programming ^-^

  • Custom User Avatar
  • Custom User Avatar

    Recursion, not bad)

  • Custom User Avatar

    Yeah I am use to using buffer for strings coming from Java so searched docs for it from the get go, and after seeing the solutions look at the cheap oneliner in code to see what it was doing if anything and nope, just uses the string builder instead of bytes but affectivly the same iterative loop on a count. The only heads up thing was that it preemptively grew the size ahead of time so that if you were looping a large number of times it would not have to resize. https://github.com/golang/go/blob/master/src/strings/strings.go#L533-L536

  • Custom User Avatar

    but still it's kinda odd that we have been given a value c that isn't guaranteed to be the biggest value, or atleast not in the sample tests.

    PythagoreanTriple(5,3,4) , Equals(true)

  • Custom User Avatar

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

  • Custom User Avatar

    The problem description clearly states that c is the largest value

  • Custom User Avatar

    Yes, but Pythagorean triples are usually ordered.

  • Custom User Avatar

    if we put the highest value in b or a that would be problem

  • Custom User Avatar

    I enjoyed this kata very much good job!

  • Custom User Avatar

    I first try to achieve an "organic" solution, so I force myself to explorethe documentation, as this varies from language to language.

  • Custom User Avatar

    @ippoippo if you understand a particular technique to be optimal from the onset, and isnt going to complicate your solution, it is not premature to use it. :-)

    I have actually been using go professionally since 2013. I use these kata's in their martial arts context, a form to utilize techniques you've learned as reinforcement of that learning.

  • Custom User Avatar

    :-D

    Of course... as an programmer who's experienced other languages (C a long time ago, Java, Ruby, a little Objective-C, learning Swift), but is learning/new to Golang then my though process for each kata is.

    1. What is the obvious, potentially dumb solution to this problem.
      1a) In this case, just a for loop and do something like result = result + value
    2. But experience to date tells me that there is either a 'better' way to do it, or perhaps a more idiomatic way to do this.
    3. I don't know what it is though, so I use the tools available to me (ie. a Google search).
    4. Google search results in a StackOverflow page, and some other results.
    5. I read the StackOverflow. It teaches me about the "bytes" package that Golang has - I learned something new, as I now read https://golang.org/pkg/bytes/
    6. Also read http://golang-examples.tumblr.com/post/86169510884/fastest-string-contatenation
    7. Next step, make a decision. Make a judgement call.
      7a) Is the readability of just doing result = result + value significantly better than buffer.WriteString(value).
      7b) Decide "No", so I decide that code readability is not affected by choosing the admitedly prematurely performance optimized buffer approach.

    What I rather like about these Kata is that I find it a great tool to learn about a language. I don't treat the kata as a test of what I know now. Instead, I use it as a mechanism to direct where I research and learn.
    Same thing happens after I submit my 'answer', in that I get to learn alternatives ways to do stuff. Better ways, more idiomatic ways in the particular language etc. (I notice this more in the Swift versions).

    I think other people do treat the Kata more of a 'test' about what you 'know' without resorting to your books/internet. That too is a valid way to use this site as well. :-)

  • Loading more items...