User talk:Marco Sulla

From Rosetta Code

First things first - as far as I know you are not the administrator/moderator of the Rosseta Code. I am missing something?

Yep. Your "99 bottles" code is clever. And hackish. And weird. To be serious: you don't want such code in your pacemaker (an small medical device to force heart pulses) if you have one installed inside your body. To be more serious: Python doesn't conform to IEC62304.

Your code shows "how to use Python in (seemingly) serious functional way". Nice try. Lack of comments, some PEP8 violations, too long.

> This is your opinion. You are free to think as you want, but I don't think you should put it in a wiki.

Point taken. It is my opinion. Actually I had written the simplest (but naïve) "99 Bottle" in Python. There is no reason (see the very first line) to think about what you think. Nevertheless, in spare time some changes to the "preamble" will be done - esp. "in my opinion" will be added.

> 2. this solutions is [...] 4. easy for i18n and l10n; 5. open to extensions

Programming is a brain washing job. Seriously. But with IQ > 90 you should notice that that statements are used in an ironic sense. Do you seriously think about the open-close principle in "99 bottle" context? Are you really think that the problem must be translated into right-to-left languages, logographic kanji or (even more complicated) Korean language?

> Functional simplified version is much more simple for i18n.

It doesn't matter: the job must (in IT industry) be done by a professional, who generally has no idea about programming. She/he obtains text strings as input and produce text strings as output. She/he works with resources, not with code.

> On the contrary, functional versions are extended per se, since you can put everything, not only 99, not only bottle(s) of beer, > not only on the wall, etcetera. And they are much more funny.

You must understand that I don't mind how you write programs. Just your solution shows different possibilities than I showed in my solution. Therefore, in a sense, they complement each other - mine shows how to do a simple thing in a simple (I would even say coarse) way - your how to do a simple thing in a complicated way. Which one is better? We don't need to compare. Because these are examples of Python language capabilities, not competing for who of us is an alpha male.

> If you want a real extendable version, you have to write a module or a class. An overkill IMHO for the task.

True. Anyway OOP is not-so-hard - esp. when the architecture will be planed in UML. More interesting is translate the song structure in EBNF and create a program to translate from EBNF to natural English. And/or use Huffman encoding to code the lyrics with zero redundancy.