I saw a post at HackerNews the other day from Justin Kan about his first experience with programming. Short story: he was asked to do something over and over. The pain that he felt when asked to do this caused him to learn and apply a VB macro in the background of an excel sheet. My own experience was quite similar, and dredging it up was a fun trip down memory lane.
I worked a few summers at a manufacturing company that made manifolds and nozzles for plastic injection molding machines. I had some great experiences there (designing wooden trays to hold nozzles), and some weird ones (spray painting some 1300 of said trays). I think I was 15 at the time.
On a normal Friday afternoon during my first summer there, my immediate boss asked me to come in and sit down with with the “Consultants”. These were the type of “Efficiency Experts” that made $200 an hour, and only told you things about your company you should already know. These lean-manufacturing gurus were trying to figure out how to create a Just In Time machine cell using the existing metal mills. They knew that these machines could only accept manifolds under 90cm in width. Anything larger than that (or thicker than some number I can’t remember) would have to be routed to larger machines outside the normal flow.
“Sit down, Matt. Here is the first 120 pages of some 23,000 unique manifold descriptors dumped out of SAP. We need you to make a list of those manifolds that CAN go into the machine cell, and those that can’t. This can’t be a simple sort, because sometimes the dimensions can look like blah235blah, and sometimes they can look like 983yadda84. It’ll probably take you 6 hours Saturday and Sunday, for the next 2 weeks.”
Shit. I’m in trouble and in danger of losing my weekend. Time to figure out what makes Excel tick. 3 hours, and a lot of if else if else if else if else copy paste later, I had the 23,000 manifolds sorted and grouped by size. I ended up with a thrown together, hideous, disgusting abomination of code that took 10 minutes to run once. But. It worked, and never again needed to see the light of day. I still have the excel file but I won’t post it for fear it will be used against me later 😀
“Here you go. See you next week!”