Sunday, June 29, 2014

Week 3

Class:
This week was a bit more pleasant than the last, partly because I remember a lot of it from object oriented programming from a while back. This week we really got to see what separates C++ from the rest of the programming languages and got an insight as to why its so damn fast. The key is passing by reference. By simply passing the memory location of what you want the other function to access you eliminate the need to copy large data structures. You can also iterate over arrays of any type simply by iterating over the locations in memory where the data is stored. As the week finished up we got to talk more about how to prevent other developers from misusing this flexibility that C++ provides. By using special types of pointers to specially marked memory locations we can limit the damage that can be done by accident or even by malicious intent.

Project:
Australian Voting turned out to be more challenging than I had anticipated. This was my own mistake. Having seen how easy Collatz was to complete the day it was due, I underestimated Australian Voting drastically and as a result I started very late since I was completely focused on Netflix. I spent several hours trying to get the reading of the input and the formatting of the output correct. I knew that this was a key part of the project. After spending a bit of time modifying the skeleton code over from Collatz I quickly focused on getting the input output tests to succeed without issues. As per the requirements I then knocked out a non-cache version and passed all my tests. However I was faced with a problem because UVa indicated a runtime error was at play. All the tests that I had written were passing and so naturally I was confused. Luckily some students had already posted acceptance tests. After running several of them successfully I finally ran one that generated a cryptic error in my program. I analyzed the particular election that had failed and added it to my test suite. I was able to fix the bug and got UVa to accept my solution. The only problem was that it was now 7:30PM on Thursday and I still needed to generate acceptance tests and write a non-cache solution. Needless to say I didn’t get the project in by the deadline. Several hours later I finished it and was able to turn it in. Even though I lost 20 points on a project that truly wasn’t much more difficult than Collatz, I learned a valuable lesson: Don’t bother working to get bonus points for any project until AFTER you have finished the minimum requirements for ALL of them. Lesson learned.


On to week 4 :)

Sunday, June 22, 2014

Week 2

Class:
This week was quite a bit more challenging than the last. C++ is a very tricky language and it appears that as a developer you can choose to override a lot different things that java doesn't even come close to allowing. For example, you can override the += operator to handle objects instead of just the built in types. As a result it becomes important to know exactly what kind of things you can put on either side of the operator as well as what the final operation returns. This happens to be the weakest part of my understanding as two bombed quizzes have revealed. I need to swing by office hours this week to get this l-value and r-value stuff clarified and understood as soon as possible. Im also very excited for the next topic since this last Friday the professor got to talking about memory management. People are usually TERRIFIED of this concept but lucky for me I had spent some time last semester looking at some cool videos online to prepare for some of my C++ interviews. For those of you who are coming from java and are completely lost when it comes to C++, I highly recommend watching these videos from Stanford University. The class (CS106B Programming Abstractions) was taught by Julie Zelenski way back in 2006 so a lot of the stuff she shows is from C99 but its still an excellent introduction to C++. Anyways, in this particular lecture, she does an excellent job of motivating the idea behind pointers and follows into the next lecture explaining some of the really important concepts that Professor Downing explained this past week.

Project:
Collatz was a pleasant success. I started working on it Monday at noon and was done by 8pmish. This is mostly due in part to the fact that I had spent much of the weekend doing this exact same project in python. The majority of the time goes into fulfilling the many requirements for the project but I don't actually mind them as I can practically see how some of them are useful. Wednesday went really well with the introduction to the Australian Voting Project. Seeing that I have a partner in the CS373 class and I need to be as available as possible for that project I decided to go it alone for this one as the difficulty does not look so bad. This project seems to make perfect sense even though a lot of other students seem to be a little lost on it. I am a little bummed that the only extra credit we can get on this project stems from being with a partner which means I'll have to be extra careful not to loose points anywhere. My other reason for going solo on this project is that I really want to make it a habit to follow the professors templates and recommended development cycle as closely as possible. Its usually the case that other seasoned programmers will be set in their own ways on how to develop code which usually means implementation before test code. I really want to avoid that.

Sunday, June 15, 2014

Week 1

Let me start off by sharing why I am taking this class. I need an upper division CS elective to graduate in two months. One might wonder why would I want to take this class over something easier (from what I have heard) like Computer Security or Data Management both of which are being offered over the summer. My reason for taking this class is as follows. Last year I realized that I wanted to become a developer in the finance industry. I wanted to make a program that would be able to analyze, pick, and trade stocks automatically. Before I could embark on a project like this I would need some experience so I began hunting down companies that specialize in this kind of work, writing software to manage portfolios, balance mutual funds, and even conducting high frequency trades on exchanges across the world. I soon realized that I was a Java programmer competing in a world where the speed and performance of C++ was sought after. This past March I was blessed with a job offer from FactSet Research Systems located here in Austin and I immediately accepted. While the code review part of the interview did not go well, and clearly revealed my deficiency to the managers in C++, I blew threw the algorithms part of the interview with flying colors. But before hiring me the managers had discussed with the team if they wanted me on board and some of them (being UT Alums) suggested that I would be a much more valuable asset if I took this particular class from Professor Downing. No doubt when I attempted and dropped Object Oriented Programming almost 2 years ago I knew that Professor Downing does an excellent job at teaching and even more so evaluating and testing our knowledge of the material. Moreover he focuses on making us much more employable rather than just good Graduate Student Applicants. Desperately needing the job, the ability to dominate C++, and the last CS class for graduation, it became obvious that taking this class was a no brainer.
Just in the first week the professor has already gone over the importance having a portfolio demonstrating our abilities and obtaining a good summer internship in order to become more employable. In particular the professor has introduced us to the importance of developing in a certain format which requires us to first write test code thus helping us as developers narrow our focus to write passing code that only passes those tests that we have already written. The added benefit of working under this kind of paradigm is that if and when we run into a bug, it is always easy to simply run our test cases quickly to find out what errors our new code produced thus substantially reducing our debug time. Over the course of the semester I look forward to seeing how SOLID principles are applied to the C++ language and more specifically the intricacies of the STL.
A word of advice to other students planning on taking this class. Print off the slides that the professor will go over the next day in class. He usually puts them up the night before the class. Bring these notes to class and take active notes. This ensures that you won't forget about the small details that the professor mentions when he goes through the slides since laptops are not allowed. This is very good advice coming from someone who has taken his exams before.