|
|
|
| /* Deutsche Ausgabe */ |
| « Webdienste à la Großmutter | Wieso ist keiner zuvor auf diese Idee gekommen? » |
Normalerweise kommt man mit $300 nicht besonders weit, wenn es um maßgeschneiderte Software geht. Mit viel Glück reicht es gerade um einen Tippfehler in einer Anwendung, die bereits im Produktivbetrieb ist, auszubessern. Heutzutage allerdings, wenn jedermann über IT-Projektbörsen (siehe What the Spec?!?) an gewisse Entwickler aus gewissen fremden Ländern kommt, kann man mit $300 sogar gewaltige Sprüngen machen. Natürlich nicht gewaltig genug für Software, die auch tatsächlich funktioniert, aber sicherlich weit genug um Unmengen von kaputtem und wertlosem Code zu bekommen. Diese Erfahrung musste zumindest Christophers Kunde machen.
Christophers Kunde ist eine große (unter den fünf größten) Werbeagentur, die ursprünglich für eine Umfragesoftware eine Ausschreibung auf einer IT-Projektbörse platziert hatte. Nachdem wenige Monate vergangen und $300 ausgegeben worden sind, hatten sie etwa 500 PHP-Dateien - von denen 31 nur Klassendateien ohne irgendwelche Member waren - und ein Datenbank-Schema, in dem alle Felder ihre Daten als VARCHAR speicherten. Alles davon war „fast fertig“. Glücklicherweise hatten sie da noch Christopher, der es für sie „debuggen“ sollte.
Nachdem viele Monate vergangen waren und ganz gewiss mehr als $300 ausgegeben worden sind, hatte Christopher es geschafft, das ganze „größtenteils fertig“ zu kriegen. Von allen Dingen, die verschwinden mussten, als Christopher „refaktorierte“, gehörte die folgende Methode zum nochmaligen Anzeigen eines Formulars zu den Perlen:
<td class='txt_label' valign='top'>
<?php
if($_SESSION["EducationID"]==Null)
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="" checked>No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="High school")
{
?>
<input type="radio" name="EducationID" value="High school" checked>High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="Some college")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college" checked>Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="In college")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college" checked>In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="College graduate")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate" checked>College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="Grad / professional school")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school" checked>Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="Post grad")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad" checked>Post grad<br>
<input type="radio" name="EducationID" value="">No Answer<br>
<?php
}
?>
<?php
if($_SESSION["EducationID"]=="No Answer")
{
?>
<input type="radio" name="EducationID" value="High school">High school<br>
<input type="radio" name="EducationID" value="Some college">Some college<br>
<input type="radio" name="EducationID" value="In college">In college<br>
<input type="radio" name="EducationID" value="College graduate">College graduate<br>
<input type="radio" name="EducationID" value="Grad / professional school">Grad / professional school<br>
<input type="radio" name="EducationID" value="Post grad">Post grad<br>
<input type="radio" name="EducationID" value="" checked>No Answer<br>
<?php
}
?>
</td>
(Übersetzt von Florian Heinle)
| « Webdienste à la Großmutter | Wieso ist keiner zuvor auf diese Idee gekommen? » |