http://www.perlmonks.org?node_id=497748


in reply to Name spaces and Perl::Tk coding style

You are correct, put it into modules if you can. When I wrote an app with Win32::GUI I found myself constantly frustrated with scrolling through so much of the init code. Pages and pages just to setup the windows and labels. When I put it into modules it was easier to work with, but then I went overboard. I started trying to make it too much of a general purpose module for GUI apps, it got too complex, and got pushed back to the end of my "to work on later" list, and I haven't thought about it in years.

Ah, so much wasted code, never to see the light of day...

Replies are listed 'Best First'.
Re^2: Name spaces and Perl::Tk coding style
by TGI (Parson) on Oct 05, 2005 at 22:12 UTC

    I've been bitten by the excessive generality bug a few times as well. It's the easiest way to never finish a project. I've done in a few projects this way myself--on the good side, I learned a lot while doing it.

    My app is currently weighing in at around 3000 lines of code (including whitespace and comments, but not counting the libraries I wrote for backend stuff). It's just too damn big to navigate around easily. Amazingly, it is maintainable, I was able to get in and make some changes after 8 months away from working on it without too much pain. Let's hear it for good documentation practices.

    Any thoughts on the namespace issue? I'm planning on keeping the libraries in the same directory with the script, so top level names are OK. I'm leaning towards MyApp::PhoneList and MyApp::DisplayData and so forth.


    TGI says moo