Ad
  • Custom User Avatar

    In Python, import fractions yields fractions == None. This does not seem to be intentional, so I'm assuming something in the import-prevention stuff is broken.

  • Default User Avatar

    First of all, I wish to express my gratitude for a really interesting kata that targets basic graph algorithms.

    There are some issues I want to point out:

    1. Description has to be improved:
    • it's unclear what are the rules of retention and updating (I'll provide more elaborate comments regarding this subject below);
    • the following sentences doesn't look meaningful:
      'A sheet has an infinite number of cells. The default value of any cell is the number 0'
      I've no idea what means 'an infinite number of cells'..
      Now mysterious zero. Provided boiler-plate code and description forces the value of a cell to be of Object type (and that doesn't seem to be an idea by itself).
      And it's impossible to assign 0 to an instance of the Object type. I suggest rephrase it roughly as follows: 'if a cell with a given name wasn't previously initialized, using method write, it has to be given a value of Integer.valueOf(0)'.
    1. Functions in this kata violate good code practices.
    • Function<Object[], Object> - I do not suggest to use generics in the wild like this. Because using Object as a generic type is as good as don't use generics at all.
    • And I hope no one will argue that blind castings from Object to Integer contradict the concept of type safety and must be avoided.
      I understand that the reason for this decision - desire to make it possible to store any kind of data in a cell. But this requirement has nothing to do with the data structures and algorithms and it pollutes the programing model. So in my opinion, it'll be much better to stick with int as value-type for this task. It'll not change the actual algorithm but the code will be more readable.
  • Custom User Avatar

    write(name, value) is called in actual test as write(name, value, undefined) instead, which violates the description the it is called with two arguments only.

    In fact, the description just overloads write with two different functions without specifying how to distinguish between the two. Is it the type of the second argument? Then it should be clearly specified. Otherwise it's pure guesswork.

  • Custom User Avatar

    The fixed tests are poorly written: It is written in a way that makes all subsequent test blocks depend on the previous blocks leaving the user object in a correct state. The test blocks should not be highly coupled to each other, as each block should be testing individual things.

  • Custom User Avatar

    The purity and laziness characteristics of formula is unspecified. Is formula guaranteed to be pure (passing the same values always returns the same value)? When should it be calculated, and which cells should be recalculated?

    Recalculation can be performance heavy, and the use of impure functions like RAND are quite common in spreadsheet usage, so depending on the requirement the cells can end up with different values.