Important note: Do not read any of the comments in the thread without solving the challenge.
This article is a follow of my very first article
Ev...
For further actions, you may consider blocking this person and/or reporting abuse
I drop the solution here anyways.
If we're talking about clarity then it is misleading to use
when there is no apparent use for that value. Instead it is clearer to use
So it's not just choice of variable names that affect clarity.
You're right geraldew, thanks.
Nice article, waiting for the part 2!
Just for the record, we could also write this part
as this
Beautiful indeed, I like shorthands. Thanks.
And the same thing could be achieved using build in python library
collections.Counter
like this:That was a great article!
It took me a while to figure out what the program actually did, just because of how poorly the variables were named.
Thanks Jonas.
Great! I'm waiting for part 2
Thanks Sammy. Don't, it will come ^_^.
This was not really an example of simply bad naming, this was intentionally misleading naming with "booleans".
Here is how I would set bad names:
And here is how far I could take this with help from the other comments. Perhaps a bit overkill...
I know Docstring isn't part of this but for the sake of a clarity example I included it; not for readability (it actually makes the code a bit less readable imho) but for documentation and IDE tooling.
Reminder to post the next part 😀