Sunday, September 2, 2012

Week 1 (Wed 8/29 - Sun 9/2)

While the first week of classes usually feels pretty slow, this semester it's been pretty hectic. This is my first time living off campus, and commuting to campus from my apartment every day (sometimes multiple times a day) has been exhausting. I'm trying to work out how I can best spend the time between my classes, which I've never really had to do before since I could just go back to my dorm to work for a while. Additionally, with my new fitness goals this semester, I've been going to the gym more often -- and that hasn't done much to help the fatigue.

Normally, I would wish that Labor Day would come later on in the semester, but this semester I'm happy the first weekend is actually the 3-day weekend.

Preliminary Thoughts on the Class



The class has been pretty fair so far. I'm happy that the class will involve a considerable amount of coding in C++, and I'm also happy that we're not completely abandoning Java, which is far and away my most comfortable language.

I think that learning OOP concepts in a language-agnostic environment will be a good learning experience. By comparing and contrasting C++ and Java we'll be able to explore the key ideas of the OOP paradigm, rather than focusing on how one language happens to deal with things.

From what I know, the OOP implementations in C++ and Java also differ by a considerable amount, and I'm hoping we'll get around to discussing the design decisions that went into each language's implementation of OOP, and what tradeoffs were made in those implementations.

In Class



I was skeptical that the first thing we did in class was to compare a Hello World program in C++ and Java, but I was pleasantly surprised with the level of detail with which we treated that discussion. Seeing the parallels and the differences between the languages, especially in how they deal with symbols and namespaces, was very interesting.

Even though I knew that you could technically leave out the import statements in Java and still have access to all of the libraries, it hadn't occurred to me that the Java import command was analogous to the C++ using namespace... and that there is no Java language feature which is analogous to C++ #include, because package linking in Java, IIRC, is handled at the compile command. I haven't used the command line to compile Java code for a very long time, and I rarely use packages which are not part of the Java standard library, so I'm honestly not sure how that works anymore.

The class definitely got interesting fast when we started discussing the project. I had heard of the Collatz Conjecture before because of a Relevant XKCD, but I hadn't really thought about the problem too much since then.

The fact that an input number will cause the sequence to terminate at 1 means that the sequence eventually reaches a power of 2, seems like a very powerful result. Interestingly, before Prof. Downing made that point, I was thinking about that fact in a binary RegEx (numbers that match /10*/). When Prof. Downing observed that the powers of two act like magnets for the inputs to the sequence, that suddenly made that result seem very powerful.

I'm definitely looking forward to working on the project, once all of the administrative stuff is out of the way.

Foot in Mouth



As a result of my embarrassing post on the class forum requesting specifics on the already well-defined requirements for the first project of the class, I realized that I've been so scatterbrained since moving into my new apartment that I have evidently forgotten how to scroll down (and/or how to read).

To be fair, I looked for those guidelines on the syllabus, and the Sphere problem description, and everywhere else I could think of... Except I never actually SCROLLED DOWN the project page. *FACEPALM*

At any rate, I admit my mistake and I know I won't neglect to read the instructions in the future.

The Project so Far



So, following that incident, I decided it was time to collect my thoughts and just dig in to the project so that I could make some headway and encounter some real problems that I might actually need to ask about.

Startup


I had absolutely no trouble upgrading my GitHub account to a GitHub Student account. It was ready immediately after I provided my school email address.

The Sphere account was also exceedingly easy to set up. I even tried the first problem (http://www.spoj.pl/problems/TEST/) to get a feel for how the system would work.

From using BlogSpot for a blog before, I know that there isn't (or at least, wasn't) a good way to put source code into blog posts here, so I searched around and found Gist (https://gist.github.com/), which lets you format code snippets complete with syntax highlighting and provides an embed link so that you can show your code on any web page, which works really nicely for putting them directly into BlogSpot posts.

So I'm now using the fact that I solved the first problem on Sphere to try pasting a code snippet here. Feel free to comment on anything about this code. I'm still struggling to find the best way to do stream I/O in C++, since there are apparently a lot of ways to read data from streams and the best method varies by the situation.

..

GitHub


My source control of choice has been Mercurial for a long time, since it was built with cross-platform in mind, and it certainly feels that way to use it. It may not be as fast or as flexible as Git, but the fact that it works so smoothly on both Windows and Unix systems, and has a really clean, unified GUI option, as well as a complete CLI, has made it a good choice for a lot of school projects so far.

I have also used Git in the past, but only when working on projects that were started by other people. I hadn't yet set it up on my new computer and I had seriously forgotten how much of a pain in the butt it was to get Git set up on Windows. And even after the setup phase is complete, it's certainly not the easiest tool to use on Windows. That's fine, since I can use it without a problem when I'm remotely logged into my Linux account, or when I'm in the lab.

Still I feel like Git is a somewhat less intuitive tool to use. All the flexibility it offers has caused some of the commands at the core of the workflow to feel a bit clunkier and less intuitive than they could be.

At the end of the day, though, I know that a working knowledge of Git will be very powerful, so I'm going to look at this as a new challenge and really dive into Git this semester. Don't have much of a choice, either, since it's required!

Progress


So far I've set up the respository, edited the README (learned some simple markdown syntax for that), and created issues for all the requirements, and a few other items that came up as I was doing the above.

Issue Tracking


It bothers me that GitHub's issue tracker doesn't have a built-in concept of priority or severity, which is pretty integral to an issue-tracking system. I can see why so many open source projects on GitHub opt to use BugZilla or some other issue tracker.

I learned how to close issues via commit messages. I haven't had a chance to do so yet, but I'm looking forward to giving it a try.

Workflow


Luckily I have some experience with committing often and using an issue tracker, so this is one aspect of the required workflow for the class projects that won't feel utterly foreign to me. Unfortunately, I haven't worked the rest of it out yet so I've felt really cluttered while working on this class, so far.

Confusion


A few items have confused me about this project so far...

  • The requirements state that we're supposed to write unit tests before writing any code, but it seems that the grader's repository for the unit tests isn't up yet. I'm not sure whether I should be writing the unit test code, keeping it in my own repository, and then pushing it to the unit test repository later, especially since that would seem to make the most sense for actually running the unit tests on the code. That would also let me get started on the project sooner rather than later.
  • If we are to complete this project in C++, why are we provided with starter Java files on the project page?

No comments:

Post a Comment