Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
https://www.w3schools.com/cs/cs_oop.php
fixed
fixed
You are linking to a now retired kata.
The exception does not get tested.
It would be helpful to inform the user on the appropriate values to populate the dictionary with in the instructions. Took me a while to find this out.
While this is a good learning Kata for C#, throwing an InvalidOperationException for a missing key is not best practice.
From Microsoft C# docs:
The hint in the starter code suggests using a dictionary as the underlying data structure. A dictionary would throw a "KeyNotFoundException" if the key isn't null and dictionary is not referenced with the TryGetValue method.
I'd suggest changing that test case to accept KeyNotFoundException as well.
As many top 'coding craftsman' already said, when your variable needs an explaining comment you did something wrong
Yes he's a cheater.
Because he's a spammer, and quite a possibly a cheater (as you said). Not surprising that his "moderation" is a joke as well.
Well, the Kata author did admit right in the Kata description that the tests allow a solution keeping the original switch/case to pass ;)
It is beyond me how a (supposed)
1 dan
moderator could approve such an obviously problematic Kata :/The exception message is not tested.
The kata's proposed design for such a
Option
type is nonsense:IEnumerable
? WhatIEnumerable
means is that thisOptional
type can have0 to many
values. So the problem is not resolved at all, in fact it's even worse (it was0 or 1
before).IEnumerable<Customer>
? Why not make it a generic type? Why is it namedKata
and not something more meaningful (likeIMaybe
)?.Customer
and.GetEnumerator()
? It cannot be both a plain value or a collection of values at the same time: if it's a plain value you need to lift it to get a collection, if it's a collection you need toFind
/First
from it to get a plain value.Initial code namespace should be
MaybeKata
, notMaybeKata.Incomplete
.Loading more items...