Jacolyte's Lair

Icon

Musings of a curious dude

The Programmer’s Dilemma

It’s story time children, gather round the campfire.

I remember reading a story out there on the wily interwebs about the DoD and the programmers that worked there.

Every time the boss would come around, the programmers would typety type away on their keyboards to look busy.

To the boss, work means butt in chair, typing. Period.

There’s a lot of slow and methodical thinking that goes with programming, because programming is simply translating your thoughts of how things work into a formal language.

When I bring up some of the trivial details of my work to management, it only strikes FUD in their hearts.

Now as a guy who’s had a fair amount of bumps and bruises from the corporate world, I fully understand how to thrive in this kind of environment.

Not only do I have to manage my time, and make sure my brain is in tip top shape for problem solving, but I have to manage people, and make sure that what I say isn’t causing them panic, because panic is contagious and clouds my thinking, which leads to doing very stupid things, like deleting an entire day’s worth of sales efforts (true story), and bringing down an entire system because of a single character typo (also a true story).

Early notions I’ve had about programming

When I was younger, about 15 years old, I wanted to learn all about computers. I would hang out in a yahoo chat room called Hackers’ Lounge. I would beg my dad to take me to the library so that I could buy computer books. I had a lovely collection of them. To me, it was like pokémon, I had to collect as many as I could.

I used to pull all nighters reading how to program in Java, and TCP/IP networking. I loved the novelty of being just a 15 year old kid, not caring about school, friends, work, or responsibilities, but MMORPGs and hacking the planet.

As a programmer that is continually developing his skills and mindset, I’m almost embarrassed to say that I used to like computers and coding because it was “cool”. I looked up to the people in Hackers’ Lounge that could make a Visual Basic GUI that would tell you your IP address.

One thing that I admittedly lack is some kind of structure, or discipline. I may be able to answer a lot of questions regarding computers, but my ability to to see a project from plan to finish, and maintain it after release has not been developed very much. I haven’t had any obligation to maintain the software that I’ve made for personal use, so sadly, it goes neglected. Also, most of the software/websites I’ve made have been purely for play and have never had any serious intent of being used.

One day I hope to realize a software need, fulfill that need, and publish it for others to use.

Keepin’ it real, dawg

I’m trying to focus more on learning how to use my tools effectively, like a true craftsman, and actually build things, as opposed to which is the coolest tool in the shed.

I used to be all about Linux, or all about Python, and got into the habit of solving every single problem with the same tool. No, that’s not how it should work.

I like to code when I’m bored. I almost feel as though time not spent programming is time wasted. Sometimes, I can’t help it.

As I’m maturing as a developer, I’m beginning to realize that software is supposed to augment my life. It’s supposed to accomplish something. It’s supposed to serve a purpose.

When I was a young lad, and I was bored, I would always find something to mess around and tinker with. But I was a kid, with no sense of management or craftsmanship. That’s all beginning to change.

As I become a more mature person in general, and a more responsible and disciplined individual, the more I want to think about fault tolerance, peace of mind, testing, measure twice cut once, meeting deadlines, responding to emails timely, forward planning, etc.

That’s about all I’ve got to say in this post. It’s not the tool, the instrument, or the programming language that makes you an awesome anything.

Stay thirsty my friends.

Re-installing Ubuntu Server

So, as a solution to my broken Ubuntu machine, I’ve re-installed the OS.

I’ve chosen to install security updates automatically, so I hope I don’t get burned by some upstream package in the future.

In retrospect, I am not sure what broke my Ubuntu machine. It could have been my lack of care in regard to reading upgrade notes, or it could have been the GRUB team that made my machine un-bootable. Either way, I’ve chosen not to abandon Ubuntu, as I so badly wanted to do.

I’ve made a habit of OS hopping whenever I am displeased, but I’m going to force myself to have discipline, and try to rationally figure out a solution to my problems rather than throw the whole damn thing out the window.

This is what brought me from Gentoo to Ubuntu. And to think, I almost switched to Arch Linux :)

What it seems like has happened (I say “seems” because my machine had multitudes of problems, and I was unsure of which was causing which) is that the GRUB team had released an update, my `/boot` partition was full, the update failed to finish, and then problems with dependencies in `apt-get` started arising, `apt-get install -f` failed, and `dpkg –configure` couldn’t finish configuring misconfigured packages.

Other packages which are probably important, e.g. `linux-image` and `linux-image-generic` had dependency problems that I didn’t fully understand as well.

In the future, I’m going to keep my Ubuntu server installation CD nearby, and reserve my Ubuntu server purely for development, and keep all of my important documents on my google docs account, or on my iMac where I know I’m not going to break the core system and make my machine un-bootable.

