Friday, February 19, 2016

Entry 4: Week 6: Reading Week Freaking Week

And so I resort to blogging on Fridays.

Next week is Week 7, we will be starting recursions, and so I have to update by Thursday to print the entry out. Okay. Got it. Mental noted.

As opposed to actually having reading week to catch up on reading, I found myself doing more work. Huh. But all's well, because computer science is being worked on -- especially A1.

To be honest in some aspects A1 is easier than I thought, but in others, harder. The complexity of the code actually needed to be written wasn't as bad, but the "figuring out" what to write part was worse. Actually reading the whole document, mapping the thoughts out, and clearing up which module belongs where takes up quite some time. The tips here is to DRAW LOTS OF PICTURE!!! Okay maybe not pictures of little cars and little people, but definitely flowcharts and diagrams of classes, objects, and their connections. Especially when two classes can share a common attribute or subject, but in actuality said thing can only belong to one of them.

We are quite lucky that many of the APIs are given to direct us in the correct direction, but finishing them up are sometimes also a handful. MAKE SURE TO COMPLETE THEM!!! It gives readers and everyone else (even the coder as they come back to this program) a lot of readability.

There isn't much to say while coding, other than KEEP YOUR CODE AS SIMPLIFIED AS POSSIBLE. This is for running and reading code. Why complicate it when it could save so much space/run time/read time? Although, for a relatively smaller program like this, it is arguable to have code executable in one line written out in several lines for clarity, but I feel that it is best to simplify everything as much as possible. For this assignment, there shouldn't be a lot of hard coding in my opinion, especially for the first few classes.

TEST AS YOU GO! After writing code for a section, it is essential to test them. As much as I had complained about unittest in my previous post, I cannot deny how useful they are -- especially as programs grow larger and larger and it's almost impossible to test but simple doctests and feeding code in through the program by hand like a little baby. I found that I actually wanted to do unittests after I finish bigger classes like Events and even Dispatcher. However, unittests are extremely time consuming, so I would suggest NOT doing that unless you are sure you have enough time, or shorten them and test only the most essential cases.

Last but not least, a progress update. My group and I did originally WANT to finish the programming by this week, but it turned out to be more than we thought, given there were so many other subjects to do. However, here's a # TODO list:
- test Events; - do Simulation.py + test; - do Monitor.py + test
I'd say we are "almost" done, but those two being the two harder classes, I'd say we are ~1/3 way to go.

No comments:

Post a Comment