in reply to Paid for crap
The gotos and lack of return statements and in fact the general coding style strongly suggest to me that it was transliterated from (bad) VB, by a not very experienced VB or Perl programmer. (I might have said Pascal but using gotos is not Pascal)
The whole assign to $_[0] as a return is strongly reminiscent of the VB concept of assigning to the function name for setting a functions return value, likewise VB (pre dotNet anyway) doesnt have a return statement, and normally relies on goto on err type logic for exception handling. Both routines have all of these characteristics.
BTW, many of these issues are older design concepts that have long since been rejected as being generally bad ideas. Using the function name as a pseudo variable makes recursive calls a bit tricky to deal with, and long ago it was realized that the Pascal-esq single-point-of-entry, single-point-of-exit philosophy just created more problems than it solved (despite being an excellent way to teach disciplined programming, all you bottom sub'ers would get killed by Pascal). Relaxing it to Single-point-of-entry, multiple-points-of-exit (as perl does) makes for a much more "natural" feel, and avoids a whole host of bogosity, like the loop and a half problem, and avoids silly programming habits, some of which are well demonstrated in your WTF code.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Paid for crap
by wazoox (Prior) on Jan 25, 2007 at 21:28 UTC | |
by demerphq (Chancellor) on Jan 26, 2007 at 13:05 UTC | |
by wazoox (Prior) on Jan 27, 2007 at 12:35 UTC |