http://www.perlmonks.org?node_id=78015
User since: May 04, 2001 at 20:28 UTC (17 years ago)
Last here: Feb 08, 2013 at 15:34 UTC (5 years ago)
Experience: 694
Level: Pilgrim (8)
Writeups: 55
Location:Bedford, MA/Milford, NH
User's localtime: Jun 18, 2018 at 09:52 -04
Scratchpad: View
For this user:Search nodes

Unless otherwise noted, all code authored by "xphase_work" on perlmonks.org is free software which you can redistribute and/or modify under the same terms as Perl itself.

Everyone has different info on their home nodes, so I'm going to devote mine to music and nasty legacy code.

Here is a list of CD's that are with me at work right now:

Current Music List:

Note: VA stands for various artists

I work at a large DoD contractor, writing perl s‎crip‎ts that modify Ada95 code. Modifying comments, processing SLOC counts, and working with the world's worst IDE: Rational Apex.

Rational Apex is an Ada IDE with a compiler, editor, and CMVC system. It is a horrible program, but I deal with it. I also maintain legacy perl and shell s‎crip‎ts.

Worst Legacy Code of the Week:

Varible names changed to protect the innocent.

From a csh s‎crip‎t:

<snipped.. due to legal and space issues> grep $ss ~$userid/this_path/has/been/changed >&! /dev/null if ($status == 0) then goto next_part endif next_part:
and, in the same file:
<snipped.. due to legal and space issues> else goto finish endif finish: endif end endif
Both of the goto statements are the last case in if statements where, if the code reached that statement, the goto is redundant, as the code would behave that way anyway. Hrm...

Goodie, this is a gem from a perl s‎crip‎t. It's purpost is to prepare a command to run with system, enjoy:

1.@update_things_cmd = qw( 2. /prog/dir/arch/bin/accept_changes 3. -expand_configurations 4. -identical 5. -source); 6.$update_things_cmd = join($",@update_views_cmd);
I added the numbers to prove a point. Line number 2 is used at least 5 times in similar statements, and lines 3,4, and 5 are also used in the same grouping. If this were me I would set line 1 as a var, lines 3 .. 5 as a var, then either run both vars through system(), or set a third var to equal the other 2, but that's me.

Woo, another example from this s‎crip‎t:

########################################## # CHANGE SWITCHES FOR INTEGRATION THINGS ########################################## ###&fix_switches(@int_things); } ########################################## # BUILD INTEGRATION THINGS ##########################################
Notice that little closing brace there inbetween all the comments? What does he close? An if statement over 100 lines earlier. None of the code after the if statement is indented, and the closing brace is hidden inbetween two comments unrelated to the if statement. Fun :-)

--xPhase

<IMG SRC="http://www.pilpre.com/briac/cheesering2.gif">

<A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=previous">previous</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=next">next</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=random">random</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=list">list</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=next5">next5</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=prev5">prev5</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=first">first</A> - <A HREF="http://www.pennine.com/cgi/cheesering.cgi?start=xphase_work&go=last">last</A>

don't blame me for this idea, it's ar0n's fault!