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:
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:+------Sub_class1 Main_class ---+------Sub_class2 +------Sub_class3
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 :Main.pm use base qw(sub_1 sub_2 sub_3); sub_1.pm $self->seek_me(); sub_3.pm sub seek_me{ ## }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |