Why homogenizing your toolset is a bad idea

In my current workplace there is a disturbing trend where management  seeks to standardize everything that it can.  This includes  standardizing the tools which we are allowed to use, even to the  extent of telling us which IDE we must use.  The reasons given are  twofold: Firstly they believe that homogenizing the workplace  enables them to better compare the productivity of different  programming teams.  Secondly, they hope to modernize the work  habits of some of us older developers.  Elements of management, who  haven’t worked outside of Microsoft Office products in some time,  and who have never really undertaken a study of how various  development environments might affect the productivity of various  developers, nevertheless are convinced that there exists a “best”  development editor, that they know what that editor is, and seek to  force us all to use it.

It’s easy to find examples where this homogenization appears to be a  good idea.  We have in our team some individuals who have, shall we  say stagnated in their skill set.  They use editors most people  would find inefficient.  They have work habits which are fairly  inefficient — lots of repetition.  They have stopped looking for  better ways of doing things.  This is reflected in the quality  and nature of their code, the usability of the products they  generate,  as well as in their habits for interacting  with said code.  They see no problem with byzantine usage  restrictions, complex and lengthy code.  They don’t strive for  simplicity or elegance.

Management (and unfortunately at least one other coder) hope to  correct this problem by forcing us all to use Eclipse.  At first  glance this seems like a good idea — it will stir the pot up a  little bit,   get people out of their comfort zone.  Unfortunately,  their goal is not to get people to learn new things, nor to get  people out of their comfort zones a little, their goal is to  standardize everything.  In my mind, based on my observations,  standardization and control in corporate development environments is  a root cause of developer stagnation.  To keep coders current,  skillful, and engaged means encouraging coders to pull  themselves out of their comfort zones.  To experiment.   To be  playful in their work.  This is how people will constantly learn.

Of course, my primary concern is my desire not to lose my productivity. I spent a few months working with Eclipse  while I was loaned out to another team to help with a Java project.  Had my term with them been much longer, I would have gone to the  effort to set up EMACS to work within their development environment.  Why?  Well, primarily find EMACS vastly more efficient for day to  day development than Eclipse.  Eclipse has a lot of fancy features  that can save 5 or 10 minutes, but they get used every few weeks or  so.  EMACS has tiny optimizations that save me anywhere from a half  a second to a handful of seconds, but they are used dozens or  sometimes hundreds of times a day.  They are intrinsic to the design  and assumptions of EMACS and emacs mode in Eclipse is not an  effective substitute.  A second reason is mouse abuse.  While I  think the mouse is a very effective input device, it is abused  heavily, particularly in the windows world.  This kills my  productivity in a number of ways.  It distracts me, in that I have  to navigate GUI elements when I want to be thinking about design or  implementation.  It gives me incredibly painful repetitive-stress  injuries (yes, i’ve tried a trackball, that’s worse).  Finally it  forces me to remove my hands from the keyboards costing me a couple  of seconds distraction and irritation while I try to find home row  again.

I mention all this in an attempt to convince the reader that this is  not a religious issue for me.  I keep an open mind.  I try using new  editors and IDE’s from time to time.  I think 3 months is sufficient  time to evaluate my own productivity with a particular editor.  I’m  the kind of person who takes time and energy to learn how to use his  tools effectively.  And that right there is my problem with both the  design of IDE’s and the general standardization approach followed by  most corporations: rather than striving for excellence, they tend to  enforce mediocrity.  For individuals who are not touch typists, who  aren’t willing to learn efficient keyboard commands and the effcient  use of atomic macros, Eclipse is certainly better than EMACS.  For  individuals who don’t like to invest time and energy training  themselves in the effective use of tools, Eclipse is also  advantageous.  But for guys like me who strive for excellence, who  take joy in proficiency, Eclipse is a lead weight around our neck,  and a little bell ringing in our ears at random intervals centered  around a mean of about 1 minute.  It disturbs both our productivity  and the joy we take in our work.

More to the point, I understand that Emacs is the most efficient  tool for me to use.  I play guitar and find the chording in  Emacs fairly natural.  The same for the rapid opening and closing of  windows within the main emacs frame.  I enjoy playing around in LISP,  and extending the editor.  I like the way the Emacs community thinks  and goes about solving problems.  I find it very hard to live  without Emacs macro features.  I like using grep and sed, and  version control from the command line.  I hate having to use the  mouse, indeed using the mouse can be cripplingly painful for me.  I  find all the GUI elements most IDE’s offer to be hopelessly  distracting — BUT I realize that other people are different, and  they should have the freedom to use, choose, and develop tools that  suit their needs and idiosyncrasies.

