Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
OK. Just some random samples. There are 150k more lines in the project.
Something I noticed on day 1:
if ( $PERMISSIONED_USER_1 ne "" && $PERMISSION_TYPE_1 ne "" ) { # +HTTP POST if ( $PERMISSIONED_USER_1 ne "-1" && $PERMISSION_TYPE_1 ne "-1" ) { # +Web page $AppParameters{'OrderSignedBy_PermR'} = $ThisUser; $AppParameters{'OrderSigned_TS_PermR'} = $Signoff_Now_TimeStamp; $AppParameters{'OrderSignedFor_PermR'} = $PERMISSIONED_USER_1; $AppParameters{'OrderSignedType_PermR'} = $PERMISSION_TYPE_1; if ( $PERMISSIONED_USER_2 != -1 && $PERMISSION_TYPE_2 != -1 ) { $AppParameters{'OrderSignedFor_PermR'} .= "|" . $PERMISSIONED +_USER_2; $AppParameters{'OrderSignedType_PermR'} .= "|" . $PERMISSION_T +YPE_2; if ( $PERMISSIONED_USER_3 != -1 && $PERMISSION_TYPE_3 != -1 ) +{ $AppParameters{'OrderSignedFor_PermR'} .= "|" . $PERMISSI +ONED_USER_3; $AppParameters{'OrderSignedType_PermR'} .= "|" . $PERMISSI +ON_TYPE_3; if ( $PERMISSIONED_USER_4 != -1 && $PERMISSION_TYPE_4 != - +1 ) { $AppParameters{'OrderSignedFor_PermR'} .= "|" . $PERM +ISSIONED_USER_4; $AppParameters{'OrderSignedType_PermR'} .= "|" . $PERM +ISSION_TYPE_4; if ( $PERMISSIONED_USER_5 != -1 && $PERMISSION_TYPE_5 +!= -1 ) { $AppParameters{'OrderSignedFor_PermR'} .= "|" . $ +PERMISSIONED_USER_5; $AppParameters{'OrderSignedType_PermR'} .= "|" . $ +PERMISSION_TYPE_5; if ( $PERMISSIONED_USER_6 != -1 && $PERMISSION_TYP +E_6 != -1 ) { $AppParameters{'OrderSignedFor_PermR'} .= "|" + . $PERMISSIONED_USER_6; $AppParameters{'OrderSignedType_PermR'} .= "|" + . $PERMISSION_TYPE_6; if ( $PERMISSIONED_USER_7 != -1 && $PERMISSION +_TYPE_7 != -1 ) { $AppParameters{'OrderSignedFor_PermR'} .= + "|" . $PERMISSIONED_USER_7; $AppParameters{'OrderSignedType_PermR'} .= + "|" . $PERMISSION_TYPE_7; if ( $PERMISSIONED_USER_8 != -1 && $PERMIS +SION_TYPE_8 != -1 ) { $AppParameters{'OrderSignedFor_PermR'} + .= "|" . $PERMISSIONED_USER_8; $AppParameters{'OrderSignedType_PermR' +} .= "|" . $PERMISSION_TYPE_8; if ( $PERMISSIONED_USER_9 != -1 && $PE +RMISSION_TYPE_9 != -1 ) { $AppParameters{'OrderSignedFor_Per +mR'} .= "|" . $PERMISSIONED_USER_9; $AppParameters{'OrderSignedType_Pe +rmR'} .= "|" . $PERMISSION_TYPE_9; if ( $PERMISSIONED_USER_10 != -1 & +& $PERMISSION_TYPE_10 != -1 ) { $AppParameters{'OrderSignedFor +_PermR'} .= "|" . $PERMISSIONED_USER_10; $AppParameters{'OrderSignedTyp +e_PermR'} .= "|" . $PERMISSION_TYPE_10; } } } } } } } } } } }

And so on. Can you imagine the interview? "What data structure would you use to store 1 to 10 values of the same type?" — "10 variables?" — "Correct!"

Or, a quite common routine to inform the user about failures (notice the lack of a namespace compensated by the _ prefix because of Wrong + Right = Even Worse). The bonus points for anyone who can guess for a given call whether it will also exit or not:

sub OrderProcess_NotifyTheUser { my ( $ErrorStatus, $Message, $AndExit ) = @_; my ( $msg, $vmsg ); if ( $ApplicationName_Long !~ /Initial-Order/i ) { return 0; } #Exit if not the Initial ( ex. Changes ); if ( $ORDERPROCESS_STATUS < 0 ) { $ORDERPROCESS_STATUS = 0; } if ( $AndExit > 0 ) { $ORDERPROCESS_STATUS = $AndExit; + } if ( $ErrorStatus >= 9 ) { $TERMINATE++; $ORDERPROCESS_STATUS = $TERMINATE; } elsif ( $ErrorStatus >= 5 ) { $ERRORS++; } elsif ( $ErrorStatus >= 1 ) { $WARNINGS++; } $msg = $ErrorStatus . '|' . $Message; push( @LOG_MSG, $msg ); $vmsg = 'Time[' . &UnixDate( &ParseDate('Today'), '%H:%M:%S' ) . " +] $Message "; push( @VERBOSE_MSG, $vmsg ); &Log2File( $ErrorStatus, $Message, $Log_Key, $Log_File ); if ( $ProcessType =~ /SCREENPROCESS/i ) { print STDOUT sprintf( $DisplayVia_Browser, $vmsg ); }elsif( $Verbose && $ViaCommandLine ) { print STDOUT "$vmsg $myLF\n"; } # if ( $Verbose && $ViaCommandLine ) { # print STDOUT "$vmsg $myLF\n"; # }elsif ( !$ViaCommandLine && $ProcessType =~ /SCREENPROCESS/i ) { # print STDOUT sprintf( $DisplayVia_Browser, $vmsg ); # } if ( $AndExit && $ViaCommandLine ) { OrderProcess_CustomExit($AndE +xit, $OnExit_callBackSubroutine); } }

Based on the real code. All variable names were changed to prevent any harm to living programmers.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

In reply to Re^5: The Boy Scout Rule by choroba
in thread The Boy Scout Rule by eyepopslikeamosquito

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2021-05-18 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (176 votes). Check out past polls.

    Notices?