Thursday, September 20, 2007

I was listening to the dotnetrocks show today with Steve McConnell. It was a good show (not only because Carl Franklin kept his trap shut and let Richard Campbell conduct the majority of the interview), and Steve had an interesting comment about a watershed moment when he joined IEEE: he realized that there were other people out there that had worked on the same stuff he had.

This got me thinking about these sorts of moments in my own life. So, I thought I'd write a couple down. Perhaps anyone reading this might want to add their own stories?

Other people write databases?

When I was 15 or 16, I was in the rapture of learning C/C++. This was a significant step in my life, as I really started discovering the true joys of creation and what it feels like to construct something from nothing. Well, one of the first things that I completed was a calendar program. It was super sweet, allowing you to save entries on a specific day, then an entry in the autoexec.bat would allow you to have a reminder posted when you turned on your computer. Yup, autoexec.bat. This was probably in 1989, DOS 6.22 days. I had also found a cool library (one of the first explicit third-party libraries that I found) that allowed me to do some pretty cool ASCII graphics for the calendar and dialogs.

Well, in order to save/update/remove the entries, I had to have somewhere to store them. So, I wrote a simplistic flat-file storage system. I didn't realize it at the time, but I had actually built a small, indexed, relational database. If memory serves, it consisted of about two or three files, including an index file that provided the indexes for day to entry. It was definitely a flat-file, as I remember having to keep the index file updated with the byte offset and length of the entries. I remember that I had one problem that I wasn't really satisfied with my solution for: deletion. I don't remember exactly how I did it, but deleting an entry was a complicated process to get it out of the file and the index.

At the time, my mother had a friend whose husband worked at Microsoft. I don't remember what department or project, but that isn't really relevant to the story. Knowing that I spent so much of my time programming on the computer (for Christmas, I had only asked for a single thing: TurboC++ 1.0, now with an MDI), My mother had set up an onsite meeting/tour of Microsoft for me. Well, I remember walking around the Microsoft campus in a bit of a dream-like state (the drinks were free and ice cream was free in the cafeteria). My mother's friend and I had lunch together and talked about what I had been doing. I told him all about my calendar program and the storage files; it was one of the first times that somebody outside of my father had really understood what I was talking about relating to computers. During the course of the conversation, I mentioned my problem with the deletion. Here's the watershed moment: I remember him explaining to me that you really only need to delete the index, then periodically do a reindexing that cleans up orphaned entries. WOW! I hadn't thought about that, and I was floored; I had never really thought about the fact that somebody else may have done something similar to what I was doing, more importantly, though, somebody else actually had THOUGHT about the things I was working on.

Bear in mind that this was pre-internet, and, while I was an active participant in BBS's, I didn't really have too many friends at the time who were programmers; programmer friends came soon after I learned C++.

Iterators? Holy Crap!

This isn't as much a watershed moment of the type above, but it is one of my favorite stories.

When I was living in Hungary, I didn't have access to the internet (this was early to mid-90's, so it wasn't as widespread over there), so I didn't really have a lot of places to learn things from. Probably in about 1995 or 1996, my friend, Colin, came to visit me. Colin had been a programmer at Microsoft (he got some code in the Win95 base, although the story about that is for another time). In any case, I had been feeling a resurgence in my programming, fooling around with C++ again, as well as learning VBA (I learned VBA through the help files that came with the Hungarian version of Excel). I had a couple books, and one of them talked about data structures. I didn't have a huge background in these sorts of things. In any case, one of the data structures was a linked list. I remember reading it, thinking about, trying to digest it, but I just couldn't figure out how a linked list was useful. My main question was, "how do you actually get to the items in it?" I could visualize the linked list, but I didn't really see the means of getting to the entries. I remember sitting there with my friend, Colin, bugging him to talk about programming with me, and I mentioned this problem. Colin was always such an awesome guy, so, rather than saying, "you dumbass, it is trivial," he actually smiled, got a piece of paper and drew me the concept of an iterator. WOW! That was a tremendous moment for me.

I love this story for myself, especially as I try to help people learn how to build software. In order for someone to know something, there really must be that moment when they grok it for the first time. One of my goals as a teacher/mentor is to help people achieve those "WOW!" moments when they understand something for the first time, especially when they immediately look back and go, "that is so incredibly simple."

 

I know everyone likes to reminisce about the early days of their programming. What sort of stories do you have like this?

Thursday, September 20, 2007 3:55:19 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]