dennis.c
main( )
{
printf("goodbye, dennis");
}
RIP dmr
10 years at software
This upcoming July, I’ll have worked for ten years as a professional software engineer. I’ve worked for both big and small companies and have learned a few things that other nerds may find helpful when turning from “hacking around at stuff” to “career code monkey”.
It’s better to agree than be right
In reality, wether you are disagreeing about a feature or architecture, you’re probably both completely off the mark. Users do things with products and software you’d never imagine. So rather then waste time arguing until you’re blue in the face, quickly come to a common ground, and move on. You’ll realize soon enough that you were both wrong, and a third solution was actually the correct one, and you can quickly fix what you did wrong. (Unless you’re making pacemakers, then ignore everything I just said. You have to be right).
Listen to the customer patiently, then figure out what they really want
Rarely do customers know what they want. And when they do, if you do everything they ask, you’ll end up with a “Homer”. So, listen to what they say, then figure what problems they are actually having, then solve those problems for them. They’ll rarely be upset that you didn’t solve the problem form them their way. (And if they are, they’re jerks).
They’re only your customer if they’re making you money
Everything else is a distraction. Some of the most vocal “customers” you’ll end up with will never pay you a dime, so don’t waste you’re time trying to make them happy. Remember, at the end of the day, businesses are here to make money. You can do other stuff too, but if you don’t make money, you don’t have a business anymore.
There’s no point in religious wars
VI vs. Emacs. Spaces vs. tabs. SOAP vs. REST. Ruby vs. Python. Either find a group of people that commonly agree, or allow people to pick their own tools. Anything else is wasting everyone’s time since people rarely convert when forced. FYI, if you’re a non-technical found and you’re looking for good talent, the fastest way to attract people is with the magic words “You can use whatever tools you want”. It’s like catnip for alpha-geeks stuck doing something they hate.
Educate rather than shut-out
Commonly when engineers don’t want to do something one way, they’ll just say “It’s too complicated”. Yes, sometimes business owners just asked you to solve an NP-hard problem, but most of the time, we think the idea is dumb and we’re stone-walling you. Or you asked us to solve the really hard version of the problem, when you can simplify it by changing one tiny thing. It’s our responsibility as engineers to explain the cost of different decisions, and provide different options. If your business owners are smart, they’ll learn from your advice and make better suggestions in the future.
This isn’t rocket science (unless it is)
Let’s face it, most of what we do is putting buttons on pages, so let’s stop grandstanding on how skilled we are, and how difficult and challenging our jobs are. 10% of the time you get to do something really cool and blow the dust off old math books, but the rest of the time, you’re making license plates. When you can, show non-devs what you’re doing and let them help. Copy writers? Graphic Designers? Let them in on writing some HTML. It’s not that hard, and if they learn on how this stuff works, they can even help you out in the future. If we put a man on the moon with Newtonian physics, we can teach some ordinary Joes some HTML.
Here’s to 30+ more years…
Realistically, unless I run into magical spontaneous wealth, I’ll be at this for 30 or so more years (at least). And even if I did win the lottery, I’ll probably still come into work (because I really enjoy what I do). Since I know I’m in for the long haul, I’m always trying to make sure that I’m going to make this a marathon instead of a sprint. That means keeping an eye on burnout, and learning from mistakes. So here’s to year 11, and counting…
The other day my teammate said, “I finally found something that stinks about Ruby’s core library.”
What was wrinkling his nose? The Dir class gives you no way to ask for files only, or for directories only. He had a point. The Dir.entries is inflexible. And even the flexible …
I really disagree with Nils Jonsson’s take on ruby’s standard library and so does matz. Nils claims that Something stinks about Ruby’s Core Library, and goes on to provide an implementation for Dir.files and Dir.directories. Yes, there might be functionality that is missing here, but it’s trival to implement. His solution shells which is both dangerous and non-portable. It’s also unnecessarily complex. The beauty of ruby is that it can be changed in very simple ways to solve your problem - even the core library. Here’s my alternative (and much shorter and portable) solution:
class Dir
def self.directories(path)
Dir.new(path).entries.select do |e|
File.directory?(File.join(path, e))
end
end
def self.files(path)
Dir.new(path).entries.select do |e|
File.file?(File.join(path,e))
end
end
end
Now, his two main arguments where:
- if you don’t mind some computing time and space wasted and you want to write as little code as possible
- if you know the contents of the directory in advance
The computing time and space will be much much worse with forking out to the shell listing all of the files, then gsubing out the items with a trailing slash. The ruby filtering will be much faster. But, if performance is a concern, I’m sure my code could be re-written as ruby C much like the rest of the Dir class, and it would be even faster. In the non-windows example, ‘ls -d’ is begin used to filter. In most POSIX implementations of ls, it uses opendir(), readir(), and stat(). So, ls is looking at each file and determining if it is a directory or not. This could potentially be sped up by using scandir(), but that’s a newer POSIX standard, so it might not be available on older unix systems.
Introducing simplegeo-ruby. This is a simple ruby client that I wrote for SimpleGeo API. It’s a pretty cool service that allows you handle all of your geo-spatial queries in the cloud (it’s like twillio for geo services). Check it out and let me know if you see any bugs!
Last weekend, I beat Space Quest III. If you don’t know about text-mode adventure games, they were pretty awesome. Especially, Sierra’s. I may be dating myself a bit, but used to rock out these on my old PC-XT (and only with a black and white monitor), and later with my 286. Anyway, awhile back I bought the Space Quest Collection, but it was for windows-only. This weekend, I found this page explaining how to use unshield and dosbox to run it on my macbook. Pretty awesome, and lots of good memories. Next up, King’s Quest V from the King’s Quest Collection I just found on amazon.