In the end, standardizing our toolset removes yet one more  choice.  It’s one more area where we are told “don’t think for  yourselves, just follow orders”.  This is contrary to what  programmers should be doing: obsessively thinking about  what they are doing and whether or not it’s the best they could be  doing.

 

Java gripes

I’m not a big fan of YAPL’s (Yet Another Proprietary Language), so I’m biased.  I will say that Java is much better than VB, and it’s probably a good choice for a lot of applications, but it suffers from the cultural and design flaws that always seem to crop up in proprietary languages.  I blame marketing.  The marketing departments of the companies promoting their YAPL’s foster tribalism among programmers.  I.E. they encourage programmers to identify themselves as   “I’m a YAPL-X programmer.  YAPL-Y programmers suck”.  It’s kinda like the console wars:  retarded.  The correct behaviour is to isolate the best language for a particular task, based on the constraints you are working under.     This leads  to frustrating books, articles, blog entries and forum posts, with people attacking and defending their particular YAPL, rather than discussing the technical issues as neutrally as possible.  This leads to a high noise to signal ratio when you’re trying to figure things out.

For example, I wanted to use Java SAX (Simple API for XML) for a very simple application.  Using google to search for tutorials or what not gets you really out of date information.  For example, the top hit for “Java SAX” gets you www.sasxproject.org, which would seem promising, but it was last updated in 2004.  Much of the methods have changed, as have the include paths, as have the status of the libraries, etc. etc.  The official JavaDoc documentation is up to date, which is better than nothing, but it’s not a very efficient starting point.

As another example, consider the problem of converting a byte array to a string representation and back.  As of the date of this posting, entering “java convert byte array to string” into google gets you the following link

Googling “java byte array to string and back” gives you this as the number one link.  When I hit that link I got an ad with sound, and of course there’s no information on how to solve the problem.  Someone has posted a clue, which may be accurate, that when calling new String(byteArray) it’s actually Object.toString that’s being called -> i.e. loss of information.  Ok, that’s cool, but how to get the desired effect?  Not only that, but if the responder is correct, that says very bad things about all the information arrived at by “java convert byte array to string”.

I wonder whas going to happen now that Oracle has aquired Sun’s holdings.  Franckly I’m not particularly hopeful, but in the absence of data I attempt to remain neutral.

My thoughts on Windows 7

I recently installed Windows 7 on my home PC, and thought I would share my observations with anyone who is interested.

For those of you who are unfamiliar with me, I’m primarily a Linux user, and go to pretty extreme efforts to use Linux for pretty much everything. On rare occasion however, I find it necessary to boot into windows for a work related reason (generally becuase of people using proprietary file formats that I can’t open in Linux, although this is getting rarer and rarer. More often I boot into Windows because I want to play video games.

I did my install thusly: I purchased a new 1TB hard drive for all things windows. It’s probably way more than I need, but I thought it would be nice to have the space to just install all my video games, and not worry about how much drive space I have. Hard drive space has become so bloody cheap. I then installed Win 7 on the new drive, and because Microsoft can’t imagine anyone using any OS besides theirs, I had to use a Linux rescue disk to reinstall grub on the mba. It’s a quick process, but it’s just typical Microsoft arrogance, and I had to dig around to find the rescue disk.

Of all the things I’m going to complain about, none of them are surprising. They are all the typical bitches I have about Microsoft, and about software developed for Microsoft OS’s. I see the failures as usually coming from one of two sources: 1) marketing to the least common denominator -> i.e. they try to make the software pleasant for dumb asses, as opposed to rewarding people who take the time to learn, or try to learn, how to use the tools efficiently. This leads to fundamentally inefficient and unwieldy tools… and 2) Sheer fucking arrogance.

Okay, so now I can boot into Win 7. One of the reasons I upgraded is I was gradually getting to the point where many of the drivers of software I want to use aren’t supported, or don’t work on XP. My laptop came with Vista, so I tried it out for a few weeks, but I got so fucking annoyed at, I just wiped the windows partition from my laptop altogether. It’s now a linux only box. I did try to install Win 7 on the laptop, but guess what! Win 7 can’t recognize my GeForce GO graphics card as Sony has apparently done something non-standard with it, and won’t support any OS other than Vista on that model. So I can use my graphics acceleration correctly under Linux, but not Windows 7. That is absolutely abysmal.

