-D31, M01, Y15-
Welcome back! Something may feel different since the last time you were here--presuming you have been here before. What could it possibly be? The entire display has been revamped. That's what it is. No, I will not be focusing my future blog posts upon the topic of the Medieval Ages (although that is quite tempting); however, I will be taking the time today to speak of my experience so far in my computer science course.
+ First off, I was tasked with creating not only a text-based Python game, but also with creating the game environment in which the game--and others similar to it--could be played. For those with minimal programming experience, think of it as creating the Main Menu screen of a 3-in-1 game and then making one of the 3 games.
I must say, it was quite challenging to do alone. I have had experience creating games in the past; however, those did not require object-oriented programming. At least, not in as direct a way as was required for this assignment.
All in all, I feel as though I should make an effort to work with a partner in future assignments, not merely to help distribute the workload, but to possibly understand what it means to work as a team on a single project. Not many programmers work alone, so obtaining some experience--and possibly more programming friends--would be a good idea.
+ Second, Recursion. Wow. Basically, create a function and then use that function inside its own code. It drives me nuts. Yes, I have no trouble tracing through recursion code...but when tasked with creating one that does nothing more than return the largest list length out of an argument that is a list of a list of a list of integers...NO. Nothing I attempted worked. The fact that it calls itself within itself is just preposterous. How do you keep track of all those lists if the function calls itself after taking note of one list in order to deal with a list inside the previous list?
See? I don't. I intend to research this further unless more is taught in class.
+ And third, I am somewhat put off by the style of teaching. A large amount of it revolves around teaching concepts through showing examples of code in class in combination with online course notes. For some reason, it does not really feel like learning. Now of course, there is a probability that this is a good thing--that I am enjoying what I am learning. I loath the idea that I should base how much I have learned upon how well I do on future tests; but the educational system in place presently leaves me little choice. Regardless, I intend to put my knowledge and skills to work after the semester ends by creating game apps for Android as a more competent way of assessing what I have learned.
Thank you for reading.
Saturday, 31 January 2015
Saturday, 24 January 2015
Code Note
-D24, M01, Y15-
Hello and welcome back to another exciting edition of this blog. This time around, I shall be stepping away from mathematical expressions and reasoning to focus upon programming itself. Over the past week or so, I have read a number of articles and blogs concerning the necessity of having such a blog.
From my perspective, a blog--as in, an internet-based journal of sorts--is not necessary; rather, a way of keeping track of one's programming endeavors is. Last year, when I first began to program seriously, I kept track of my problems via 'ye olde and relyable' pencil and paper. It would consist of written out code, which I would implement in a programming environment (known as Wing), in addition to crossed out lines of code, comments scrawled around it and within it, and various diagrams and sketches depicting both what I desired the code to do and my varying reactions as the code itself failed and/or succeeded.
Especially important was writing down exactly what caused the error(s)--less important were the excess words I employed to berate myself in the cases where I had merely misspelt code or forgotten some key characteristic of, say, a dictionary.
In doing this last semester, I assured that I would not make the same mistakes again, either from memory, or by simply referencing my previous writings.
In sum, documentation is key to effective coding. Now, it is important to note, as Mr. Mark Dalrymple did, that, when coding for clients, a computer scientist should transfer such documentation to a secure file of some sort in the event that the terms and conditions of the job require it to be sent to the client.
Until then, I shall document the bulk of my bugs and solutions on paper...and post the most notable of them on this blog. Last week, I came across a notable bug that angered me quite a bit, so here it is:
--------------------------------------------------------------------------------------------------------------------------
Problem: when initiating a class with only one argument (self) along with an instance variable creating a dictionary, Python declared that said instance variable did not exist. An AttributeError.
Solving-Process:
After indignantly shaking my head at the object's failure, I call it a few more times to be certain. Indeed, something is wrong. Try adding the instance variable as an argument? Of course that works, but not the way the object ought to. I need the object to initiate it's own empty dictionary, empty list, etc., without an additional argument!
ARGH.
All my notes say I am right. What is this?
Finally decide to speak to a fellow computer science student also taking this course, I shall call him T. T's code worked correctly and after a single comparison, I was certain that my code was structured in a nearly identical way. There are only so many ways to write an __init__ method for an object at this point in time. I shall call my code one more time.
FIX: I forgot the ending parentheses for the object consistently until this point.
This is beyond embarrassing. Never again. At least it is solved.
--------------------------------------------------------------------------------------------------------------------------
Thanks for reading, I hope I elicited a chuckle of some sort at my own expense.
Hello and welcome back to another exciting edition of this blog. This time around, I shall be stepping away from mathematical expressions and reasoning to focus upon programming itself. Over the past week or so, I have read a number of articles and blogs concerning the necessity of having such a blog.
From my perspective, a blog--as in, an internet-based journal of sorts--is not necessary; rather, a way of keeping track of one's programming endeavors is. Last year, when I first began to program seriously, I kept track of my problems via 'ye olde and relyable' pencil and paper. It would consist of written out code, which I would implement in a programming environment (known as Wing), in addition to crossed out lines of code, comments scrawled around it and within it, and various diagrams and sketches depicting both what I desired the code to do and my varying reactions as the code itself failed and/or succeeded.
Especially important was writing down exactly what caused the error(s)--less important were the excess words I employed to berate myself in the cases where I had merely misspelt code or forgotten some key characteristic of, say, a dictionary.
In doing this last semester, I assured that I would not make the same mistakes again, either from memory, or by simply referencing my previous writings.
In sum, documentation is key to effective coding. Now, it is important to note, as Mr. Mark Dalrymple did, that, when coding for clients, a computer scientist should transfer such documentation to a secure file of some sort in the event that the terms and conditions of the job require it to be sent to the client.
Until then, I shall document the bulk of my bugs and solutions on paper...and post the most notable of them on this blog. Last week, I came across a notable bug that angered me quite a bit, so here it is:
--------------------------------------------------------------------------------------------------------------------------
Problem: when initiating a class with only one argument (self) along with an instance variable creating a dictionary, Python declared that said instance variable did not exist. An AttributeError.
Solving-Process:
After indignantly shaking my head at the object's failure, I call it a few more times to be certain. Indeed, something is wrong. Try adding the instance variable as an argument? Of course that works, but not the way the object ought to. I need the object to initiate it's own empty dictionary, empty list, etc., without an additional argument!
ARGH.
All my notes say I am right. What is this?
Finally decide to speak to a fellow computer science student also taking this course, I shall call him T. T's code worked correctly and after a single comparison, I was certain that my code was structured in a nearly identical way. There are only so many ways to write an __init__ method for an object at this point in time. I shall call my code one more time.
FIX: I forgot the ending parentheses for the object consistently until this point.
This is beyond embarrassing. Never again. At least it is solved.
--------------------------------------------------------------------------------------------------------------------------
Thanks for reading, I hope I elicited a chuckle of some sort at my own expense.
Subscribe to:
Posts (Atom)