Monthly Archives: February 2013

Web Development – Pushing The Change Forward Now

For years web developers have been forced to cater to the lowest denominator, this usually being the most featureless non-compliant browser available.  With web compliant standards available to the public and a consortium of propeller heads to keep these standards in check, I believe it’s time for a change.  As web developers I think it’s time that we no longer develop for the weakest, I think it’s time we develop for the strongest most feature rich browser(s) out there and don’t look back at browsers that take it upon themselves to go off on their own direction or that don’t want to evolve with the times.  For too long developers have been forced to implement terrible code just to make the site somewhat presentable on horrific browsers.  I say from this point forward we develop for the the strongest browser and force non-compliant browsers to either catch up or get out of the game, enough is enough (yeah…I’m looking at you Microsoft).

I know in hearing this there are some that will say the same ‘ol same “Well, our company is standardized on browser (x) and we can’t change…blah blah blah”.  In this case, the problem isn’t the browser, it’s your director or
CTO that needs to be changed.  Changed with a person who has windows in his/her office and can look outside and realize “Oh hey, it’s not the 90’s anymore”.  People, do not standardize on old browsers, it is the most ridiculous thing you can do.  I’ve also heard the argument of “Well…we are standardized on this browser because it’s secure and…blah blah blah”.  No!  It isn’t, updates to browsers exist for a reason, because security flaws get found and fixed.  Update all of your browsers to the latest version or close to it, do the research, do your job.

If we all only developed for what we believed the strongest browser to be (In my case it’s Google Chrome, for more reasons than I can count) the other browsers would be forced to catch up and be compliant, otherwise people wouldn’t use them…unless for some reason they are mentally deficient.  But that is beside the point, build for the future, not the past.  It’s time to start forcing the hand of these companies, we are web developers, we are innovators, we are the future of connectedness and it’s time to start moving forward.

SVN and VIMDIFF – Now Play Nice

I use svn quite frequently however, the standard diff tool built in with svn leaves a lot to be desired.  Its output reminiscent of a command line patch.  Personally, I love vimdiff (or vim -d if you prefer) when it comes to comparing files.  Recently I hooked vimdiff into svn diff, now I get all the power and love of vimdiff by executing “svn diff …”.  Here’s how I did it.

First create a wrapper file called “svndiff”.  You’re going to want to do this so you can ensure everything gets displayed the way you want it to.  I created mine in the home directory.

touch /home/godlikemouse/svndiff

Next let’s edit the file and tell it what to do with the information that will be passed to it from svn.

 

#!/bin/sh

/usr/bin/vimdiff ${7} ${6}

 

I like to have my local working copy displayed on the left and the remote or svn copy on the right.  If you like yours the other way around, just reverse the last two parameters to: ${6} ${7}.

Next we need to make the script executable.

chmod a+x /home/godlikemouse/svndiff

Lastly, we need to tell svn to use this file instead of its own built in diff.  To do so, edit the “.subversion/config” file located in your home directory (ie. /home/godlikemouse/.subversion/config).

Find the section labelled [helpers] and add the following command:

[helpers]
diff-cmd = /home/godlikemouse/svndiff

That’s pretty much all there is to it, now when you execute a command like “svn diff index.php” it will use vimdiff or whatever diff program you prefer.

Just as an enhancement, I like to have my terminal title set to the working copy and revision of the file respectively.  If you would like the same, add the following to your svndiff file:

 

#!/bin/sh
 
TITLE="${5} - ${3}"
TITLE=`echo ${TITLE//(/\\(}`
TITLE=`echo ${TITLE//)/\\)}`
TITLE=`echo ${TITLE// /\\ }`
TITLE=`echo ${TITLE//-/\\-}`
 
/usr/bin/vimdiff -c "set title titlestring=$TITLE" ${7} ${6}

 

There we go, nice and clean.  Now the title shows up perfectly showing the working copy of the file and the revision.  Party.