boB Stepp <robertvst...@gmail.com> writes: > I'm still working in the procedural paradigm of programming. Hopefully > I will find time for OOP soon.
Fortunately, with Python, you're almost always doing OOP because all Python values are accessed as objects :-) But I think you mean you're not yet writing classes. > But in some of my modules-in-progress,my collection of functions has > gotten large enough that I feel I need to bring some sort of order to > their positioning. Currently my best thought is to mimic the natural > order, in so far as it is possible, in which the functions get called. > Are there better ways to organize them? You can migrate a step further to writing classes: organise your code by *conceptual proximity*. Functions that are very closely related conceptually get placed close together, and the data structures and constants they use are also placed nearby. Use a page break (the U+000C FORM FEED) white space character on a line by itself, to break up the source code into conceptually-separate areas. Your text editor should have a way of navigating to the previous/next form-feed character, as a way of navigating your file at this level. Deliberately start organising your code so conceptually-related code is closer together, and you'll find it more natural when you begin writing classes. -- \ “Repetition leads to boredom, boredom to horrifying mistakes, | `\ horrifying mistakes to God-I-wish-I-was-still-bored, and it | _o__) goes downhill from there.” —Will Larson, 2008-11-04 | Ben Finney _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor