Libraries

I was once asked what I considered an excellent question in an interview. One I managed to screw up completely.

Why do we used standard libraries in place of our own code?

The context for this question was this: I’d just completed a task were I had to, in pseudo-code, implement a function for combining strings. I think I ended up with something similar to this (again, this is pseudo-code):

[sourcecode language=”cpp”]
string CombineString (string firstString, string secondString) {
//create a new string with enough space for both strings to be copied
string combinedString = new string;
combinedString.malloc(firstString.GetLength() + secondString.getLength());
return combinedString = firstString + " " + secondString;
}
[/sourcecode]

Firstly, this wont work. Secondly, this isn’t what I wrote up on the whiteboard that day. This is just a naff example to give you some kind of context with which I was approaching the question.

Now then, the question itself is very simple to answer:

Standard libraries have, we assume, been through a rigorous testing procedure to make sure that they conform to the design documents perfectly, and to make sure that there aren’t any bugs. They are also very simple to implement, compared to designing a library yourself and having to teach the entire team how to use it. They save time, money, and improve productivity – assuming that they are the right libraries for the right task to begin with.

Simple, ne?

I forget what my answer ended up being, but I don’t remember saying much along those lines.

Folding

Most of the past few weeks has been taken up with building muscle/working out, watching The Soprano’s (I’ve never seen this before) and folding. Although, I’m implying that I’m the one whose done all the folding.

I’ve instructed my PC to use the spare cycles on 3 out of my 4 cpu cores and my gpu core to help understand the process of protein folding. A lot has been said about protein folding, and most of it can be found on The Wiki. Needless to say, I’m doing my part. I care for a lot of people, and the problems that CAN be linked to improper folding of proteins are huge.

My PC is still running very efficiently. I’ve got to hand it to the guys over at Stanford, they know how to write a really good piece of distributed code. I’m still able to browse the Internet, watch videos, and even play games. Excellent coding guys.

Watching

I know that The Soprano’s ended back in [goes to check] 2007, but it takes me a while to get into American TV shows, mainly because there’s that much out there. I don’t want to waste my timeĀ and (more importantly) money on something that I’m not going to enjoy. I’ve got to say that I’m enjoying The Soprano’s very much, though. I’ve only just started season 2, but it’s drawn me in already.

Plans For The Weekend

Well, that’s this short update done. I’m hoping to get some coding done over the holiday weekend (4 day weekend!!!), and whatever I get done is getting posted on here. Maybe I’ll come up with something interesting. Probably not, though.

Well, have fun.

J

Jamie is a .NET developer specialising in ASP.NET MVC websites and services, with a background in WinForms and Games Development. When not programming using .NET, he is either learning about .NET Core (and usually building something cross platform with it), speaking Japanese to anyone who'll listen, learning about languages, writing for this blog, or writing for a blog about Retro Gaming (which he runs with his brother)