in reply to Re: My Code Is Functional...But Not Tidy :(
in thread My Code Is Functional...But Not Tidy :(

Isn't that what IO::Socket::Inet::new is already doing? I don't see how your factory method would be doing anything different. And for what it's worth, the original poster's code is some of the cleanest Perl I've ever seen.
  • Comment on Re: Re: My Code Is Functional...But Not Tidy :(

Replies are listed 'Best First'.
Re: Re: Re: My Code Is Functional...But Not Tidy :(
by Anonymous Monk on Apr 24, 2003 at 17:50 UTC
    Well, if you integrate configuration files into the factory, your code becomes cleaner. Now lets say you stop using IO::Socket::Inet but switch to something else, you don't have to change from using IO::Socket everywhere, just change how the factory works.
Re3: My Code Is Functional...But Not Tidy :(
by dragonchild (Archbishop) on Apr 24, 2003 at 17:20 UTC
    It is clean, yes. But, it's not very extensible, configurable, or customizable. It doesn't take advantage of shared snippets to make maintenance easier. That's what most of the responses have been about. Taking it to the next level, if that's what's desirable and desired.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.