This is an Engineering Notebook post. Feel free to ignore unless you are a
dev.
This post describes another surprising rabbit hole associated with
recursive imports. When you are up to your ass in alligators, it's hard to
remember that your original intention was to drain the swamp...
Evil "if" statements arise innocently, but they can create code that is
very difficult to understand and maintain. Not all if statements are evil,
but some are real doozies.
At present, I am wrestling with code in ic.init_import. This method is a
symptom that the import code is way too complex. That by itself isn't too
surprising. import code is inherently tricky.
But the "if" statement that starts with:
if not atAuto and kind != '@auto':
is an abomination. It bit me anew when I changed the atAuto keyword arg to
ic.createOutline. When combined with keyword bool arguments, this "if"
statement is mind-boggling. The flags set by this method strongly effect
ic.create_top_node, as I have learned to my horror ;-)
Here, the solution *might *be to eliminate the "if" statement entirely by
requiring one or more new keyword args to ic.createOutline. This would
require more work in some (all?) callers of ic.createOutline. That's may
be best: the callers know (or should know) what they are doing ;-)
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.