num+'' was my first thought, and as you say it's legit... but I went with toString() for readability - ie. you can be sure everyone on your team can work out what "toString" is doing, but the other way requires slightly more knowledge of implicit type coercion. To say nothing of this solution... impressive, but your team mates may not appreciate it ;)
ok, you made me tripple-check this and finally convinced me! I was wrong as many others, sorry. :)
So for the sake of peace I removed test cases which use years before 1582.
Should I do something more?
And thanks for your stubbornness to prove me wrong ;]
This sounds like a pretty valid argument. @fizis do you want to handle this or are you sticking to your "silent oath"? :) Many people have been able to solve the kata so we all know its doable, however that doesn't mean we couldn't improve the wording so that others don't spend too much time going down the wrong rabit hole.
Quite easily. I've never had an interview question about type coercion.
How would they go about getting a job as a developer if they didn't know about implicit type coercion?
"cheating" in this context is a joke. Of course I'd use a built in method.
magic
num+''
was my first thought, and as you say it's legit... but I went withtoString()
for readability - ie. you can be sure everyone on your team can work out what "toString" is doing, but the other way requires slightly more knowledge of implicit type coercion. To say nothing of this solution... impressive, but your team mates may not appreciate it ;)Hi Fran,
ok, you made me tripple-check this and finally convinced me! I was wrong as many others, sorry. :)
So for the sake of peace I removed test cases which use years before 1582.
Should I do something more?
And thanks for your stubbornness to prove me wrong ;]
hi, ok @jhoffner, i will analyze these comments when i have more time.
This sounds like a pretty valid argument.
@fizis
do you want to handle this or are you sticking to your "silent oath"? :) Many people have been able to solve the kata so we all know its doable, however that doesn't mean we couldn't improve the wording so that others don't spend too much time going down the wrong rabit hole.