User:Anonymous31415927

From Rosetta Code
Revision as of 18:00, 19 January 2020 by Marco Sulla (talk | contribs)

Please re edit your Python comments about other solutions to be less antaganostic. Paddy3118 (talk) 15:31, 19 January 2020 (UTC)



Yes, it's the same I suggested to him/her here :-) Anyway, this is a wiki for showing different solutions for different languages, not to teach how to code. Your comment is IMHO off-topic, unnecessary polemic, too much verbose and highly questionable
Marco Sulla (talk) 17:05, 19 January 2020 (UTC)


But 2, 1 and 0 are special cases, thus they write conditional expressions to split the flow control. Of course this leads to unnecessary entanglement in the source code.

I don't see any entanglement, can you explain it (preferably here?). On the contrary, there's nothing more entangled that hard-code.

It seems to be due [...] repetitive elements.

Off topic.

Therefore it is better exclude these special cases outside the loop. This significantly reduces the number of conditional statements, which is generally a good idea. (Conditional statements hamper pipelining in modern CPUs.)

The fact you are really concerned by the performance of this little task make me a big smile :-) Have you ever eard about premature optimization?

you should notice that this trivial solution is: 1. shorter; 2. simpler; 3. more readliable; 4. easy for i18n and l10n (including Hebrew, Japan, Korean); 5. open to extensions; 6. more pythonic (see Zen of Python); 7. better optimized and faster; 8. funny.

1-3. and less powerful and hard coded
4. no, see the simplified functional version
5. how?
6. I don't think hard code is considered pythonic...
7. see above
8. Not at all. Functional solutions are much more funny, since you can create the variation of the song you want :-D

BTW, there is a reason [...] to autogenerate "99 bottles".

Again, off topic.

Marco Sulla (talk) 18:00, 19 January 2020 (UTC)