>>>>> "TM" == Ted Mittelstaedt <t...@mittelstaedt.us> writes:

  TM> On 2/24/2011 12:42 AM, Uri Guttman wrote:

  TM> Uri, I am perfectly aware of what constitutes modern programming
  TM> practice.  And the fact of the matter is that your very wrong, because
  TM> if I was going to rewrite this code the correct way would be to use
  TM> one of the NNTP Perl modules (NNTP Client for example)  The listgroups
  TM> script could probably be replaced by something along the lines of

s/your/you're/

and i know about using the nntp module. but your last post was jusy
about crappy low level socket stuff and that bothered me more. that
isn't even a rewrite or changing the logic. it was one line to replace
about 10 hard to fix lines. drop in replacement is not a rewrite.

  TM> But I will point out that perl modules are built in a pyramid, you
  TM> have ones like NNTPClient that use IO::Socket and that module
  TM> uses Socket and that module uses...what?  Well, it turns out it
  TM> uses the same approach that's in the listgroups.pl script.

IO::Socket is in core perl. it is not a heavy dependency. the issue
isn't whether a module uses other modules but your time wasted fixing
socket stuff that doesn't need fixing. if you thing spending time there
is worth it vs a single line of code, that is your problem. see how well
it does on your resume! :)

  TM> If your answer to a bug in the program is to hack out the
  TM> section and replace it with a module, your basically saying
  TM> that you don't know how the section works.  So your going to
  TM> drop in a black box that does the same as that section.  In
  TM> other words, you don't know how the black box works anymore
  TM> than you know how the section your hacking out works.

bullshit. simple as that. i can hack at any level i feel like having
done it for over 3 decades. i have done massive amounts of socket work
in c and perl. i choose to be lazy and use the right module for the
job. that is a skill i promote when i job hunt.

  TM> And the day that a new platform comes along and the module your
  TM> using blows up on that then you will be just as screwed as I was.
  TM> Worse, probably, because I didn't give up I kept plugging away at
  TM> it.  You won't, you will just complain loudly for the maintainer
  TM> of the IO::Socket module to fix it and do nothing until he does.

huh?? you don't get it. that is basic client socket connection. that
hasn't changed in eons. if you think depending on that is a ball and
chain, you are not worth talking to.

  TM> I'm not proposing that someone take and write a brand new project
  TM> from scratch.

  TM> For new perl code you want to use as many of the WIDELY USED
  TM> modules that have ONGOING SUPPORT as you can.  That is a given.

  TM> But for older, running code that breaks on new platforms, wouldn't
  TM> you rather just correct the bug in it than spend all that time
  TM> rewriting it?

nope. you spent way more time fixing this than even a modest rewrite
would have taken. and i am not even talking nntp here. the reason it
blew up was BECAUSE it did the low level stuff poorly and wasn't
portable. that is what bit you. you have it backwards.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to