Sunday, January 29, 2012

First steps...

Hello everybody, my name is Cole Stewart and this is the first post of my blog that will be a "learning journal" of things taught in CS 371p, Object-Oriented Programming, with Professor Downing. As of this moment, I have had about a week and a half in the class, and I can already see that it is going to be an interesting, albeit intense, time absorbing the techniques, skills, and knowledge this class has to offer. The primary focus of this last week was a variant of the Collatz conjecture, which me and the other students have to solve using both Java and C++. The process is as follows:

Take any number n.
If n is even, divide the number by 2. (n/2)
If n is odd, multiply the number by 3 and add . (3n + 1)

The conjecture basically states that the process will always reach 1. While it has not been correctly proven that all positive integers reach one, my tests have shown that many in fact do, although it would be impossible to test every possible positive number. 

Our variation of the problem consisted of finding the max cycle length over a positive range, with cycle length being the number of iterations the process takes to reach one. In order to complete this problem we are being asked to use a tool called Sphere which is essentially an online judge that will compile code and run a set of tests on it to determine whether it passes requirements for a certain problem. It is very interesting to see how various optimizations in the code will either decrease running time, increase running time, and how my code fairs against other's. On top of using the Sphere Online Judge tool, we are being asked to use many other online tools, such as the git repository hosting available at Assembla and the issue tracker available from Google.  I have had previous experience with git, so that is not much of a problem, but using an issue tracker, and how to use one efficiently is new to me. It seems it is providing a very nice way to coordinate issues in a project, whether the issues be in code or things that need to be done. It is also important to note that Google also provides tools for project hosting like that at Assembla, but it forces the user to use a set of tools provided by Google, and to abide by a number of other limitations that make it unsuitable for our purposes. 

Mainly, for this project getting to see the difference in efficiency between the use of Java vs. C++ has been much of a shocker to me. My experience with C++ is minimal, and getting to observe the variations in running times and memory usage has been much of an eye-opening experience. For much of my Computer Science career here at the University of Texas at Austin I have been forced to mainly do projects in Java's handcuffs, and I am glad that I am finally getting the opportunity to not only get my hands dirty with C++, but to also learn how to write in C++ correctly and efficiently. I am already very much excited for what this class has to offer and am looking forward to a great semester and more great blog posts!

No comments:

Post a Comment