2012-07-29

First Experiences with Programming (Part 2)

I forgot to mention near the end of the previous post that the Korean girl pulled out a yogurt drink from her bag and gave it to me as thanks.

One of the better activities in class involved reading code in a previous student's program on the same ATM machine assignment and debugging it.  It compiled, but that's about it.  Something would go awry with the balance or reading from the text file after saving.  The initial hurdle was of course following the code which I found a little too compact for my liking  (and then the solution was to follow it more carefully).  It was rather easy for me to lose my place even though the blocks were indented...with like one to two spaces.  The program also received some hate for making use of try-catch statements which the course didn't cover yet (actually, this course would never get to that part of the book).  "All these comments are in the way!  Why did this guy do all this just to catch an exception and leave a comment saying to do nothing!  What an awful programmer!"

The professor releases the class early (he's done that several times), but we're free to stay and make use of the computers for the remainder of the regular period.  About five or six students were left.  When the professor isn't lecturing he'll usually walk around and check on people as they're engaged in small exercises that are supposed to take five to ten minutes but end up taking way longer than that.  When he arrives at my computer he starts talking about the student's program he gave us and even makes a correction on mine, something he said he found after spending half an hour on it.  It wasn't enough to fix everything, and now I don't know if I would have been perceptive enough to catch what he found.


When I get home I fire up the program and get to work on formatting the code to my liking (which I would recognize way later as the Allman style as presented in the book's code samples, but I've been experimenting with mixing in 1TBS as of late).  I'm sure I won't have that luxury in the future.  It's another two hours of re-reading before I spot the mistake I had been skimming over.  One misplaced line of code.  I send an email to the professor identifying what I fixed along with a before/after screenshot of the problem area.


We received the assignment on Thursday.  Tuesday rolls around, and I can't remember if the debugging task was ever an official assignment.  Maybe he gave up and turned it into a point of extra credit when no one else in the class showed up with an answer.  You'd think a classroom of mostly CS majors would be more enthused about something like this, but they may have merely been trying out the course just like I was.


The final project we did went over a chapter we skipped previously: the GUI, also called the fun chapter by the professor.  He said we'd get to learn about it if we did well on tests and whatnot.  I think he went over it anyway because there was hardly anything left to fulfill in the curriculum.  The topic was straightforward enough: create a GUI version of the ATM assignment everyone supposedly finished.  The professor came to me after class (I usually stay glued to the computer working on something) and offered an alternative assignment of creating a course grade calculator/manager.  I said I'd give it a try.

I drew some pictures of the interface with notes on the side describing the role of each screen and its components.  Saving/loading classes, adding grading categories and weight (along with an 'X' to remove it), forms of leaving notes for individual assignments or automated warnings for missing grades, and of course a grading calculator.  These were all fine and reasonable given the tools I was aware of, but I erred as soon as I pictured different screens.  I couldn't do it.  The book made use of private fields and methods and I didn't want to resort to using the static keyword with everything.  When I tried searching for something similar to what I was looking for I'd be smacked with new terms described by other new terms.  I was burning time, and after a few days I gave up and went back to the ATM assignment.  Which was a little good, because the people I helped earlier needed help again, and now my interests coincided with theirs.


There's a bit I didn't mention about the Asian guy.  Back when it was about the basic ATM machine program I said I didn't do much other than answer questions since he was busy.  Late assignments were still accepted, however.  We met up and I helped talk him through the project.  He had standards and wouldn't let me type the program for him, but I did type alongside him.  It was around this time that a third student would talk to me after seeing us in the study hall and later ask me for help.  This one will be the Indian guy who sits directly to my right.


I think I have some dates mixed up.  I remember receiving the ATM assignment on a Thursday and it was due a week later.  I wouldn't meet the Asian guy until the following Tuesday and then we'd talk over IRC.  When we got together for the assignment I'm sure it was on a Friday, but also before the assignment was due.  And he still turned it in late.  I think the professor gave an extension on it.


Back to the GUI assignment.  I helped all three and pretty much wrote the program three times, not including my own.  We even met together at one point, all four of us, while I typed out the Asian guy's project and answered questions about what I was doing.  I know he objected to me doing it directly previously, but he followed along very well.  As for the Indian guy, he sends me his small bit of code with new opening windows that don't replace the previous ones and expects me to finish it.  Well, he only asked me.  It wasn't a command or anything.  I didn't feel like I was in a position to turn him down, though.  You just want something that properly executes the functions?  You want a GUI full of static fields and endless pop-ups?  Fine, I'll give you that.  Less thinking for me.  It lands him a 95 anyway, and the professor asks him if he enlisted an upperclassman to do the work.


Not much to say for the Korean girl.  Made a version for her and moved on.  There's actually one more person I helped, and this time I'm the one who approached him.  He sat to my left and struck me as a decent and amiable person.  He seemed more easygoing and learned to do tasks well, but neglected to read portions of the book and didn't appear in class a number of times.  Still, I think it was his quiet nature (though he didn't strike me as a deep introvert) that drew me to him.  That makes the final assignment completed four times over.


Overall, it was excellent practice for spotting different mistakes and thinking up new ways to handle algorithms.  I enjoyed attempting to teach the material and asking them to figure out what to look for based on the compiler error messages.  I warned myself not to get dragged into doing other people's work next time, though.  Also just as important was the wealth of social experience that came with it.  I made a point before in the keyboard cleaning post about eating out sparingly, but there were a few exceptions this spring.

It was strange for each of the three people who approached me to treat me out to lunch.  Aside from the free meal I'd normally skip it was a great opportunity to learn about, well, other people.  The Asian guy talked to me about his previous jobs, his daily routine, and his relationship of several years with his girlfriend and what to look out for.  The Indian guy talked about his concurrent jobs, his dreams, and how I should pick up girls (even as a casual friendship) seeing how I admitted to keeping to myself.  "It's easy, man, just ask her if you want to hang out.  See those two girls I was with earlier?  I don't even know them that well.  We just hang out."  He smiled quite a lot and held an optimistic view.  Also, the Asian guy didn't like him because he asked for math help in the past but didn't seem to care about learning.

The Korean girl went into a brief story of her life starting with the move to the US at 14.  She took ESL classes during high school, and what happened during college is fuzzy to me.  She mentioned cliques during high school (and probably college) comprised of people speaking only Korean, but she wanted to distance herself away from them and understand English better by making friends with pretty much anyone else.  Ah, my memory really is terrible.  I can't remember things people tell me that are important to them.  Why she said she didn't have any friends (or she had at least one?), why she worked for a few years before returning.  What job was it, again?  I was just there to listen.  Should I send a message and ask how she's doing?  I don't really send messages to people I've seen in real life.  I think I'll do it soon, before the fall semester is here.  I think.

Still more to go.  Another time.



Also, just because, I want to put up the original debug assignment.  The main program and the account class to go with it.  Aside from a few things it really is quite nice, I think.  The thought process and all.  I would have liked to meet the person (maybe I can ask the professor about contact).  There should only be two problem sections as far as I recall.  Maybe some extras concerning bad practices.

No comments:

Post a Comment