As to the methods there may be a million, but principles are few

time to read 4 min | 691 words

I run across the following quote a while ago, and I found it quite interesting.

“As to the methods there may be a million and then some, but principles are few. The man who grasps principles can successfully select his own methods. The man who tries methods, ignoring principles, is sure to have trouble.”

- Ralph Waldo Emerson (1803-1882)

I have been programming, in one form or another, for about fifteen years, but I can put my finger on the precise moment in which I moved from a mere dabbler to a professional. That was in 1999, and I decided that I had enough of toying with Pascal, VB6 & Java Applets. It was the height of the bubble, and I wanted to learn just enough to be able to get a job doing something that I enjoyed. I had about a year opened to me, and I registered myself to a C/C++ course in a local college.

In hindsight, that was one of the best things that I have ever done. That course taught me C and pointers, and then C++ and OO. I also introduced me to concepts that I have been using ever since. Admittedly, I don’t want to look at any of my code from that time period, but that is probably a good thing :-) The most important part of the course was that it taught me how computers work, by introducing C first and forcing me to write my own implementation of any system call that I wanted to make.

I studied programming in High School as well, and I distinctly remember being utterly and completely baffled by strange things like dynamic memory and pointers. I mean, why don’t you just allocate a bigger array. During that course I actually grasped pointers for the first time, and even looking back over the last couple of weeks, a lot of my performance work recently is directly based on things that I learned there.

After completing that course, I got several books to help me understand the fundamentals better. Operating Systems Design and Implementation, Modern Operating Systems and Operating System Concepts to understand how an operating system works, not just a single program. Win32 System Programming, which I read mainly to understand the environment in which I was working and Windows Sockets Network Programming, from which I learned the basic concepts of networking.

The common thread throughout all of them is that initially I focused on understanding the technical environment in which I was working, getting to understand how things are working at a very low level. And while it may appear that understand those low level details would be nice in terms of general education but have little relevance to where I am spending most of my time, that is quite inaccurate. The recently built serialization system built for the profiler was heavily influenced from my reading of the OS books, for example.

For that matter, other good books are Practical File System Design, talking about the BeOS file system, which I found utterly fascinating or Virtual Machine Design and Implementation C/C++ which is a horrible book, but one that gave me the confidence to do a lot of things, since I saw how trivially simple it was to build such things.

Coming back to the quote in the beginning of this post, understanding the underlying principles has allowed me to do approach a new technology with the confidence that I understand how it must work, because I understand the environment in which it works. Oh, there are a lot of details that you need to get, but once you have the conceptual model of a technology in mind, it is so much easier to get to grips with it.

Interestingly enough, I only got to software design books at a much later stage, and even today, I find the low level details quite fascinating, when I can get new material in a subject that is interesting to me.