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 is a good practice, of course. But, if you hace a large code, maybe this could be dificult to read.
I could win a gold medal in the olympic 100m dash, but the other guys keep cheating by running faster than me. Life sure is cruel.
So the compiler adds the value to the value? And that's faster than bitshifting? Huh, that's interesting.
It was faster at the beggining (like years ago) but now precesors are stronger and there is no point in doing it. You should not do it because it is easy to make mistakes and it is not clear enought.
This comment is hidden because it contains spoiler information about the solution
Technically there is no difference. The compiler will change this version to a "return" statement.
So it is just syntactic sugar and personal preference.
I personally like to use the lambda style if my method does not have much logic like in this case. This reduces your code to the important statement without the noise of the brackets, etc.
Is it better to write it like this or to write it with "return" ? I don't understand when we should use which
What's happening here?? o_O
I think it is worth noting that this could give an unexpected answer if two ints of max value are passed in. The problem is not very clear on the range of allowed values for a and b.
It's doing a conversion to string, providing the base number you want it to be converted to/from.
In this case, providing base 2 means that it will be converted to binary. Similarly, base 8, 10 and 16 can also be used.
Base10 being standard numbering. I think.
Using what's available to you hardly counts as cheating :P
But yeah- I kinda wanted to write a proper method for converting to binary myself, ended up doing the above.
A Lazy developer is an effective developer :D
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You get used to them when you start using them.
I think this is the best practice, isn't it? Is there something wrong with this?
Loading more items...