Okay, so what, my main gaming machine is desktop, so let’s install it on there. Apparently it recognized my Cre

ative Sound Blaster card, and downloaded some driver for it off the net (without asking me), and then crashed and burned, so I had to dig out the original install disk to get my sound card working. That’s par for the course with Microsoft products, so fuck it, what am I complaining about.

That’s my biggest bitch about Microsoft products: The usual litany of bullshit that they have been heaping on us for so long that most users just take it for granted and don’t even think to complain about it. Of course Microsoft still hasn’t figured out how to install an OS without rebooting multiple times. Of course Microsoft gets to decide when to reboot your computer by default. Of course some application developer can decide to just reboot your fucking machine for you after an install. Why the fuck would you want to make those kind of decisions yourself? It’s not like you were doing anything important when we rebooted right? Microsoft and the developer culture around Microsoft makes it basically impractical to try to do anything with your computer while installing or doing any kind of system administration. Fuckers.

But of course I expect all of that Bullshit. I even expect the computer to come pre set up with a bunch of fucking folders that I don’t want, organized in a way I don’t like. Microsoft would never dream of letting users set things the way they like. Microsoft knows how you should organaize your data better than you. What I had hoped would be corrected in Windows 7 over Vista, was the interminable waiting for the OS to do some trivial fucking function, like delete a folder, search for a file, or whatever. You know, the shit that should take about a millisecond for a computer to accomplish, that is part of your daily PC work? I can’t tell you how many times I had to sit and wait for mintues for Vista to delete, open, or move a folder.  It’s just fucking intrusive, and kills my productivity or enjoyment.  So how’d Microsoft do with all that?

Okay, I’ll grant, it seems a little better.  I’m not screaming in frustration as much as I was in Vista, but it’s still worse than XP.  So my grade for 7 is:  SAD.  It’s sad that the best Microsoft could do was to make the user experience for 7 half as bad as they had for Vista (by comparison to XP which is nothing to brag about either).  It’s sad that even though Microsoft works with all these hardware vendors, and these hardware vendors design and test their shit for windows systems, but it’s still faster to get my system set up in linux than in Windows.  It’s sad that people are raving about how great 7 is because it’s an improvement over Vista.  They need a better basis for comparison.

Here’s an example:  I go into my XP drive to copy some game same files over.  First folder I check, I’m told I don’t have the permissions to access that folder.  Do I want to get them?  Yeah I fucking want to get them.  Okay, I’m willing to grant that this might serve a security purpose.  For example  I have to log in as root to access someone else’s folder in Linux.  That’s a good idea.  But do I have to put in a root password?  No.  It’s just a waste of time.  But whatever.     The real problem is it took win 7 almost 2.5 minutes to get permission to access the folder.  Seriously, WTF? There’s no excuse for that.  If I were on the team responsible for that piece fo shit, I’d be ashamed to put it on my resume.  As I type this, I’m waiting nearly 20 minutes for CoD4 to install Microsoft DirectX for Windows.  Why?  How can this possibly take so long?  I decide that something must have gone wrong, so I click cancel, and lo and behold when I start CoD everything is ready to go.  It just hung for some damn reason.  While I’m discussing DirectX, why is it that something like 80% of the games I install install DirectX again.  Over and damn over, the same damn version of direct X.  Is it because the programmers are too laze to write code to check if DX is already installed?

Here’s another great example.  After my clean install and after one of the automatic reboots, I was surprised to find a Creative Sound Blaster logo on my screen, along with a promt whether or not I want to install drivers.  I’m thinking “Awesome”, until after several minutes the process crashes and reboots my computer.  Slightly miffed, I dig out the install disk for the drivers and try that:  BSOD.   Now let me say, that’s fucking pathetic.  BSOD on a driver install on an otherwise clean install of Windows?  WTF?  You assholes should be fucking ashamed of yourself.   So I go to Creative’s site to download the right drivers… lets see what happens… I better save this post in case it BSOD’s during install.  Several minutes for the driver install  (WHY?)… should I make a tee?  What if it reboots, I’ll miss the error message…  Joy!  Installation completed successfully.  It asks me if I want to restart now…  I decide to see if i can play CoD with sound or not, and will reboot only if necessary.  So I start CoD and it promts me to install Microsoft DirectX… Again?  Why?  WTF?  I actually RAN CoD just five minutes ago, and now I have install more DirectX stuff?  Probably some audio components…  But still now sound, so let’s reboot again.  How many reboots is that until I can actually play a game?  At least 5, and that’s not counting the BSOD’s.  Count them and it’s more like 10.  No wonder PC gaming is so much less popular than console gaming.

