Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Thanks!

    I sometimes impose additional constraints on myself when doing katas inspired by the coderetreat events, when you code in pairs and write the same program from scratch multiple times, each time with different restrictions. Coderetreat events use Game of Life for their sessions.

    When building the solution to a particular problem over and over, a developer tends to converge on a single style, based on their existing skills and habits. Later Coderetreat sessions add constraints on either the design structure, coding or communication patterns, or the language elements used in order to expand those boundaries and introduce new concepts. This can be as simple as changing the amount of code developer may write (can you make all functions only three statements long?), or as broad as extending the problem domain to show tradeoffs in design strategy (can you make your two-dimensional code work in 3D?)

    https://www.coderetreat.org/the-workshop/

    This piece of code is a result of me imposing a constraint that I'll only use arrow functions consisting of one expression. It's not readable, but the idea was to learn by doing something differently, or taking what you would normally do to the extreme. In my case, doing this kata was one of the reasons that led me to a realization, that arrow functions in JavaScript are very overused by developers, and I myself started using them less often.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Are the replies to solutions somehow visible to people who have not yet solved the kata?

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    You should return database['english'] when the IP is invalid, this way you need to change the english greeting only in one place, if you decide to change the greetings in the future, e.g. to say "Hello" instead "Welcome".

  • Custom User Avatar

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