Ahhh summer school…

And by ahhh, I really mean AH! The first day of summer school started today and I’m already ready for the term to be over. It’s partly due to the insane amount of cover letters I’ve been writing in my applications for internships, but also because lectures during summer school are two and a half hours each. Trying to keep your concentration for such a long amount of time is difficult to say the least. Even so, I’m pretty excited about the two courses I’m taking this term.

 

CPSC 310 – Introduction to Software Engineering 

The prof in my Introduction to Software Engineering class is really charismatic and that’s definitely a help in keeping your attention when you’re trying to separate out your waterfalls from your spirals (these are two types of software processes). On the downside, I, and quite a lot of other people, failed to persuade the prof to let us code the class project in our language of choice. The project for the course involves parsing a publicly available dataset and plotting it in google maps (or equivalent), maintaining a database which users can add and edit records, and integrating social media authentication. Sound simple? I thought so.

Having done quite a bit with Rails, I thought the class project would be a perfect excuse to get better acquainted with some newer, and highly desirable, technologies. Specifically, Node.js. Everyone loves Node these days because it is asynchronous rather than strictly sequential in how to executes code, and this makes for more scalable applications. Node means the server doesn’t have to wait for a particular request to be completed or method to return, it can just go on doing what its doing and accommodate the request as and when it comes in.

Oh Node! (that’s really meant to be Oh no. Get it?)

Unfortunately, the summer term is so short that the prof wasn’t buying what I was selling – it’s a great way to learn new technologies! I’ve done a hacker school! I have a portfolio – at the end of the day, summer classes are a logistical nightmare. Trying to help a hundred or so students get their environments set up, teaching them software processes, and getting them to build a web app in a group without killing each other, is tough. I get that. And so, instead of using Node, we’re all going to have to use …. wait for it….. Java with the Google Web Toolkit.

I hold nothing at all against the professor – she agreed that something like Django or Rails would be infinitely more fun, and of course there’s the irony that Google Web Toolkit just converts Java to JavaScript anyway.. – but the rules are the rules. I’m just happy that we’ve got someone to teach the course this summer! Finding good professors, make that any professor, that can teach software construction is HARD.

Anyway, I still get to learn how Java works on the web – and of course, I can always find time.. somewhere.. to learn Node on my own – and that’s ok. If anything, this is good preparation for the real world where you have to use a specific technology, no matter how inefficient 🙂

 

CPSC 221 – Basic Data Structures and Algorithms

My first lecture in this class was pretty interesting. It was mostly a high level overview of why algorithms are important with a general intro to the concepts of arrays, lists (linked lists), and how a data structure might be good for one thing – e.g. arrays are good for binary searches compared to lists – but not for another – e.g. arrays do not handle insertion well since they are fixed size data structures. I didn’t learn anything brand new today but it was good to get an idea of where the course is heading.

One of the things I really liked was when the prof said that learning algorithms is the difference between you and some kid in high school who knows how to hack in python. To take it further, I guess knowing how to get an array sorted (my_array.sort) is not the same as being able to sort an array (i.e. understanding the algorithms behind Quicksort and Merge Sort).

Who cares? An example: ArrayList vs Lists

Choosing the wrong data structure can be catastrophic. The example we heard in class today was of an ArrayList and why you wouldn’t use it in a mission critical and time sensitive environment. An ArrayList may be a foreign concept to you if you’ve only ever coded in a language like Ruby. In Ruby, there is no need to declare a specific size for your arrays (although you can, and then those values can be set to a default), they just resize themselves automatically as things are inserted/deleted from them (the exact implementation of how this is done, in C which underpins Ruby, is pretty complicated so let’s leave it at that – I may need to come back and come up with a better example). This means that what are called arrays in Ruby are really ArrayLists in a language such as Java, i.e. self-resizing arrays. Don’t forget, arrays in the traditional sense are of fixed size.

Back to our example, we wouldn’t want to use an ArrayList in a mission critical system because resizing the underlying array of an ArrayList takes time. Time you don’t have. Can you imagine if you had a really badly implemented ArrayList, and it had 1 million elements in it and the underlying array (of size 1 million) was full, and you inserted a new element into it? Well, then you’d expect the array underlying your ArrayList to double, and now you’ve used up lots of time in copy elements from your old, smaller array, to your new bigger array, just so you can insert a single new element. Oh, and you’ve also used up lots of memory in the process. Guess what? Your mission critical system, let’s say a rocket ship, didn’t have that memory available for you to use. It crashed.

Or maybe the memory was available but in the time it took to resize the array, the rocket’s reverse thrusters were fired too slowly. Guess what? It crashed.

I am psyched for this class. Not least because it’s going to be needed to get through a lot of the interview questions that get thrown at undergrad CS students applying to internships. And who doesn’t like solving complex problems!

One other thing, we need to do the labs for this class in C++ and seeing as most of us don’t know C++ and neither are they going to teach it in class, I’d better go learn C++. This feels like the real world already.