So I reboot, and then there’s a whole monitor covered with Creative marketing crap.  It tells me that I should check for updates.  But I just downloaded the drivers from Creative’s web site, surely they are up to date?  Well, let’s check.  It will surely come as no surprise to you that indeed there were critical updates for my drivers, which I had not 5 minutes ago downloaded from Creative’s site.  That this is no surprise tells you how much Microsoft’s Customers should better be called Microsoft’s Bitches.   And guess what I have to do as soon as the updates are installed?  Yeah, you got it, reboot again.

Another full screen marketing assault from Creative tells me I really ought to register my product.  What the fuck is my serial number?  Ignoring them I notice that Steam has finished downloading fallout 3, and I think “hey, I bet this’ll give me more to bitch about in my blog”, so try running that.  Guess what it has to do?  Yeah, that’s right, install direct X.  Then it has to install some other crap, and when it reaches “Microsoft .NET Framework 3.0 x86 Setup” it tells me I must use “Turn Windows Features on or off” in the Control Panel to install or configure Microsoft .NET Framework 3.0 x86″.

Anyways, I finally got it running well enough to play a game or two.  I have more issues with my soundblaster card on windows than i do in Linux.  So I gotta say, Windows is harder to get working than Linux.  Big day.

Gecko’s Guide to GIT

I’ve convinced my work colleagues over at Gecko-Research to start using Git.  I’m a git neophyte myself, but now I’m in the position of setting up our Git repository, and teaching my colleagues how to use it. I’ve written up a little guide to using Git, aimed as a reference for myself and my colleagues.   As such, it’s just a list of the commands that we use on a regular basis, or the situations we are often confronted with (and how to deal with them).  The post is totally a work in progress, so it will likely change quite a bit over the next few months as I flesh it out as needs arise.

If you are interested in a general introduction to git, or a tutorial, I would suggest one of the following:

Git has a reputation for being difficult to use, or counter intuitive, but I think that’s just due to it being a distributed rather than central revisioning system (based on the concept of a central repository).  Some things do get tricky, but I think it’s primarily because git lets you work in new ways that can potentially trip you up.

Central repository systems are easy to conceptualize,  and they’re what people of our generation are used to, so they are easy to get started with.  Git  is based on a distributed model, in which each repository is equal (we can assign different roles to different repositories, but it’s not technologically imposed).    Considering that distributed systems are so becoming the norm (bittorrent, wikipedia, the free software movement, multi core computing, creative commons, blogging, twitter…) ,  I suspect tech heads growing up now will find thinking in a distributed way as simple as we old farts find the top-down, central-repository, client-server model.

Daily Use

Note that these comments are aimed at my colleagues. Your work situation may vary.

commiting

You should commit your work whenever you get anything done that can easily be summed up in one line (the commit message). There are other reasons to commit, so when in doubt, do a commit. It’s easy to go back if you need to. Committing doesn’t go on the net, it just tells your local git repository that you got some work done, and puts those changes onto the local index (git’s database of what’s what). Frequent commits will save you hassles. The command is:

 git commit -a

The -a tells git to commit all modified files (which are being tracked). You can also just commit specific files by using

 git commit <list of files>

more to come…

Configuration

gitignore file:

A gitignore file specifies intentionally untracked files that git should ignore.  It concerns files that are not tracked by git, and that you don’t want to track with git, so temporary files, results of compilation, compled documentation, etc.  The man page is here.  When git is determining what files to ignore it:

  1. Checks for a relevant command line option
  2. Check patterns from a .gitignore file in the same directory as the path, or in any parent directory.
  3. Check for patterns in $GIT_DIR/info/exclude
  4. Check for patterns in the configuration variable core.excludesfile

The man page describes the patterns, which are anyway pretty close to the usual *nix conventions that you’ll probably just get them right.  As an example, here’s my .gitignore file for a netbeans project:

*.class
*~
build/
javadoc/

This tells git to ignore any build or javadoc directories, as well as emacs temporary files.  Taking the time to setup a .gitignore file when you are starting a new project with git will make everything else more convenient down the line.

Collaboration: tracking multiple branches

