What was the ugliest code you were forced to write due to external constraints?

What ugly code did you write - not because you didnโ€™t know better, but because of the limitations of the software, hardware, or company policies?

Due to an unusual choice in database layouts and programming languages, I once created a C program that read in the structure of an SQL database and generated another C program that would read this database and write it to a file or copy to a second database that shares more or less the same columns. It was a monster of clumsy code generators.

+3
source share
6 answers

Any regex. :)

+9
source

90- - Informix Universal Server ( - Illustra)

, , , - .

, , - , Turing, .

http://philip.greenspun.com/wtr/illustra-tips.html

"" if:

cond=$(OR,$(NXST,$email),$(NXST,$name),$(NXST,$subject))

, . . , , , .

edit: . :

<HTML>
<HEAD><TITLE>WINSTART bug</TITLE></HEAD>
<BODY>
<!--- Initialization --->
<?MIVAR NAME=WINSIZE DEFAULT=4>$WINSIZE<?/MIVAR>
<?MIVAR NAME=BEGIN DEFAULT=1>$START<?/MIVAR>

<!--- Definition of Ranges ---->
<?MIVAR NAME=BEGIN>$(IF,$(<,$BEGIN,1),1,$BEGIN)<?/MIVAR>
<?MIVAR NAME=END>$(+,$BEGIN,$WINSIZE)<?/MIVAR>
<!--- Execution --->
<TABLE BORDER>
<?MISQL WINSTART=$BEGIN WINSIZE=$WINSIZE
    SQL="select tabname from systables where tabname like 'web%' 
        order by tabname;">
    <TR><TD>$1</TD></TR>
<?/MISQL>
</TABLE>
<BR>
<?MIBLOCK COND="$(>,$BEGIN,1)">
    <?MIVAR>
    <A HREF=$WEB_HOME?MIval=WINWALK&START=$(-,$BEGIN,$WINSIZE)&WINSIZE=$WINSIZE>
    Previous $WINSIZE Rows </A> $(IF,$(<,$MI_ROWCOUNT,$WINSIZE), No More Rows,  )
    <?/MIVAR>
<?/MIBLOCK>
<?MIBLOCK COND="$(AND,$(>,$END,$WINSIZE),$(>=,$MI_ROWCOUNT,$WINSIZE))">
    <?MIVAR>
    <A HREF=$WEB_HOME?MIval=WINWALK&START=$END&WINSIZE=$WINSIZE>
    Next $WINSIZE Rows  </A>
    <?/MIVAR>
<?/MIBLOCK>
</BODY>

+6

- , COBOL, Visual Basic. VB, .

, , .

, VB, 100 , . , , , .

+2

( ). , , , .

. , .

0

, . , , . "" :

if (InputString == "01")) 
         { Output.ClientID = Input.Address;}
else if ((InputString = "02") && (Input.Address == null) &&(Input.ClientID < 1300))
        { Output.ClientID = Input.ClientID +1;}
else if (Input.ClientID = 0 ) 
        { Input.ClientID = 2084; }

, .

-... , .

0

. - 2000- , - .

, . , PDF , - . . PDF , . , PDF .

, , , PDF, . , .

0
source

All Articles