I moved back to Sacramento and got a Web development job at Minnick Web Services in 2007. This was really my first full time programming job.
I had been programming a lot for fun in the last few years. It is awesome to suddenly get a full time job to do something you liked doing.
I remember one day in my first week: there was a bug in one of our applications. PHP would error out when downloading some information. I was assigned to fix the problem.
I studied the PHP error and the source code for the application. It seemed to be a memory error. I Googled the error. It seemed like PHP was running out of memory. So I checked the amount of memory PHP was being allocated. It had plenty of memory. I even put some statements in the PHP code to print out how much memory was available so I could be sure PHP had enough memory, and it did. But when running the PHP script to download the information I would still get a PHP memory error. This was a tough problem.
I tried testing the PHP script in a lot of ways to give me clues to what the problem was or where the problem was. Nothing I tried worked until I tried a technique of killing the script in the middle of the source code. If the PHP error was displayed then I would kill the application between the beginning of the script and where I last killed the script. Or if it didn't display the PHP error then I would kill the script between where I last killed the script and the end of the script. Then I would repeat this process. The idea is to find exactly where in the source code the PHP script would error out. I spent a lot of time doing this to find out where exactly it would error out. Interestingly enough I found that the script would error out at different places in the source code, but every time it would error out around a certain function call in the code. So I investigated this function. The function did not come from any user code that was included into the application. The function was not a built-in function from PHP. I found that the function was from a third-party library that was included from the PHP.ini file (which is why I never saw it included into the source code). I found the source code for the function and looked at it. Ah ha! Here it was. For some stupid reason there was a statement in this function that changed the available memory for PHP during runtime to 16MB, causing the PHP script to run out of memory. I just commented out one line of code and the bug was completely fixed.
I spent most of the day trying to fix that bug and I finally did. At the end of the day my boss came to me and asked me what I did for the day. Panic! The only thing I had gotten done in the last 6 hours was comment out one line of source code. I told him that I fixed the PHP memory error bug in the application I was working on.
My boss was surprised. He said, "Really? You fixed it already?". Yes, I did. Much to my surprise he was really happy. He told me that that bug had been in the system for 6 months and nobody could fix it. Nobody had told me about this. I was relieved and became happy too. Certainly programmer productivity is not tied to the number of source code lines written or changed. I would say programmer productivity is how much value you are giving to your employer or customer.
I worked a lot on www.gamasutra.com and related websites adding new features and improving things.
One interesting thing I programmed was the comments. Gamasutra used to not have comments.
I was also asked to show how many comments each news story had on the homepage of www.gamasutra.com and the news index page. Before www.gamasutra.com was redesigned the homepage and the news index page were statically generated. Regenerating the homepage and the news index page each time a user wrote a comment was not an option. So if a webpage is static and you can't regenerate it, how do we update the number of comments for each news story? Implement the feature in Javascript! So I did. I wrote javascript for the static pages which would update the display of the number of comments on each news story. Implementation was fast, it worked well, and it was a slick solution. Here's an image of a bit of the news index page in February 2009 with the number of comments displayed for each news story:
Then there was the Gamasutra.com redesign. That was a big project that I was the lead programmer on. Much of Gamasutra was reprogrammed. I programmed the homepage, news section, features section, job board, contractors section, the AJAX login, the comments, and search. I did the technical part of launching the redesign.
Doing the redesign inspired writing a webpage caching system similar to the caching system in the Smarty templating system. I put the source for the website caching system on Github. It is called SimpleCache.
I did various programming for various gamasutra.com related websites. I was one of the original developers of myGDC, the social website for game developers. I also worked on the online scheduling tool used by the Game Developers Conference, where I used the Javascript framework MooTools a lot.
After Work
Off work hours this was a time of a lot of self learning, exploration of programming technologies and experimentation. 2007 was quite a year for me in self study and side projects. I pretty much exploded with programming technology.
I built a web-based graphics editor. Users could rotate, resize, crop and upload images to be worked on. Here's a blog post about it. I used PHP, Javascript (including AJAX), CSS, XHTML, Imagemagick, and bash scripting to make it.
In June 2007 I bought books on Common Lisp and read them and wrote Common Lisp code. By September I was writing Haskell programs. Here's a blog post about becoming a haskeller.
I went to the very first Bay Area Functional Programmers meeting in San Francisco. I was really excited about Haskell. Here's my blog post about that.
I had been an avid fan of using delicious.com to bookmark web pages around the web for a few years. I had bookmarked probably about 2,000 or more web pages. I would link to my delicious account but one day delicious deleted it.
I liked browsing the web and bookmarking web pages so much that I wrote my own bookmarking web application called newsconomy.com. I built it in 2007 and I still use it for all my bookmarking. I built it for myself but I also built it for others. It has an interesting twist. Instead of just bookmarking web pages, you can trade bookmarks with other people. This is done by "buying" other's bookmarks with an imaginary money called lambda. The idea is to make bookmarking and sharing bookmarks more fun.
I think I made newsconomy too hard for people to understand quickly or I didn't explain it well because nobody else besides myself uses it continually. I also did very little to promote it. I love my bookmarking web application and have 1,857 bookmarks so far. Here's a blog post explaining in detail how newsconomy works. I built it using PHP, MySQL, CSS, HTML.
I became really interested in Javascript after finding and watching Douglas Crockford's videos on Javascript. Also, after reading Crockford's The Little JavaScripter, I bought and started reading The Little Schemer. I love stuff like this.
In 2008 I studied C again. I became interested in the implementation of hash tables in C. I wrote my own implementation of a hash table and did some testing of capabilities of different kinds of hash functions. Here's my blog post about this.
I studied operating systems. For a long time I have desired to work on making a new operating system. Here's blog post I wrote about writing a boot loader in machine code: A Boot Loader in Machine Code.
I have also been interested in the design and implementation of programming languages. This lead me to parsing techniques. Here's an attempt I made on making a Recursive Decent Arithmetic Parser.
In 2009 I went to the first Bay Area Haskell Meeting. I also got a new job working for Calmetrics, the sister company of Inductive Automation.
In my next post I talk about Inductive Automation's Ignition and my work with it.