On Mon, Dec 9, 2013 at 2:15 PM, Jacob Peck <[email protected]> wrote:
> On a semi-related note, the Leo API is a bit inconsistent too, if only in > it's alternating usage of underscore_delimited and camelCase method names. > Though I suppose that's an artifact of 20 years of development with no > (explicit) style guidelines. Organically growing APIs always have rough > spots like this. > Yes. I would love to have (most of) Leo's code base be compatible with pep 8: http://www.python.org/dev/peps/pep-0008/#naming-conventions However, there are serious practical problems: 1. pep 8 says: do not break backwards compatibility just to comply with this PEP! Backward compatibility with non-public plugins and scripts would require assignments such as: legacy_name = pep_8_compatible_name for all name changes that have any likelihood of being used in plugins or user-written scripts. It's hard to know who might have been using any name, so almost all legacy names might require such assignments. 2. I have no intention ever of making pep-8-related changes by hand. That way many bugs (and madness) lies. I know of no program that *reliably* makes such changes over an entire code base. By reliably, I mean safely (preserving meaning) and consistently (preserving whitespace). I actually think that a text-based (rather than a syntax tree) approach makes sense. I have a right to this opinion: I have studied lib2to3 in detail and my stc work has made me intimately familiar with ast's (abstract syntax trees) and Python's ast module. In short, while I am myself often irritated with the mishmash of naming styles in Leo's code base, fixing the problem requires substantial programming work. Because of compatibility reasons it will be impossible to eliminate many (most?) old symbols. This is unfortunate, as it will complicate searches even after the grand renaming has taken place. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.