Because of some wonky security policies on our institute’s network, we can’t directly push and pull from each other, so we go over a central repository. Many of us work on multiple machines, so we want to use the central repository as a convenience tool for synching up between our machines, but we don’t necessarily want out colleagues pulling our work-in-progress. The solution is for each of us to have our own branch. This post tells us how to start a new branch on a remote git repository. The steps are basically:

  1. Create a remote branch. This can be done with the command
     git push origin origin:refs/heads/new_feature_name

    (assuming your remote repository is called origin).

  2. Make sure everything is up to date with
     git fetch origin
  3. Start tracking the new branch with
     git checkout --track -b new_feature_name origin/new_feature_name
  4. Make sure everything is up to date by doing a pull.
    git pull

The third command,

 git checkout --track -b new_branch origin/new_feature_name

is one you’ll run several times, every time you clone a repository somewhere, you’ll want to use to track all the various branches you are interested in. That way you can checkout your colleagues (or bug fix) branches when you like, and merge them into your work whenever it is useful.

Situations

Deleting a branch. Okay, so you’ve been branching all over the place, and now you realize you have some dead hanging branches you really don’t want cluttering up your repository anymore.   To get rid of a branch on the remote repository, you’ll want to do the following:

git push origin :head/branch_to_delete

Emacs over terminal to dreamhost, 5C and 5D instead of forward-word and backward-word

I’ve been unable to use the C-rightarrow and C-leftarrow to get forwad word and backward word behavior when using emacs within a ssh to my dreamhost host.  I finally figured out how to fix the problem.  In my .emacs file:

(global-set-key "\M-[1;5C" 'forward-word) ; Ctrl+right->forward word
(global-set-key "\M-[1;5D" 'backward-word); Ctrl+left-> backward word

You might be interested in my entire .emacs file, which adds a few niceties:

(set-background-color "light grey")
(global-font-lock-mode 1)
(transient-mark-mode 1)
(setq default-tab-width 3);
(setq standard-indent 3);
(setq inhibit-startup-message t);
(global-set-key "\M-[1;5C" 'forward-word)     ; Ctrl+right->forward word
(global-set-key "\M-[1;5D" 'backward-word) ; Ctrl+left ->backward word

Setting up Fedora as a local webserver

I’ve recently had to set up a couple of fedora installations as a web server, for the purpose of testing some PHP scripts (for example a Zen Cart install). It’s pretty trivial, but each time I wasted time remembering what it was I had to do.  Now that I’ve written this,  I doubt I’ll forget again.  Oh well.

So here’s what you have to do:

  1. Install PHP if it’s not there yet (yum install php)
  2. Start (or restart) httpd (service httpd restart).
  3. Put yer content into your systems html directory.  On Fedora that’s var/www/html
  4. You can now view the web content in your browser at http://localhost/

The productive programmer

Just checked out a pretty fantastic book, The Productive Programmer by Neil Ford.

I’m only about half-way through it, but so far I find it fantastic.  I read it at night before going to bed.  This speaks of its readability, but it’s a bad strategy, since I get excited while reading it and want to try things out.  Every night for the last three nights I’ve said to Bettina “man, I wish I’d read this book years ago”.

It’s obviously aimed at the developer, but I think about 40% of the tips in it are relevant to Bettina, who is a school teacher.  The thesis of the book can be summarized as follows:  The GUI makes things easier for a computer neophyte, but less efficient for the power user.  As programmers, a major part of our work is data entry (we form the data in our heads, but it’s gotta get into the computer).  So it behooves to put a little effort into making the data entry part more efficient.

He discusses various repetitive, boring tasks that chew up our time and attention, and then gives tricks to improve your efficieny, on windows, mac, and Linux based systems.  He also discusses good algorithms for figuring out how much time to spend automating problems, and how not to shave yaks.

Me personally, I would expand his thesis to include end users.  How much time do you spend working with your computer?  Bettina is a school teacher and she spends at least 20 hours a week on the damn thing.  Me I spend like 60.  I think 20 is about minimum for anyone who works with a computer at all.  So I think we’d all benefit from learning better computer work habits.  Because the author writes to programmers however, he rightfully assumes a certain amount of computer savy.  This might make the book unnaproachable for less technically literate users.  I have a hard time judging that.  But if you think you can read it, I highly recommend it.

It’s also inspired me to start posting the most useful productivity tips that I run across, so look forward to that. Does anyone know of an existing blog that specializes in programmer-productivity tips (I’m not talking language stuff here, just computer-human interaction)?