Sympathisant: 100 Signs that I May Be Writing Spaghetti Code - PART II

Beitrag lesen

Hai,

49. On the weekend you find yourself testing the effects of gzip on include files.

48. The white board in your office is clean.

47. You've run out of meaningful variable names, and you are now reduced to using the names of family pets.

46. The ratio between the number of variable names, and the number of field names in the database, is 5 to 1

45. You realize that the only differance between three functions is the number of variables being passed.

44. You realize that you are changing global variables with functions inside include files

43. Your SQL statments have SELECT * in them

42. You know that the algorythm you just created to check the data coming back from the database is a O((N2 -N)/2) .. but you just don't care anymore.

41. While writing a new function, you are background thinking justifications for the last one you just wrote.

40: You surf over to WW to see how many queries per page others dare to use & scoff at the low number.

39: you plan your vacation using if-else complete with curly brackets.

38. You've worn paint off the "$" and "4" key on your keyboard.

37. You are using classes, but create a "miscellaneous" class where you put all those odds and ends. Finally you realize the "misc" class has become your main class and needs to be included in every script.

36. You create a separate class for every single function.

35. You have an include file called "stuff.inc"

34. Your for loop pops a query and sends the results to a funtion, which runs a for loop across the array you sent with the results from the query, sending the 3, 5 and 10 cells to seperate funtions, and formats the htmml for the 1, 2, 4, 5, 6, 7, 9 values of the array, sending those to a function, which has a for loop, ...

33. You have come up with 5 blistering hot ideas for the program you are working on, which have taken you the last 3 weeks to bring to reality, only to find, now that they are all working, and they work even better than you could have imagined 3 weeks ago, they also block the original functionality of the program spec, and are in conflict with the main idea of the client.

32. Your hands are bruised and cut from the shards of exploding classes after hours of trying to shove the client’s feature requests, into your well thought out architecture.

31. You have no idea what a CRC Card is ...

31. You don't understand classes.

31. You can't count down from 100.

30. You know someone else is writing spaghetti code when.... you find

if (1==0) {  
...  
}

29. When you have more cases then a court house

28: reading this list you think.. "Hmmm what's so bad about that? Or that? Or that?

27. Infinitely cascading includes like:

index.php:

<?php include("menu.php");?>  
...  
menu.php:  
<?php include("navigation.php");?>  
...  
navigation.php:  
<?php include("newmenu.php");?>  
...  
newmenu.php:  
<?php include("newmenu_final.php");?>  
...  
newmenu_final.php:  
<?php include("menu_newer_version.php");?>  
... etc

26. if your included file "stuff.inc" has become deprecated in favour of "newer-stuff.inc"

25. Parse error: parse error in /home/index.php on line 140
20 minutes later
Parse error: parse error in /home/index.php on line 141
20 minutes later
Parse error: parse error in /home/index.php on line 142

24. When the first line of your code is:
ini_set(max_execution_time,"99999");

23. And the last line of your codes is:
ini_set(max_execution_time,"30");

22. When you open the same db 11 times in the same file.

21. When you have to do your includes in a page being called as in mypage.php?page=somedullpage.

20. You include a file that includes the original file...

<!-- file1.php -->  
<? include("file2.php"); //other stuff?>  
  
<!-- file2.php -->  
<? echo "stuff"; include("file1.php");?>

19. You have so many custom fucntions that you try to redifine the nl2br function

18. You have so many custom functions that the WhatDoTheseFunctionsDo.txt file is 20MB

17. Your kids understand the code...after college.

16. You have to grep for all occurences of include() or require() and replace them with include_once() and require_once() just to get your app to run.

15. You're still using extract, cause well, those security folks are all just anal anyways.

14. You need to write a Perl script to check your PHP code.

13. When your orignal project was to recreate a windows desktop application in php/html/javascript to run on windows desktops.

12.You start trying to recreat a windows app with php...and end up making another form to e-mail app.

11. You realise you have three functions with the exactly the same name, but which do completely different things, scattered across several includes.

10. When your control script forgets that it is handling the return from one of many scripts it calls and re initializes all the vars... and you don't figure it out for a month.

9. You have read through this whole thread so far and said to yourself "I don't do any of those" and patted yourself on the back.

8. You've read this whole thread and patted yourself on the back for only doing half of them.

7. You post your code to WW looking for some answers and the responses run longer then the Google update threads.

6. goto 5.

5. GOSUB 100:REM In case we missed anything on the first pass...

4.

if ($status == "awake"){  
$actitivity = "Writing spaghetti code";  
}elseif($healthstatus == "OK"){  
$activity = "Sleep";  
}else{  
print "CALL 911 IMMEDIATELY!";  
}

3. You work alone, but have to use CVS to keep track of your project.

2. You took over a project that was so convoluted you had to just scrap it and start over. Now, after three weeks, you find you have the exact same directory structure as the original and most filenames are the same.

1. You've been watching this thread the entire time and haven't thought of a single thing you could add.

;-)

Fehler
Sie sind wohl etwas geschwätzig?

PS: Hehe.. die Forumssoftware wirft mir vor, ich sei zu geschwaetzig ;-) Daher die Unterteilung in zwei Posts..

MfG,
Sympatisant
--
"Only half the World is Teflon and Asbestos, the Rest is burnable"

MfG,
Sympatisant

--
"Only half the World is Teflon and Asbestos, the Rest is burnable"