By Osmose
I once worked on a website that analyzed Python code in order to index it into elasticsearch for structural search queries (things like “find me all classes that inherit from SomeBaseClass”). Python’s built-in ast library outputs a tree for you to traverse, and even with their provided tree walker you still deal with the internals of the tree and recursion.
Furthermore, part of our indexing needed to follow imports to find the canonical name of a value, which is a problem very well suited to a recursive solution.
You may not have encountered these situations where recursion and trees have to be dealt with, but they absolutely exist.
See more about this article by clicking the link here: https://news.ycombinator.com/item?id=10132704
Osmose comments on "How recursion got into programming: a comedy of errors"
No comments:
Post a Comment