A few weeks ago, I had to explain inheritance to someone who has been working with software for over a decade. Sure, he may not have learned about inheritance back when he got his degree, and he may have spent some of his career in sales traveling around the world without writing code. But for the last three or four years, his job—you know, the thing that pays for his kids’ food—has been to write and maintain Java code. I expected him to have picked up on this whole object-oriented thing by now. Since it’s a fundamental concept of Java and all.
Here’s a very simplified version of the code in question, formatted to be as brief as possible:
class A {
protected boolean isFooRequired() { return true; }
public void doSomething() {
if (isFooRequired())
foo();
}
}
I suggested he fix a bug by adding isFooRequired() to a subclass:
class B extends A {
protected boolean isFooRequired() { return false; }
}
He didn’t understand how the line “if (isFooRequired())” would know to call the isFooRequired() method in class B for an instance of B. It’s called polymorphism. Look it up.
That got me thinking about my own software development knowledge. I work in a field where half of my technical knowledge will be obsolete in five years, and I have probably learned almost as much since graduating as I did in school, so how much good did my degree really do me? A lot of what I know I have learned from websites and blogs for developers. I guess they are kinda filling the niche that industry magazines used to fill. In ascending order of usefulness, the sites I visit most would be The Old New Thing, The Daily WTF, A List Apart, and especially Joel On Software. And please let me know if I’m missing out on any good ones. So anyway I’ve learned a lot of things that they just don’t teach you at school, or that you would never want to learn in a classroom (i.e. having a test where they ask if you should require developers to write code in the interview would be dumb). But there are many things that I wasn’t really taught, or that I was taught only through an elective. Regular expressions have been extremely useful in my two years of professional programming, yet I only learned them in a one-hour Perl course. I was never taught closures, and I only learned a functional programming language (Lisp) in an elective (Artificial Intelligence). Not that I have ever used Lisp in the real world, but closures are nice and allow programmers to do some powerful things very easily. Java and PHP kinda have things that are sort of like closures, but not really. Perl has them, but I never write any code in Perl complex enough to need them. I was never taught databases—I strayed from the databases elective since I knew that if I took it, I would list it on my resume, and I was afraid that listing the course would land me a job as a database administrator. And I did not want to be a DBA. In my software engineering course, we went over some concepts that are very important, but don’t really make sense to be tested on—it might have been more effective as a required series of lectures or something, provided the lecturers did a half-decent job. I know I would have payed more attention that way. Design patterns were covered in that course very briefly, although knowledge of them has been invaluable to me in the real world, and I was asked about them on nearly every job interview I went through.
I guess where I’m going with this rant is that I make an effort keep up with the latest and greatest. It is something I am interested in (which is one of the reasons I chose to major in Computer Science in the first place), and it is vital to me being good at what I do. Shouldn’t I expect others in this field to make at least a minimal effort to do the same?
September 27, 10:01 am
Did you only interview for jobs that dealt with Java programming? Every job I interviewed with (all of which focused on either C or C++) didn’t ask about design patterns at all. And we don’t even mention that term here in my group at IBM. I’ve (gladly) forgotten all of the stuff taught in the software engineering course. I really hated that. I dislike Java too.
Databases are good stuff, with some very interesting performance implications. I shudder to think what the databases for sites like Amazon.com look like. I’ve used them a great deal both inside and outside of work. MySQL is quite a handy tool.
It’s a shame that programming languages don’t support regular expressions like Perl does. Sure I can use an external library or whatever to add that functionality, but to have them as operators: sheer genius. RegExes are quite useful.
September 27, 11:03 am
Most of the jobs I interviewed for were Java positions, although the two programming positions I was offered (one of those being where I work now) involve about 50% Java and 50% C++. But the ‘gang of four’ book was published before Java was introduced, using mosty C++ examples. I’ve found patterns useful in C++, Java, and even PHP (PicTML follows a nearly-perfect MVC pattern, for example).
As for databases, I think I’ve learned quite a lot from designing schemas for my website, and a little from work (although most database details are abstracted away from the layer of code I work on). I mean, I understand what normalization, primary keys, stored procedures, and SQL injections are, and I know how to use a LEFT JOIN instead of a nested query. I’d hardly call myself a guru and I never want my job to be maintaining a database, but I think I’ve made up for not taking the course at school.
Maybe one of my readers who used to work for Amazon (all one of you) would care to comment on how good/horrible/whatever their database model is...