User:Anonymous31415927: Difference between revisions
Marco Sulla (talk | contribs) No edit summary |
Marco Sulla (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
Please re edit your Python comments about other solutions to be less antaganostic. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 15:31, 19 January 2020 (UTC) |
Please re edit your Python comments about other solutions to be less antaganostic. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 15:31, 19 January 2020 (UTC) |
||
---- |
|||
Yes, it's the same I suggested to him/her [[User_talk:Anonymous31415927|here]] :-) |
Yes, it's the same I suggested to him/her [[User_talk:Anonymous31415927|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<br /> |
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<br /> |
||
[[User:Marco Sulla|Marco Sulla]] ([[User talk:Marco Sulla|talk]]) 17:05, 19 January 2020 (UTC) |
[[User:Marco Sulla|Marco Sulla]] ([[User talk:Marco Sulla|talk]]) 17:05, 19 January 2020 (UTC) |
||
---- |
|||
<blockquote>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.</blockquote> |
|||
I don't see any entanglement, can you explain it (preferably here?). On the contrary, there's nothing more entangled that hard-code. |
|||
<blockquote>It seems to be due [...] repetitive elements.</blockquote> |
|||
Off topic. |
|||
<blockquote>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.)</blockquote> |
|||
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''? |
|||
<blockquote>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.</blockquote> |
|||
1-3. and less powerful and hard coded<br /> |
|||
4. no, see the simplified functional version<br /> |
|||
5. how?<br /> |
|||
6. I don't think hard code is considered pythonic...<br /> |
|||
7. see above<br /> |
|||
8. Not at all. Functional solutions are much more funny, since you can create the variation of the song you want :-D |
|||
<blockquote>BTW, there is a reason [...] to autogenerate "99 bottles".</blockquote> |
|||
Again, off topic. |
|||
[[User:Marco Sulla|Marco Sulla]] ([[User talk:Marco Sulla|talk]]) 18:00, 19 January 2020 (UTC) |
Revision as of 18:00, 19 January 2020
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)