in reply to Re: Coding styles: OOP vs. Subs
in thread Coding styles: OOP vs. Subs

I rather work with a few files containing a lot of lines of code, than with a lot of files, each containing a few lines of code. My window will give me a local view anyway - typically 36x80 or 48x80. And finding something in the current file is much easier than finding something in a whole bunch of files.

With documentation, it's even worse. A module containing 100 subs will have a large manual - but it's only one manual, and you'll have the right manual right away (because there's only one). Not so with OO. If you want to know the details of a method supplied by a certain class, it could be in the manual of said class, or in any of the fifteen classes it inherits from.

I believe in a middle ground. Too large files become unwieldy. Too large class hierarchies as well. And if I have to choose between the two evils, I pick the large files.

Perl --((8:>*

Replies are listed 'Best First'.
Re^3: Coding styles: OOP vs. Subs
by BrowserUk (Patriarch) on Nov 16, 2005 at 16:33 UTC

    Doesn't your editor support multiple files and global find?

    (I'm not knocking your preferences, just wondering why you hold them if that makes sense).

    The biggest problem with lots of stuff in big files is that I nearly always want to edit one place whilst flicking back forth to a couple of others. Even with an editor that supports multiple views within the same file, it is usually limited number of views (often only two) which doesn't cut it.

    By putting stuff in small(er) files I can switch from one file to another for reference or editing and switch back to where I was in the first, cursor in place and just carry on.

    The ability to save and restore whole sessions of files as a single command line option is invaluable. If only TP would remember where I was in each file it'd make me a happy bunny.

    I use a global search to generate an index to the function, method or variable I am interested in and that allows me to flick between the relevant files easily.

    In the end I guess it's down to how your habits have evolved, but I find huge monolithic files tedious and awkward to deal with.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.