[Michael Selik] 

> You might be pursuing a local optimum of obviousness. If you step back 
> from the idea of "initialize the counts with all interesting keys" and 
> looping over them, you might find a better overall solution.
>

That's a distinct possibility, but this is far from the first time I've 
wanted for a better way to initialize a Counter. It's just a simple example 
for which there are many many alternative approaches.

If' you're interested, I have a more complete implementation of the game of 
life here <https://repl.it/@AbeDillon/Life>.

[Michael Selik] 

> That happens more frequently than my OOP professor seemed to think. I end 
> up with platypi (platypuses?) all too often.


Yes, I always try to caution my own students against strict adherence to 
any ideology, methodology, or cult.
"Always do this" and "Never do that" rules are useful crutches for novices 
trying to navigate the complex world of coding for the first time,
but pros are the ones who are experienced enough to know when it's OK to 
break the rules. When GoTo isn't harmful. When to break the rule of thirds 
<https://www.youtube.com/watch?v=hyGAgqfoUo8>.

Obviously, Python breaks SOLID principals successfully all over the place 
for pragmatic reasons.
I don't think this is one of those cases.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to