Tuesday, 8 October 2013

Week 3 (OOP & Recursion)

So this week we have a topic! OOP and Recursion!

Well anyways, this week has been tiring and honestly quick hectic. Working on assignment 1, it took wayyy longer time than I expected. The first couple of steps was a breeze but when it came down to solving Tour with 4 cheeses (Reve's Puzzle according to Wolframalpha (which I recommend you to check out)) to be frank was a very difficult problem. Also trying to learn read and learn Tkinter in a week was not exactly easy either. Anyways, I survived and I finished the project, but I did not make Controller.py because if I did, it was purely for the sake of making the class to satisfy the optional requirement and not for saving code (as my Solver and Manual were almost completely different). Enough with this and time to get my opinion on OOP and Recursion (if you care)

OOP is probably the best thing ever. OOP, or object oriented programming, is making a set of code in which it can reused and make multiple instances of by another code. It allows me to make 1 set of code for something and keep reusing the same code with different constructors to get different thing. I honestly don't know how to program large scale program without OOP because that was the only way I learnt how to program. That might be why I don't like Python so much because it (technically) is a scripting language and OOP was added later. OOP is what industries use to make large program as it can then divide up the work into smaller parts. In my opinion, OOP is the only way to go.

Recursion is the idea of calling itself (the function itself) in order to solve a problem. Recursion is very mind boggling in the sense it can make large scale problems into seemingly small ones. An example would be the Tower of Hanoi as the recursion is used to solve this type of problem. It's useful in the sense it can solve problems quite efficiently, but I myself am not very good at it and would prefer to iterate. It is true Recursion is cleaner and a better solution, and in some scenarios the only way to go, but as a student, I still lack the skills into solving problems with recursion, hopefully I'll get better at it. Still very mind boggling every time I make a depth first search with it.


Saturday, 28 September 2013

Week 2

Stacks and Queues are pretty easy to implement in python in comparison to other languages. Although Python is convenient, I still think Java is better. (Still biased). Lab 02 was pretty simple as instead of taking the last element, we just took the pop the first element and voila! a queue instead of a stack. Another thing I learned is its better to import stuff by using (from **** import ****) because importing the filename will require you to write filename.class (), when time can be saved by writing class (). I miss java where it all makes sense :(
>>> from __future__ import braces
SyntaxError: not a chance
:(

Sunday, 22 September 2013

Excerise 1 & Feelings of Python

Well I'm glad MarkUs was fixed during the weekend this week because I was freaking out when I got E1b wrong. Luckily piazza showed everybody also had the same problem. I wasn't sure if we got it all wrong or the system was wrong but after the post on Friday that it was extended to Monday  I was happy I'm not failing university (yet). Ahh the anxiety and panic that was spread on Friday... Anyways I'm still getting used to Python and for now my opinion is it's like the laziest programming language I have done (coming from a Java & C++ background). This imported comic explains how I feel about python right now.