Sujet : Re: Why Python When There Is Perl?
De : sc (at) *nospam* fiat-linux.fr (Stéphane CARPENTIER)
Groupes : comp.os.linux.advocacyDate : 24. Mar 2024, 14:22:11
Autres entêtes
Organisation : Mulots' Killer
Message-ID : <66001af3$0$7526$426a74cc@news.free.fr>
References : 1 2 3 4 5
User-Agent : slrn/pre1.0.4-9 (Linux)
Le 21-03-2024, Farley Flud <
ff@linux.rocks> a écrit :
>
The classic example is recursion. In the abstract realm recursion
seems highly efficient and elegant. But such elegance has to ultimately
be translated into machine code and, at this level, recursion becomes
highly inefficient and even idiotic.
As with everything you don't understand what you criticize.
First, quicksort is considered by a lot of people as the most efficient
algorithm to sort a table. It's recursive. So either you are the only
one in the world believing the quicksort is bad, and so you are wrong in
this belief, or you are wrong when you claim recursion is efficient.
Well both way you are wrong.
Now, before jumping on a bad example about recursion, start trying to
find out a little bit more about recursion. Be sure the issue is not
with your example but with recursion by itself. As I believe you've never
heard of tail recursion, be sure you look at it before considering
answering.
Of course, you can find use cases in which recursion is a bad way. But
before coming with it, be sure is an issue with recursion and not with
your code. Of course, you do what you want. You'll be funnier if you
come with a bad example: it's just a fair warning.
-- Si vous avez du temps à perdre :https://scarpet42.gitlab.io