My Ubuntu server I am going to use purely for development, and worst case scenario I need to be able to nuke the S.O.B. so I can get back up and running.

Studying the inner workings of Linux and knowing how to debug the problems will come at a later date. In the mean time, I’ve Got Shit To Do(TM).

::puts on sunglasses::

GRUB error 15 and Kernel Panic

One day when I booted my Ubuntu server I saw:

kernel panic - not syncing: VFS: unable to mount root FS on unknown-block(0,0)

I wanted to see if my data was safe so I downloaded an Ubuntu LiveCD and installed the necessary tools to mount my root filesystem. My server’s partitions are on LVM, so I installed the `lvm2` package with `apt-get`.

I found a page on how to mount LVM volume groups and followed it which resulted in being able to see my partitions under `/dev/<server_name>`.

I also wanted to try rescuing my machine and fixing GRUB, so I mounted the virtual file systems and chrooted, with the following commands:

sudo mkdir /mnt/dev /mnt/dev/pts /mnt/proc /mnt/sys
sudo mount /dev/my_server_name/root /mnt
sudo mount --bind /dev  /mnt/dev
sudo mount --bind /dev/pts  /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo chroot /mnt

After I did this, I discovered that some GRUB files were missing. I re-installed GRUB by running `sudo update-grub` and `sudo grub-install /dev/sda` and then I re-booted. This is when I received GRUB error 15.

I have yet to fix this problem, and it has been agonizing me for days. There’s a topic about this particular problem on ubuntu forums and launchpad, but no solution has been posted.

What I’ve been up to lately

My latest geekery, despite the PSN snafu, has been with my PS3. I’ve found this sweet piece of software called ps3mediaserver which I’m using to stream movies and TV shows from my iMac to my PS3.

My iMac’s display is 24″, but my HDTV is 48″, which makes for an awesome factor of 2x. Sweet.

Basically all of my computer’s files are available to my PS3, as long as the PS3 supports the file format.

I’m currently working on a nasty problem with my Ubuntu server. GRUB is failing to recognize that my root partition is mounted when I try to run `update-grub`, and I’m getting some dependency problems with the `linux-image` packages.

