Wednesday, November 03, 2010

debugging for dummy

i'm not a fan of programming. often my program didn't work just because silly-stupid-yet-frustrating mistakes. came up with the idea of this post, after hours of debugging and turned out i just forgot to type a slash. GOD. *rolleyes*

before i make myself more stupid because of these mistakes, i should remember:
1. check related application
sometimes it needs other applications to implement a program. checking of these application should be the first time to do before really work with the program, e.g. is the server running? is the database up?

2. consistency
mistyped the name functions or variables easily happened if many functions/variables are implemented. and if it has a path related variable, should check it too. if we collaborate with other programmer or import an exported project, path inconsistency could be the suspect of error.

3. syntax
obviously. many editor tools can help with the highlight if it wrong typed. but sometimes, the syntax error checking doesn't apply with the context of the program. so, a complete understanding of the program still the main role. other important thing, case sensitivity.

4. using debugging tool

how i love this tool. hail the inventor! usually, if i use an IDE, it comes together with the debugging tool. put a break point and i can trace my program easily.

5. variable tracking

if there's no debugging tool, then variable tracking could be the alternative. put a variable in the part of program that suspected causing error, then see how it goes. echo the variable on the web, write the value, alert, or whatever.

i think that's all from my not-so-much-experience with programming. feel free to add more, geeks! :D

3 komentar:

piqs said...

apa inih, postingan tentang programming? *cek URL* di blog lo??

wastagah, makan apa nak semalem? :P

Zakka Fauzan Muhammad said...

hasil IMSE ini?

Rani said...

@piqs: iyaaaa.. makan kodingan XD
@zakka: bukan lah zak :))