7 kyu

Factory Functions #1 - Creating profile for people

587 of 596donaldsebleung
Description
Loading description...
Fundamentals
Tutorials
Object-oriented Programming
  • Please sign in or sign up to leave a comment.
  • user3620770 Avatar

    I don't understand why we have to put methods directly on the object that the function returns, isn't that a bad practice?

  • ejini战神 Avatar

    The first link in the description leads to a Error 404 page ~~ should be removed? / replaced with a new link (better)

  • Blind4Basics Avatar

    Hi dsl,

    I've had some troubles with the random tests:

    expect:   '{...,\n  sayName: [Function: sayName],\n  introduce: [Function: introduce] }'
    but was:  '...,\n  sayName: [Function],\n  introduce: [Function] }'
    

    This should be in the sample tests too. I had to poke around in the dark to find what was the problem (that's the first assertion of each random test)

    • Voile Avatar

      It's using Test.assertSimilar to compare two objects with functions directly, which is really just a completely wrong test. The properties should be compared one by one.

  • user8436785 Avatar
  • Souzooka Avatar

    Please don't stringify objects, it's impossible to complete this Kata using sayName or introduce as anonymous or bound functions as these stringify differently, and I'm not really sure what implementation you want otherwise that appropriately uses the created object's context.

  • user9096864 Avatar

    remove the double spaces in between the sentences... that's one of the most annoying issues that I see in these katas is when we can't tell what it is in the answer that looks different when really it all seems to be the exact same.

    • donaldsebleung Avatar

      Please read the description. The description makes this very clear:

      IMPORTANT: For the introduce() method of the person, each sentence is separated from the next by exactly TWO whitespace characters.

      Issue marked resolved by donaldsebleung 9 years ago
  • kornev Avatar

    description: 'Hello, my name is FULL_NAME.\sI am AGE years old.\sI am a GENDER.' but test case matches aganst 'Hello, my name is FULL_NAME.\s\sI am AGE years old.\s\sI am a GENDER.'

    • donaldsebleung Avatar

      Please read the description. The description makes this very clear:

      IMPORTANT: For the introduce() method of the person, each sentence is separated from the next by exactly TWO whitespace characters.

      Issue marked resolved by donaldsebleung 9 years ago
  • dougbacelar Avatar

    Too much text!!

    • donaldsebleung Avatar

      A lot of text I know but that is the essence of this Kata :)

      If you find the "Overview" too long and boring you can always skip straight to the "Task" section and ignore the rest :)

    • dougbacelar Avatar

      I'm sorry, I forgot to say I found some information in the intro useful and I actually learned something reading it, thank you for that. But the first glance I had at this kata I thought "NEXTT", but I suppose you are right, I could have just skipped to the Task section :-)

    • donaldsebleung Avatar

      Haha no worries :D