[Python-Dev] Split unicodeobject.c into subfiles? (original) (raw)

Chris Angelico rosuav at gmail.com
Sun Oct 7 23:33:57 CEST 2012


On Mon, Oct 8, 2012 at 8:17 AM, Victor Stinner <victor.stinner at gmail.com> wrote:

Another problem with huge files is to handle "dependencies" with static functions. If the function A calls the function B which calls the function C, you have to order A, B and C "correctly" if these functions are private and not declared at the top of the file.

If functions are grouped correctly, you just lhave to add the function to the right file, or reorder the files.

This isn't a fundamental problem, since you can always declare a private function if it's mutually recursive with another private function. But - forgive me if this is false in CPython - this isn't usually that common. Also, ordering the functions in (at least an approximation of) Define Before Use makes it easy to locate the one you're calling, even in a non-smart editor: just go to the top of the file and search for the function's name; the first hit will be the definition. It's not usually difficult to sort functions appropriately, and can pay dividends in readability.

ChrisA



More information about the Python-Dev mailing list