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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Updated to JUnit 5 and approved.
I think the biggest problem is (almost) everyone can vote.
I consider myself prety much a beginner and have eroniously voted for less efficient code because I thought it was the best. Maybe only users with high kuy score should be able to vote for best practices. Or even better, active people vetted by mods.
Approved some time ago
couldn't agree more, i'm sick of people voting best practice just random stuff, the voting mechanism should be changed
Approved by someone
Back in the old days when many people were completing this kata, the starting code was:
If you edit/fork the kata and look at the "Complete Solution", you'll see the legacy of this format is still in place (it's just in a non-public location).
Most kata writers don't bother changing given variable names, since that's not part of the "problem" we're being asked to solve.
So, yeah, people are right that it shouldn't be
bool
, which is why someone updated the kata to change the starting code toboolean
(which, IMO, is just as bad of a name, since it's still the name for a variable type, even if Python proper never uses it; it's like Hungarian Notation, except it's not just a notation, it's the whole name). But, you should keep kata updates in mind when talking about people's ancient solutions: the ground has shifted.To be honest when I wrote this I'd forgotten about the built-in function as I so rarely use it, but I would probably choose a different argument name with that in mind as I agree it's best to avoid shadowing built-ins.
If I wrote it now I'd probably go for
isTrue
as parameter name but not sure it's as clear...It's not a keyword but a built-in function. And yes, it's a bad idea to use it as a variable name.
bool is not a keyword in Python
If bool is, then you can't use bool in variable names.
Good!
I guess your right! Wouldnt be surprised if this is how the min and max methods are written.
Oh. Really, he done that best way.
Yep, that's why this one shouldn't be ranked highest for Best Practice, the one using the arguement "Boolean" should.
Loading more items...