Blog week 11
This week is the last but one week before the final project due, we have been super busy with the coding and construction of the website. And i, personally, as the guy in charge of all the core tech issues, was so dreadful building it and debugging. It is really hard debugging all those code, but at the same time, I believe I learned most as well.After succeed in pulling all the data from four databases, i am now trying to merge all four different scripts into one. It looks and sounds pretty easy, like just copy and paste all the code into one file. However, things went wrong when they are all together.
The first problem i met was that two databases were loaded when the page is first loaded, and the third database will be loaded if the page is refreshed again, and so is the fourth database. And the console keeps giving me the error that null value cannot be proceed, which is a total nonsense as when i console.log the data in console, none of they are null and is being proceed perfectly.
Later, with the help of tutor, we found out that it's the place where i called the javascript file is incorrect, as soon as i placed it after i called google map api, everything went beautiful.
click on the error and the browser showed me where went wrong (although did not help much but still useful)
After all the struggle, the code worked out! Beautiful.

And i refined the code of the last part (deleted the if-else statement) so that we can reduce the chance of errors. And yes it did!
And there is another error caused by the redundant code (i forgot to delete some of the testing developing code). And it took me bloody two hours to figure out where went wrong. And i'm so glad that it's solved.

And after this giant milestone, all of my teammates are motivated to do stuff now and i'm so glad to see that most people are collaborating again!
REFLECTION:
Debugging is the hardest part. Constructing is hard, but not as hard as debugging, and a lot of times console can help point out the errors, but they are sometimes mis-located because one small piece of code led to a much bigger scale error. And this kind of situation makes it super hard to debug.
Another thing i learned is how to use google, it's not just copy and paste the code to google, it's more about learning how to ask the question. A way of asking it that is most likely to get the answer i want.



Comments
Post a Comment