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.
There are people who can't do math, so...
Why isn't this solution best practice? It seems so simple and straight forward.
Not an issue~~
That was done.
Seems like fixed
I refuse to believe modifying prototypes is the way to go.
I think it would be much better to simply write a sorting function.
If grammar is important to you, below are some suggested changes to "Your task is to calculate how much blank pages do you need."
"Calculate how many blank pages you need."
"Calculate how much paper you need."
"Your task is to calculate how many blank pages you will need."
If you care about grammar way too much, like me, here are the reasons for the suggestion:
Proper usage is "many" where things can be counted ("How many pieces of cake are you gonna eat? Many pieces") and "much" when they are not countable("How much cake are you gonna eat? Soooo much cake.").
The phrase "do you need" is not a big deal, but most native speakers would only use it in a question, "do you need x pieces of paper?" or "how much paper do you need?" and would use something like "you will need" or simply "you need" in this case.
I agree that for production code it is better to put curly braces around
for
blocks. Any linter would point that out.But on CodeWars people seem to favor more concise solutions, that's why you will see lots of one-liner.
For this one, I think it is still readable as is, not being overly complex: no comma operator, one instruction per
for
block, only four lines.Of course it is not the best but I find it acceptable.
Also, note that "best practice" does not represent only readability. People can vote because of many things independant of code style: algorithm, elegant way of solving the issue, performance, ...
Is it necessary to skimp on whitespace and leave out curly braces?
They are free, easy, and make the code more readable to more people!
Readability is a hugely important factor for "best practice."
I had to spend some real time trying to make sense of this, admitedly, CLEVER solution.
Someone who thinks this is really best practice care to explain your reasoning?
PS. this is honest, I'm not trying to make trouble!
This comment is hidden because it contains spoiler information about the solution
Um... I don't think this should work.
Profoundly simple kata with only 2 tests.
Perhaps add an input validation portion so there's something to solve here
Suggestions:
Make the function inputs more expressive
Specific the output should be to two decimal places
Nice kata! Clear assignment, no tricks, thorough tests
This comment is hidden because it contains spoiler information about the solution
Loading more items...