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.
cool
why the []?
That's the thing, they aren't. It's a culture thing :D
People just upvote one-liners as best practice for the sole purpose that it compacts more code into a smaller space and is thus seen as minimalist or cool.
Of course, sometimes (such as for list comprehensions or for cases where it's easier to use a built-in function) one-liners are actually best practice, but half the time, it's more likely to be someone using some esoteric, relatively niche and/or inefficient code in a one-liner.
But it's been 11 months so you probably know by now.
i had the same answer, but split into two lines 'cause of the indent. It's a great habit to get used to, especially for larger and more complex projects, so it's easier to read.
i love lambda
one liners can be clever, but not best practice most of the time (I agree with you)
I fully agree with you. It should not be. This is not so clear especially for the beginners like me.
Why are these one liners considered better practice than splitting it into a second indented line?
I like your solution it takes really small amount of time in comparison with string format operation. My solution takes 3-4 times more than yours ๐ but current one with string format takes 2-3 times more than mine ๐. String formatting really heavy operation even in this case when we have to format 10 numbers only
Thank you for this feedback, I've been wondering where the sweet spot of documentation is. I've had the idea of explain like no one has any idea what anything does. But it does seem to annoy seasoned developers. I've been playing with the idea of writing comments on blocks of code instead. My level of discernment is not high enough to figure out what doesn't need be said, yet.
Looking at your solution it looks like you just like to add documentation for the sake of documentation, even when it results in illegible code and a ton of duplication/stating what is obvious even to novices. I won't claim the top solution to be best practices, but less is more in this case when the solution can be whittled down to a single standard lib function call.
Super clever absolutly, Best Practices not even close. Where is your documentation.
Thought I would be the first)
Now that is a one-liner!
Nice work. Any idea if there is a way I can save solutions I like and want to learn from?
(sorry for the newb question but I couldn't find anything in the wiki).
Loading more items...