Programming D. E. Knuth in Python with the Deterministic Finite Automaton construct

Kiuhnm kiuhnm03.4t.yahoo.it
Sat Mar 17 16:12:29 CET 2012


On 3/17/2012 16:01, Michael Torrie wrote:
> On 03/17/2012 08:45 AM, Kiuhnm wrote:
>> Your way is easy, but the result is poor.
>
> In what way?

The resulting code is inefficient, difficult to comprehend and to mantain.

> What is your recommended way?

One should rewrite the code. There is a reason why Python doesn't have 
gotos.

>> Your should try to rewrite it.
>> Decompilers do exactly that.
>
> Decompilers rewrite code for people?  That's really neat.

No, they try to rewrite code that contains jmps in order to remove them.
If one jmp is too difficult to remove, one should use a flag or 
something similar.

Kiuhnm



More information about the Python-list mailing list