UP Computer Science Interns' Blog

May 6, 2010

Friday Treats

Filed under: crs_200700292 — alegriaclan @ 12:25 am

The Model part for my module was given to me last Wednesday. (recall that CRS is using Model-View-Controller design pattern :-b and we were assigned only to create the view and controller part for the modules yet). By Friday, I was assuring that my module has perfectly no bugs.

Then I noticed when I view the page source, that there was a PHP error, since I didn’t really checked an array if it was empty or set before accessing its content. I checked my code and put the necessary corrections and checking’s for other arrays I used. I think it’s okay …. But wait there’s more! When I checked the error console, there is also an error in javascript part. I looked for the line number indicated (hmmm line no. 72?) it said there’s an undefined variable. Okay! Where’s line no. 72?  (I checked in my code…) There was it!!! Hmmm I was perplexed I thought I declare it as global. Joan was at my side that time…and I consulted her… she said maybe it was not initialized…Hmmm it should have been by that time since I used AJAX… Rarrrrr! It has been 30 minutes…What’s wrong, it if it was not initialized then why does it seems to be working?!  Then I realized,( I don’t know how)… huh! I was looking at the wrong variable! The line number indicated in the error console was not the line number in my code! It was in the page source and it just so happened that I used that same variable at that particular line in my code. I fixed the bug… and test the module again and again…”Okay I think I’m really done! Hope everything will be okay! Please please please XD

Wooh…I realized that it was hard to see the errors when using “webpage” code…It seems to display everything correctly. The errors were not obvious. And one more thing, it’s hard to fix the error if there was really no error! XD

At the end of the day…Sir Kyl and Ma’am Via had given us a Pizza Treat!  Yahoo! Thanksssss!

Hmmm… I don’t know if it’s just me who noticed, but every Friday it always happens to have delicious treats and I always go home full! Let’s see if the record will keep on this week! Yummy! (^_^)

– ‘A’

Advertisements

Create a free website or blog at WordPress.com.

%d bloggers like this: