Objects and procedures 16 Jul 2003
Rocky Oliver has a great discussion about Lotusscript coding going on at his site. I must confess to doing very little objected-oriented programming in my Lotusscript, but that's usually because what I'm doing with it doesn't warrant it, and certainly isn't on the scale of complexity that Nathan describes in one of his comments.
It's also a royal pain in the arse in that IDE
So anyway, I tend to leave OOP aside, and stick to being procedural with my script. That said, if you do want to learn more about OOP in Lotusscript, I can thoroughly recommend Doug Tillman's article (found in the January / February 2003 issue of The VIEW) entitled Apply OO Analysis & Best Practices to Build a LotusScript Framework or Bruce Perry's LDD article, Using the object-oriented features of Lotusscript. Both are excellent introductions to getting your brain in gear for this sort of thing.
So, the whys and wherefores: what I think is important, regardless of whether one goes procedural or OOP in one's Lotusscript, is that the code is well-organised. Each method, sub or function should have a clear, well-defined purpose, with a nicely limited scope. As I mentioned in the post about globals a little while back, code works so much better, and is so much more maintenance-friendly when it's self-contained, modular, easy to re-use, and doesn't require the developer to fiddle with its innards (so to speak) once done. Ah, the holy grail…
Rock#
People think you're being the ubercoder, but it's just because I'm too lazy to dig through the help db every second week. And you don't feel like a complete idiot around people who can rattle of arcane syntax in their sleep… "Well *I* have it wrapped in a class, y'know" :-)
I'm beginning to think I missed out on a whole planet of fun by not calling the classes ColinsFunkomaticFileHandlers, though :-)Colin Pretorius#
The comments about the IDE are also very true. I find TeamStudio's Analyzer does a pretty good job of breaking out classes in the Declarations section of a script library.
I highly recommend Robert C. Martin's latest book, "Agile Software Development: Principles, Patterns and Practices". It turns out I've been pretending to program in an object-oriented way for a long time, but after reading this book I'm starting to understand what it's really all about.Nik Shenoy#