Oh yes, and I don’t always game offline, but now I do… because all I have is a PS3 :(

Careful with that hammer there, buddy

I am not a college educated programmer. My first development job called me a software engineer, I am not. My beginnings as programmer are as a bored teenager locked in his dad’s studio apartment with a compaq bought from costco and an internet connection.

I wanted to dive in writing code because I was bored. I wanted to know what it was all about. Admittedly, it was exciting. But there comes a point where you want to actually do something with your knowledge. For a long time, I’ve been a bored teenager holding a hammer anxiously wanting to build something.

Constructing a building is difficult and complex, and building software is no exception. You may understand what the hammer and saw does, and how to use them, but being able to piece everything together is a completely different bag of peanuts my friend.

My software endeavors have become oriented toward understanding software, making damn good use of existing software, and focusing on stability. Instead of dreaming about being the rock star programmer that builds a wonder-app that everyone loves and uses, it’s time to grow up and get a job done. Before you re-invent the wheel, see if you can tune up that bent wheel in the shed or buy a used one from your neighbor.

I don’t care what the ‘elite’ programmers say, they can scribe zeroes and ones on stone tablets for all I care, I’ve got shit to do. Take what the guys on IRC say with a boulder of salt.

Advice For Budding Software Developers

I’ve been employed for one year but I’ve been programming for probably five or six and I don’t have a college degree. I’ve gone from tech support/basement hacker to employed software developer, and in the brief amount of time that I’ve been developing and getting paid for it, I’ve made an incredible amount of mistakes. In the paragraphs that follow I’m going to share what I’ve learned with you.

Do not wait for work to come to you. You’re expected to tackle work on sight. Sitting on the sidelines will not yield results. No results means no money and no future. When the ship is sinking you can wait for the captain to shout at you or you can start plugging holes. Having come from low responsibility jobs (i.e. burger flipper, shelf restocker, tech support) I was used to having my work cut out for me and fed at a consistent rate. In fact, this is what I had been used to all my life and mostly through high school. I grew up this way. It’s a hard habit to break, especially when your parents never tried to teach you any kind of mental framework for achieving goals, and not growing up learning anything resembling a work ethic. Fast forward to today and I’m tackling work rather than waiting for it thanks to the job I have now.

Communication with the team is absolutely critical. Failing to communicate will have dire consequences. Communication is key in business, and when you’re a significant player in the company, the failures to use communication are stark and extremely apparent. If you don’t communicate with your team, you may trail off somewhere far from the intended goal. Communicating with your team keeps you focused. When I’m in the habit of communicating constantly with my team, I’ll think twice before trailing off and refactoring something that doesn’t need to be refactored, because I know that’s what I’ll have to report to my boss and my team.

Embrace the dictatorship. Software development teams are not a democracy. There are just some things you do not ultimately decide, and things will go smoother if you just go along with it, no matter how wrong it feels. I had drank too much developer kool aid and thought that only the cool kids use git and haml. This had some pretty bad repercussions when I started using these two technologies while the team was using svn and erb. You need to be on the same page. You need to yield to the people in charge. Even if you think they’re wrong, you will learn an utterly insane amount from seasoned pros by just yielding to their advice. What I had ultimately learned is that there is no Right Way™ other than the way that gets the job done efficiently. When developing a product it’s better for one person to hold one clear vision about the product. As Henry Ford once said, if he had listened to what his customers wanted, he would have made a faster horse.

Dedicate yourself to the project. This is why you’re earning a salary. Things break at night and on weekends. These are the implications of earning a salary. Being just a kid fresh out of high school the implications weren’t clear to me. Because I had grown up with the rank-and-file masses, and not really engaging in any team activities, the whole idea of teamwork had eluded me. Don’t make my mistake and take the contract between you and your employer lightly. A lot of jobs won’t notice you slacking off, i.e. the jobs I’ve had my entire life. As a software developer, slacking off is noticed very quickly since net income usually depends highly on your work. If you’re a walmart employee nobody will notice, because you generate so little income for the company. However, as a software developer, and a significant player in the company’s success, your slacking off is extremely noticeable. If you fail to meet deadlines, you cost the company a lot of money. And what is the most noticeable metric in business? Money.

Base your decisions on the bottom line. In the business world, everything is about money. This simple truth can escape a software developer sometimes, especially one from the open source world. Whenever you’re making job related decisions, there must be one major thing on your mind, above everything else: will this bring the company money? Will it cost the company money? As an amateur, and someone who held no stock in the company, my priorities weren’t money. This led me to concern myself with trivial matters such as switching version control, refactoring, experimenting with a new language, etc. Don’t make this mistake.

After making all of my mistakes, it is now apparent why past experience and college education are highly valued to hiring managers. It’s because they’ve been building the mental framework to get things done for years. If you’ve been a hobbyist programmer for a long time and you’re looking to become a professional programmer, take some time to get your priorities straight, and make your emphasis on business apparent to potential employers, because you probably won’t be the first “open source hobbyist programmer” to come their way. Being a software developer is a grown up job. If you’re working at a lesser job, take advantage of the opportunity to learn responsibility, even if you’re just a walmart employee. I had the opportunity to practice time and task management but I didn’t. I’m kicking myself in the ass for it. I look around and see that my co-workers have probably been learning time and task management probably since they were kids. I have to force myself to learn good habits, and it’s sometimes a struggle that requires mental effort. If you’re like me, you can probably learn a lot from my advice. Hopefully my mistakes are not ones you will have to make.

Similarities between biochemistry and computer science

There are some very striking similarities between computer programs and biochemistry. Within DNA you’ll find sequences with various “flow control” signals. E.g. the sequences AUG, TAA, TAG, and TGA have special meaning to the ribosomes that actually take DNA and translate it into proteins. One signal (AUG) tells the ribosome where to start translating the mRNA to protein, and the other three are stop signals, telling the ribosome it has finished the current protein being produced. You can even observe boolean logic within cells. The production of lactose-metabolizing enzymes within E. Coli can be modeled with boolean logic or pseudo code.

if glucose_levels_low and lactose_present:
    produce_lactose_digesting_enzymes()

The production of proteins and enzymes can also be modular. Genetic information is stored in such a way that the constituents of a protein act like software plugins. There are plugins (called domains) that allow proteins to bind to DNA, or to bind to RNA, or to bind to hormones, or modify RNA, and the list goes on. These “plugins” basically have some kind of functionality that can be present on many different enzymes. There may be hundreds of proteins out there that work with DNA, and each of them might have a module that allows them to attach to DNA. Rather than each enzyme independently mutating and evolving a DNA binding site, they might just swap it around, which is strikingly similar to code sharing and modularity among software.

The similarities are fascinating and seem endless among computer systems and biochemical systems. Perhaps since we’re composed of biochemical “software” and “machinery”, it’s only natural that our computer systems behave in the same manner.

Inheritance simulator

I made a simple little inheritance simulating program. Remember those Punnett square graphs you did in biology during 9th grade?

When running the program, you give it two pairs of genotypes and a number of generations, the program will then perform a cross between the two.

I’m studying biology currently, and I thought it would be neat to try and translate it to software. Maybe in the future I’ll add a random weight to an allele, which makes it more or less advantageous than the alternative.