hello monks,

today i decided to bug you with some writing style tips. as it turns out so far all the programs i have developed were for company use only and no code left (officially) the company premises. so the writing practice wasn't actually the issue as long as me and my colleges were able to use the code. but now we think the code could actually be useful for wider crowd, so the formating could become an issue.

Let me first give you an example of the writing style i used so far. my code would be divided into classes like:

+------Sub_class1 Main_class ---+------Sub_class2 +------Sub_class3
and i was forcing that any class that was ever made had an interface in the main class if a user wants to use it. as an outcome much less code was needed to produce since some objects were actually inherited from previous classes. also this practice proved to be very nice way to organize the code and structured logs that every class was specific for. But.... as an nasty nus-product a very complicated object inheritance network was produced .so you can basically say that all the sub_classes are not actually the general type of classes that a programmer would expect (they could not act as a self standing 'objects'). oh yea, and all the inheritance is done over the main_class, so that any sub_class actually doesn't know form where it inherits the object method that it is using. example:
Main.pm use base qw(sub_1 sub_2 sub_3); sub_1.pm $self->seek_me(); sub_3.pm sub seek_me{ ## }
so basically what i have is a one main class that cannot completely function without all the sub_classes and any sub_class probably cannot function without the main+sub_... class(basically one class divided into a number of small script). my question now is :

How pissed would you be if you had to work with something like that ?????

the code is commented and more or less neat , but the problem emerges when you wish to extract a method into a separate class. if you didn't collect all the needed methods that your method requires you are scr....! and the methods are God knows where!!!

Thnx!!

UPDATE

Thnx ppl, well i must admit I was hoping for an answer :-"Oh ye sure, that's ok, don't sweat it...."

but these comments were more helpful and informative!!!

I'll look into Moose!!

Thnx!


In reply to perl writing tips needed by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.