arei.net - work
Maven Vitriol

I’m an ANT guy. I’ve been using ANT since 1999. It’s amazingly powerful, amazingly useful and very flexible… and I’ve never once written my own ANT task. Just using the ANT tasks available or out there in the community I have been able to build hundreds of software projects.

Now, of course, everyone says, “Go Maven”. So I went Maven… and it sucked.

See, I have very strong feelings about Frameworks. (Not to confuse you here, but Maven, like ANT, is a Build Framework.) The problem with 99% of all Frameworks out there is that they force you into a specific way of doing something. “But that’s the whole point,” you scream at me. And I agree, that’s the point… until the moment you need to do something else.

Now, I use frameworks all the time in my software development, we all do. There’s one listed over on the right side in my links section that I actually endorse. So am I not hypocritical for deriding frameworks in one breathe while using them in another? Of course I am, but here’s where i’ll caveat it… I use frameworks that provide the least limitation on me doing new things. Maven, as an example is a rigid framework. Doing something new with it is difficult challenge. ANT on the other hand, while limiting, isn’t nearly as limited.

So here’s AREI’s Framework Measurement Testing System. First, evaluate a framework for the project you are working one, say building a Java Swing application. Next, evaluate the framework for another, completely different project you might work on in the future, say building a Website. How does the framework stack up for both things? Finally, consider what’s going to happen when you need to take the framework beyond it’s scope into new places. How accepting of that path is it?

Here’s some examples:

I had an ANT script that would append together a bunch of .JS files and then minify the entire set. Worked like a champ. The project I was on decided let’s give Maven a try instead of ANT. So I had to come up with a way to do the same thing in Maven. Two weeks of work later I ended up just calling ANT from inside of Maven.

Anyway, this post was really meant as just a simple link to an awesome blog posting that unleashes some much needed fury on Maven. But I got a little carried away in the intro.

So in summation, Maven sucks. Pick a framework that you can change. Damn the man! Save Empire!

comment on this post
The 2.8% Raise

So, I’m due to have yet another annual review this week. If you read my earlier post “Deciphering What your Annual Review Means” you might recall I’m not really that excited by annual reviews or their results.

But, in preparation today I went out and did a little math. According to the Consumer Price Index (CPI-U) which measures how much things costs for the average person, the costs of things has increased an average 2.8% every year for the last 10 years. That means, any merit increase I see that is less than 2.8% means I’m losing money. And a raise of 3% means I’ll see .2% more money a paycheck! Hold me back I’m going on a spending spree. (That was sarcasm in case you missed it.)

Honestly, I expect 4% though and I’ll have to start lining up some interviews after the holidays.

comment on this post
Deciphering What You Annual Review Raise Means

Recently my boss came to me and told me that my annual review was coming due.  I’m not sure if he was telling me this to warn me to get off my ass and be productive, or if he was giving me a heads up that I might want to start looking for a new job. The fact that his message was unclear got me thinking though; what exactly do I expect from an annual review?

From an employee prospective the annual review is about one thing: big fat raise. Employers can push their “growth plans” and “360 reviews” all they want, but for the actual employee it simply comes down to how much more money they are going to see in their paycheck.  Honestly, every time you have ever been given a raise, what’s the first thing you do? You check out how much more per paycheck that means to you.

But getting past the 37$ more a week thing, what does the percentage raise your boss just told you really mean to you?  And what does it mean in perspective of your bigger picture?  Is it a worthwhile number? Does it merit staying with the company another year?  Or is it more profitable to your bottom line to go elsewhere?

These are the questions your employer really does not want you thinking about.  Yet, employers run their companies as a business.  They are in it to make money.  So they should not be surprised when an employee runs their own life in the same way.  You are in it for the money and it is money that talks.

So, in light of my own upcoming performance review, I decided to write down a scale of exactly what my feelings should be toward my company depending upon the percentage my boss tells me at the end of my performance review.  The idea being, that I don’t have to rush back to my desk and figure out how much more per paycheck I’m going to get.  Instead, I want to hear a number and instantly know if I’m being insulted or congratulated.

Now, before you go read the charts I want to tell you to please remember to take this with a grain of salt.  Employee/Employer relationships are complex things, and you should be mindful of that.  You also need to be mindful of your own situation, the availability of jobs in your industry, how valuable you are in the work place, blah blah blah.  All I’m saying is to think before you leap.

Also, this is just about an increase to your salary here.  Things like bonuses and stock options do not count because they are a one-time payout.  If you boss gives you those, that is a nice thing to do and all, but a merit increase is about sustained growth not a one time bump.  If your boss does this kind of tactic, just ignore the bump factor and focus on the growth factor.  The bump is a nice way to say thanks, but it’s the raise that counts.


0% This company is actually the worse off because you are an employee here.  Get the hell out.
Getting 0% as your annual review is basically tantamount to being fired, regardless of the reason.  A company will tell you “we had a poor first quarter this year and that hurt everyone’s raises.”  But what you really should be hearing is “Get the hell out.”  The company is basically telling you that regardless of your performance they do not want you to stick around.  If they cannot even muster a token increase, the company is doomed to failure.


1% We basically gave you a raise because we have to but nobody here likes you or wants you to stay.
The 1% raise is the token insult raise; a little something because they must, but honestly they’d just rather give you nothing. If you were a minimum wage worker your company basically just told you that they think you’re worth only 6 more cents an hour. If you made the median household income in the United States as of 2005, this would roughly translate to $8.91 more a week. I recommend you spend that money on resume paper and go find a new job.


2% We’d really prefer it if you just saved us all a lot of trouble and stayed at home sitting on your sofa.
This raise translates to $17.81 more a pay check. Unfortunately that won’t even cover the cost of the gasoline you use to get to work every week. A company might give you this in hopes of motivating you to “excel” or “exceed”. I recommend that you take the hint and “Exit.” In fact, if your manager/boss person tells you that 2% is your raise this year, there’s no reason for you to stay another minute. You can probably make more money selling magazines out of a van.


3% We have decided to shower you with our greatness and you should be thankful for it!
Alright, this is the defacto raise that companies usually use for a base. Someone once told them that that was the “annual cost of living” increase. I’m sorry to tell them this, but last year the cost of a loaf of bread climbed 8%. That means it’s roughly 8% more expensive to eat this year than it was last year. Worse yet, companies make this seem like they’re doing you a wonderful favor. A favor would be if you could afford to eat more than a damn loaf of bread.


4% You don’t deserve a brand new Porsche, but the people who own your sorry ass do.
Since 3% is the defacto raise, 4% is usually reserved for the companies that want to give out 3% but they know you did a kick ass job. In a company of 100 employees that made $1,000,000 in profit last year, a 4% raise for everyone in the company means that the company spent 18% of it’s $1,000,000 in profit on raises (assuming everyone makes the national median wage). To us, this doesn’t exactly say “Keep up the good work.” Instead it says, “Keep up the good work, you’re making us rich and we don’t like to share!”


5% We respect and value your lazy ass, but if you try harder we’d reward you better.
This is what I would call the bare minimum of fair raises. This says, you’re doing an adequate job and we see potential for improvement. Keep striving to be a better employee and next year there could be a more than 5%. This is usually the lowest raise at which I wouldn’t suggest looking for a new job right away. But I’d temper that by telling you that you could probably get more money by changing jobs.


6% You’re doing a decent job but we’re a little too cheap to really show you we appreciate you.
A company that shells out 6% is one that actually values you as an employee. They know you’re doing a good job and they want to keep you around. Unfortunately, someone in the management chain is cheap so the 6% raise is usually reserved for the one “rockstar” employee. I would argue that 6% is a token show better than 5% which every employee ought to have gotten, so it’s really not “rockstar” ready. You might want to take a look around the company and see how many 6% raises they gave out. If you’re it, than the company might just be a little too cheap for your dream of buying beach front property in Jamacia.


7% Way to go! Keep up the good work and someday we’ll promote you into management.
Finally we’re getting into the category of raises that say the right thing. These raises tell an employee that they did a good job and by golly you want them to stick around. Unfortunately, for companies these days most employees can get 10% just by changing jobs. If you got one of these raises, it’s time to weigh that extra 3% you could get from changing jobs against your apathy of looking for a new job. If the job conditions are good, a 3% jump and the risk of changing jobs might not be worth it.


8% We think you’re the best thing since sliced bread and we’re willing to do what it takes to keep you.
Remember back in the 3% raise we talked about sliced bread? Up 8% from last year? Well, with an 8% raise you are keeping abreast of being able to feed your family of four and your dog and a picket fence. The good news is that your employer really values you. The bad news is if you are only breaking even on feeding your family, you’re lifestyle is pretty much stuck in a rut. Keep your eyes open for golden opportunities, but you really have it pretty good.


9% You’re doing an excellent job and are exactly the type of person we want to keep working here.
Obviously someone at you company thinks your hot stuff and went the extra mile for you. It’s probably your boss and we assume if you got this raise you have an awesome boss. Awesome bosses are extraordinarily hard to find, so before you even think of jumping ship, take stock of what you have. It’s probably a pretty good thing.


10%
and up
You rule! We love you! Please, please, please do us the honor of working for us another year.
Honestly, if you get 10% or more, then your company absolutely rocks and you shouldn’t even consider thinking about changing jobs. 10% means the company recognizes your contributions, it believes in you as a long term employee, and it is willing to do what it takes to make sure you stay on board. And even more importantly, the company wants to reward your contributions to its success by helping you to your own successes. You simply cannot beat that.


So there you have it.  My quick and dirty field guide for determining if you are being insulted or rewarded.  It is my hope that you will take this out into the world, share it with your friends and co-workers, give it to your boss and her boss, and use it as a reference guide during your annual review.  You should even use it as a reference point when it comes time to fight for a better merit increase.

My advice to you is, hope for 10%, but be ready for 3%.  And then, be prepared to do what you must to better YOUR situation.

“Deciphering What Your Annual Review Raise Means” is released under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License which you can learn about at http://creativecommons.org/licenses/by-nc-nd/3.0/ and you can read at http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode. The original author is Glen R. Goodwin and can be found at http://www.arei.net.  You can find additional copies of this document at http://www.arei.net/stuff/AnnualReview.doc.

1 comment, add yours now
Workplace Comfort Level Score (WCLS)

This week I’m changing work locations. As part of this I was comparing the space I work in to the new space and trying to quantify which is better.  I remember that a while back I posted about Environmental Factors in helping to create the best possible work experience.  And then I was thinking about how to rate each space.  My idea was to come up with some nice scale, but it’s pretty obvious that each of these things is subjective and a single scale doesn’t work.  So here’s my idea instead:

1). ORDER THE LIST: Rate the following twenty items in order of importance to you.  Use a 1 for Least Important and a 20 for Most Important.  No Item can have the same number.  Now, here’s the important bit: If you don’t agree with the list, or something on the list isn’t a factor, replace it with something else.  It doesn’t matter what the items in the list are, so much as that there are 20 of them.

  • Privacy
  • Seclusion from Other People
  • Inclusion with Other People
  • Ability to Listen to Music Openly
  • Ability to Listen to Music on Headphones
  • Ability to Modify Environment Lighting
  • Cleanliness in Work Environment
  • Ability to See Outside
  • Ability to Hang Posters or Artwork
  • Lots of Wall Space
  • Lots of Desk Space
  • Lots of Floor Space
  • File Cabinet Storage Space
  • Nice Furniture
  • Comfortable Chair
  • Bookshelves
  • Ability to Wear Jeans and Flipflops
  • Access to the Internet
  • High Quality Computing Hardware
  • High Quality Computing Software

2). RATE EACH ITEM: Now go through and rate your workplace/workspace on each of the items from 1 to 5 where 1 means NO or LEAST and 5 means YES or MOST.

3). FACTOR EACH LINE: Multiple the rating from Step1 by the Rating from Step2 for each line.

4). TOTAL IT UP: Add all the numbers from Step 3.

5). DERIVE THE SCORE: Divide the result from Step 4 by 105 and round down.  This is your WCLRS score.  Use the following reference to help you determine how good your score is:

2 = PRISON = You work basically in a prison cell without the perk of the inmate on inmate love.  Get a new job.

3 = ABYSMAL = Things are pretty piss poor in your workplace if you are seeing a score like this.  Get a new job.

4 = BAD = Your workplace comfort is really pretty bad and that is keeping you from working at the top of your game.  You could try sprucing things up a bit with fake plants and the like, but without a concerted effort by management to create a better workplace, you’re pretty much screwed. Get a new job.

5 = NOT GOOD = It’s getting better, but really it’s not very good at all.  You could try working with your company to fix things, but I doubt you’ll be able to effect change.  Pity though.  You might consider getting a new job.

6 = ADEQUATE = Okay, your workplace is adequate.  It’s not great but it also beat working in prison.  Plus, clearly your company knows some of these factors are important and they might be willing to work on the other things. You might also consider getting a new job.

7 = PRETTY GOOD = This is down right pretty good.  Your working in a fairly comfortable place and clearly your employer values creating a decent place for its employees.  This, by the way, is the minimum rating for someone who works at home.  If you work at home and get below a 7, just chuck it all and go live on a beach in Guam.

8 = DAMN GOOD = You’re doing damn good.  It’s a nice work space, very comfortable, very enjoyable.  So long as the work doesn’t suck and the people you work with are not complete wankers, this is an excellent job.

9 = AWESOME = Damn near perfect.  You should keep this job even if you don’t like the people you work with.

10 = PERFECT = The gold star standard of workplace comfort.  If you work here, please email me at |a r e i .at. a r e i .dot. n e t| and let me know if you are hiring.

Here’s how I rated my current workplace, and how I rate the workplace I am moving to:

STEP 1 ORDER THE LIST:  For me the list is ordered like this…

01 = Ability to See Outside
02 = Ability to Listen to Music Openly
03 = Lots of Wall Space
04 = Lots of Floor Space
05 = Inclusion with Other People
06 = Carpeting
07 = File Cabinet Storage Space
08 = Nice Furniture
09 = Ability to Hang Posters or Artwork
10 = Bookshelves
11 = Lots of Desk Space
12 = Comfortable Chair
13 = Cleanliness in Work Environment
14 = High Quality Computing Hardware
15 = High Quality Computing Software
16 = Ability to Modify Environment Lighting
17 = Ability to Listen to Music on Headphones
18 = Access to the Internet
19 = Privacy
20 = Seclusion from Other People

STEP 2 RATE EACH ITEM: Here’s my CURRENT and my NEW workplace ratings.  The first number is the current, the second number is the new as shown here: current/new

4/2 = Ability to See Outside
1/2 = Ability to Listen to Music Openly
1/2 = Lots of Wall Space
1/1 = Lots of Floor Space
1/4 = Inclusion with Other People
3/2 = Carpeting
2/2 = File Cabinet Storage Space
2/1 = Nice Furniture
1/2 = Ability to Hang Posters or Artwork
1/1 = Bookshelves
1/2 = Lots of Desk Space
2/1 = Comfortable Chair
5/1 = Cleanliness in Work Environment
5/2 = High Quality Computing Hardware
5/2 = High Quality Computing Software
3/1 = Ability to Modify Environment Lighting
5/2 = Ability to Listen to Music on Headphones
4/2 = Access to the Internet
2/3 = Privacy
1/2 = Seclusion from Other People

STEP 3 FACTOR EACH LINE: Just multiple each lines rating by the order position, gives me the numbers below again in current/new format.

04/02 = Ability to See Outside
02/04 = Ability to Listen to Music Openly
03/06 = Lots of Wall Space
04/04 = Lots of Floor Space
05/20 = Inclusion with Other People
18/12 = Carpeting
14/14 = File Cabinet Storage Space
16/08 = Nice Furniture
09/18 = Ability to Hang Posters or Artwork
10/10 = Bookshelves
11/22 = Lots of Desk Space
24/12 = Comfortable Chair
65/13 = Cleanliness in Work Environment
70/28 = High Quality Computing Hardware
75/30 = High Quality Computing Software
48/16 = Ability to Modify Environment Lighting
85/34 = Ability to Listen to Music on Headphones
72/36 = Access to the Internet
38/57 = Privacy
20/40 = Seclusion from Other People

STEP 4 TOTAL IT UP: Add up each number for current and each for new to get the totals:

Current: 594

New:386

STEP 5 DERIVE THE SCORE: So here I take the totals and divide by 105 for my score:

Current: 594/105 = 6 = ADEQUATE

New: 386/105 = 4 = BAD

So, now that I have it all figured out, I am basically going from ADEQUATE to BAD.  That doesn’t sound like an upgrade to me at all.

Time to get a new job.

comment on this post
Resume Updated

My Resume was updated as part of my bi-annual housekeeping.

comment on this post
Google Wave is Fun

I have had a Google Wave Developer account for a few weeks now, but haven’t had the time to start developing with it.  Soon though.  Anyway, the point I was going to make is that recently a coworker just also got his account and he’s the first person I’ve had a live conversation with and well… it’s just fun. Yes, there are bugs and some of them are down right annoying, but once you get past those, the system really is just fun to play with.

comment on this post
Google Wave

Google announced yesterday a new offering called Google Wave.  There is an excellent article at TechChrunch that gives a complete overview.  All I can say is: THIS IS HUGE PEOPLE. The concept of Google Wave, the underlying idea is exactly the right step that the web and the internet needs to take. It’s a combination of Email, Instant Messaging, Twitter, Transparency, Collaboration, Wiki, Media sharing, and so much more.  Oh, and it’s an Open API and Open Source to boot.

If you’ve ever talked tech with me in the last three years and we’ve had the discussion about what is next in technology, then we’ve had a very similar discussion about the concepts behind Google Wave.  I’m not claiming Google has once again stolen my idea, but what I will claim is that there clearly is a need for this type of product that I saw and google saw and others saw as well.

Two things in particular I want to call your attention to that make Google Wave a huge idea:

1). Adhoc groups… What adhoc grouping really does for you is to let people create internet groups as easily as they create real world groups.  Think of it this way… when you walk into your work place break room and two other people walk in and the three of you start talking, you have created a group.  It’s fast in the real world, why can it not be like that in the internet world? For most of the internet when you want to form a group and start working together there’s a fairly large investment in creating the meta systems the group needs: setting up a mailing list, setting up forums, setting up a media store, setting up a user database, etc etc.  It’s a pain in the ass really, and it make setting up a group fairly non-trivial.  To some degree, Yahoo Groups and Google Groups automates a lot of that, but then you still have to go through the effort of getting people to join etc.

What Google Wave does is to make group creation simple and almost instantaneous.  Basically, you create a group by dragging a bunch of contacts together and off you go.  You can immediately begin discussion, expand the group, whatever.  Additionally, if you need other tools for that group like a map or a document or some other thing, you can add a widget or a robot to participate in that  group and boom, you have more functionality to fill the groups need.

2) The second feature that is huge for me is transparency.  Transparency is the notion behind Twitter in that you broadcast snippets of your activities out to the world and everyone can see what you are doing.  This is the beginning of transparency though.  To take it further you need to automate transparency such that as you do things, they automatically are published.  Of course, this brings up privacy concerns, but I think there are simple ways to solve this.

I know that Wave has some level of transparency, but it’s still to early to tell how much.  I suspect that even if this is an opt in version of transparency, like Twitter, that soon there will be robots and widgets (the extensions to Wave) that will automate a lot of this functionality.

The point is, though, that transparecny can be a huge social tool… but more importantly it could be a huge business tool.  And the company that sees this is going to get a huge edge over the company that does not.

Anyways, that’s my thoughts on Google Wave.  You should efinately check it out.

comment on this post
Do They Flow?

Lately I’ve been having a lot of conversations with people about what environmental factors go into creating the perfect work/space environment for a person.  This in part may have been introduced by Eric Spiegel over at Datamation posting a couple of articles recently asking Where’s Your Coding Happy Place and Finding The Coding Zone: Your Perfect Trifecta.  In the articles he discusses where is the best place for him to code and what external stimuli facilitates that.

In User Interface design there is a concept called Flow.  Flow represents that “in the zone” state about which Spiegel talks.  It is this perfect state of unity with ones work.  It’s a wonderful place to be and when we can achieve it we are at our most productive and do our best work. The problem with Flow or “being in the zone” is that it is amazingly easy to interrupt.  A ringing phone, a coworker asking a question, or piece of email can all break you ot of your Flow and completely disrupt the brialliant work you’ve been doing.  And once Flow is interrupted it is fairly hard to recover again.

Breaking flow is really easy to do and there are a number of pieces written about things that do this.  Just about any kind of interruption or distraction will do it.  In a User Interface, for example, a popup dialog box or an animated paper clip can be enough to completely destroy the user’s Flow.  It’s considered bad UI Design to create activities that break flow.

What is much harder to quantify is what exactly does it take to achieve flow?  This is ultimately the question that Spiegel is asking in his article about “The Coding Zone.” A lot of people go about achieving Flow in different ways: turn off the phone, close the email application, close the door, blast the music, have food and drinks at hand, turn the light on, turn the lights off, work at 3am in the morning, whatever it takes.  And a lot of people know what it takes for them to find Flow.

For me, Flow is about comfort and ignoring the rest of the world.

First and foremost I need to be comfortable.  A good chair, appropriate lighting, keyboard perfectly position in relation to seat.  All these things factor into comfort for me.  In particular, lighting is very important.  I’m one of those “likes to program in a cave of darkness” person.  Unfortunately, I’m also one of those people forced to work in a cubicle with overhead florescent lights.  I have managed to convince my fellow cube mates to keep the overhead lights off and rely on the personal cubicle light, but sometimes this takes a little arm twisting.

As to ignoring the rest of the world, well that’s fairly easy: turn up the music so you don’t hear outside sounds, don’t answer the phone (unplug it if necessary), and turn off the interrupting applications.  I’m pretty adepts at just ignoring the Instant Messages, Emails and Phone Calls that cross my desk.  I’ve also minimized the interruptions that they present… for example, email plays a simple low volume sound for me, but nothing else.  It lets me know it’s there, but does not draw me away from what I am doing.

Flow allows us to work at our highest, most efficient levels.  So why do our employers fail to set us up to achieve flow?  Instead of helping us to find our “zone” they do everything in the power to surround us with distractions.  In my workplace I have to dress a certain way, I have to be there at a certain time, I have to work in a cubicle listening the the minutia of my coworkers.  None of these things is helping me find my Flow.  In fact, all of these things are actively hindering me from doing my best work.

Let me repeat that: My company is actively hindering me from doing my best work.

Kind of scary when you think about it.  You would think that for a company, quality is the most important thing.  Yet from the actions of most companies, that’s hardly apparent.  In my workplace, quality is second to how the company appears to the outside world.  Perhaps that’s the nature of business, but it really just speaks to a lack of quality.  That makes me sad.

So, let me leave you with a question… but instead of asking how you find the best Flow like Spiegel does, I’m going to ask you this: Is your company intersted in quality or something else? Do they encourage flow, or do they discourage it?  Do they Flow?

1 comment, add yours now
Abstracted Fear in Software Engineering

Why am I never amazed when a software engineer wants to add complexity?  By this I am talking about all these abstraction layers of tools and frameworks and engines.  These tools/frameworks/engines are supposedly designed to save developers time, but really just add complexity to the stack and in the end don’t end up saving time at all.   Now, instead of just knowing programming language X I need to know Programing Language X and Abstraction Layer Y. How is working in two technologies easier than working in one?

I know some will argue that “Well you only really need to work in Abstraction Layer Y.”  Except that is never just the case.  Abstraction Layer Y is great until you have to do something that is outside the basic cases of Abstraction Layer Y.  Then you have to go back to working in Programming Language X.  Suddenly you’re working in both.

Don’t believe me?  Consider the case of Google Web Toolkit (GWT)… GWT lets you write web pages in GWT’s Java Toolkit.  It removes the need to work in HTML and Javascript and CSS.  Except, well, CSS is still use to provide your sites look and feel.  Oh, and you still use HTML inside the GWT code.  Oh, and you want to do something a little more complex than what GWT offers? Looks like you’re going to have to embed Javascript into your GWT code as well. So, instead of just having to work with HTML, CSS, and Javascript, now I have to work with HTML, CSS, Javascript and GWT.

Seriously, it’s basic math.  X + Y > X where Y is greater than 0. Yet time and again engineers are all gung ho about Abstraction Layer Y and I suspect it’s for one reason: Fear.  They’re afraid that they will have to do work, they’re afraid that their incompetence will be visible, they’re afraid that their value to the company will be realized. Fear is an extremely strong emotion and it can lead to panic, chaos and distrust.  But underneath it all is pure cowardice.  Cowardice to get things done, cowardice to admit your shortcomings, and cowardice to realize your own mediocrity.

And the worst kind of cowards are the ones that want to do trade studies.  Let us spend all of the budget and time for the project on comparing Abstraction X to Abstraction Y to Abstraction Z before we choose one.  Don’t worry though, we’ll have plenty of time and money after we run out of time and money to build the software.  Shouldn’t take more than two weeks, right?  The engineers that want to do this are the ones with the most to fear.  I believe that they would rather do trade studies than write code.  If you don’t want to write code, if you don’t LOVE to write code, you’re not a software engineer… you’re middle management.  You need to realize your fate and go work for the federal government wasting tax payer resources.

So, is there ever a case where Abstraction Layer Y makes sense? Probably, but it’s far, far less frequently than one might imagine.  Sometimes an abstraction layer can actually achieve the nirvanic state that it set out to do.  It’s kind of this sweet spot between being overly simple and overly bloated.  And I suspect that of the thousands of Abstraction Layer Y’s out there, only 1 or 2 have actually succeeded in finding that spot.

And yes, this is a little bit of a rant against Abstraction Layers… but it’s not a rant against the people who write Abstraction Layers.  The people who write Abstraction Layers are freaking genius.  Basically they have identified the fears of software engineers and are exploiting it to make money or recognition or whatever their particular motivation is.  This is brilliant in my opinion and I seriously need to start working at one of these companies.

To conclude: Abstraction Layer Y sucks and is a waste of time.  Just write the code yourself.  It’s not that hard.  If you think it is that hard, you need to quit your job now and go manage the fast food restaurant you were always destined to manage.

1 comment, add yours now
Minification

There has been a great deal of discussion lately about the value of minification, yet very little concert value. To that end I have decided to set down my thoughts from these discussions and share them such that everyone can be on the same page. Below I will outline what minification is and what it gains you. This is followed by discussion of minification versus HTTP Compression. Next, I will look at concept of minification as obfuscation and the usefulness of obfuscating in general. Finally, I will share my recommendation on the subject of Minification and which tools I would recommend.

MINIFICATION

To start, lets define what minification is: Minify or Minification is the process of taking some source file and compressing it to a smaller size by removing whitespace and comments. A number of other small rules are sometimes applied as part of the minify process, but these are less significant. For example, Minify will shorten variable names to two or three characters and thus gain some space there.

Consider this simple function which is not minified:

for (var i = 0; i < 100 ; i++)
{
    var randomnumber = Math.floor(Math.random() * i);
    document.write("A random number between 0 and " + i +
                   " is " + randomnumber);
}

When minification is applied this function becomes thus:

for(var i=0;i<100;i++){var randomnumber =Math.floor(Math.random()*L);document.write("A
random number between 0 and "+i+" is "+randomnumber);}

(Please note that any line breaks you see in the minified code above are due to word wrapping in your mail reader. Minified code is generally always a single line.)

In essence, minification reduces overall code size, and thus reduces the clients download time. The downside of minification is that by removing whitespace and comments and renaming some variables, the code becomes unreadable, extremely hard to debug, and may introduce unforeseen and hard to find bugs.

When we are talking about Web applications both Javascript (JS) and CSS files can be minified.

In a small test case I put two files through the minification process to see what the net gain would be. The Javascript file is of small size with few comments. The CSS is a large CSS file with few comments.

FILE SIZE                                JS                    CSS             
Bytes                                    17954                 39020
Minified Bytes                           10413                 31178
Net Gain                                 42%                   20%

As can be seen minification is much more useful to Javascript where whitespace is used much more. CSS tends to have less whitespace and thus it’s gains are lesser. Also, gains will be much larger if your code is heavily commented. Since comments are removed, minification gains are directly related to the amount of comments.

So, a 42% gain seems like a lot when you are talking about really slow network connections. Yet the question is, are those gains really worth the sacrifice in the ability to debug your code? And if one does not want to sacrifice the ability to debug and read the code, what can be done instead of minification?

HTTP COMPRESSION

HTTP Compression is a standard part of the HTTP 1.1 protocol that is in use in almost all major browsers and web servers on the market today. In essence whenever an HTTP request is made by a browser, if that browser supports HTTP Compression a special parameter is added to the outgoing request that lists the different compression algorithms that the browser can uncompress. When a Web Server sees this special parameter, it checks to see if the requested file can be compressed and if the server has one of the compression algorithms that the browser has said it can use. If all this is true, the server will run the compression algorithm over the response before it is sent back to the browser. The browser receives the compressed response and make it uncompressed before making it available.

HTTP Compression has many advantages and few disadvantages. Foremost, HTTP Compression is an entirely automated process that is handled by the server and requires only a minor configuration change on most Web Servers to enable. The Browser requires no special functionality to use compression. The disadvantage of compression is that there is a minor performance hit to both the server side and the client side. The server side must spend time compressing the response. The client side must spend time uncompressing the response. Yet, in most cases the file sizes involved make the time spent in compression minimal. If files sizes were significantly larger, compression might begin to cause performance problems.

Let us consider our test files again. This time let us look at our net gain from using HTTP compression only.

FILE SIZE                                JS                    CSS             
Bytes                                    17954                 39020
Compressed Bytes                         3906                  6708
Net Gain                                 78%                   82%

Right away its apparent that HTTP compression offers significant gains. When compared to our previous results from minification, HTTP Compression is the clear favorite. The reason for these significant gains that the HTTP Compression works across all the bytes of the source files whereas Minification largely leaves the meat of the CSS and JS files alone and works mostly on the whitespace of those files.

Given the gains of HTTP Compression the next logical step is to ask, what if I did both minification and HTTP Compression. The result is even greater improvements, but not as much as one might imagine. Consider our test files again:

FILE SIZE                                JS                    CSS             
Bytes                                    17954                 39020
Compressed & Minified                    2514                  5907
Net Gain                                 86%                   85%

Overall when employing both techniques, the gain of minification is not as significant. For our JS file there is only an 8% gain over just plain HTTP Compression. There is even less gain when looking at the CSS file. However, please remember that both the JS and CSS files in our test are very light on comments. More comments will increase the gains somewhat, but less than one might think.

Given these results, the question to be asking is does the sacrifice of being able to debug and read my Javascript and CSS outweigh my need to gain an additional 8% over just using HTTP Compression.

So maybe Minification is not the way to go after all, but what about Minification as a means of protecting my code from people whom want to steal my hard work?

OBFUSCATION

In the world of interpretive computer languages such as Java, C#, Javascript, PHP, Groovy, etc there has long been the question of how one can prevent someone from reading or stealing their code. The more openly accessible the language, the easier it is to read and copy it.

Obfuscation, is the process of applying a series of heuristics to code that will make it harder to read and more confusing to understand. The intent is that by applying these rules, the code becomes such an confusing mess that nobody would bother to read the code.

Java Obfuscation is a fairly complex process. There are hundreds of heuristics that are applied to the incoming source code. The resulting end code is a nightmare of crazy classes, method and members names that make scanning the code painful.

Obfuscation for Javascript is much less powerful. Because Javascript is meant to be a widely open language, the ability to obfuscate the code is minimal. Variables, objects and methods in Javascript have no scope privacy and thus can be accessed by anyone and are often designed that way. This means that their names cannot be obfuscated because the names have relevance to the structure. You cannot change the name of a given method, because in many cases there is no way to tell whom has to call that method or where in the code that might happen.

Yet the biggest problem of all with Obfuscation is that it is almost completely worthless. Obfuscation will only stop the most basic of people from copying your code. Extracting obfuscated code is fairly simple in most interpreted languages. With many of today’s sophisticated IDEs reformatting and stepping through code is fairly simple. Additionally, many IDEs support variable name matching such that when an obfuscated variable name is selected all of the matching uses are highlighted. All of this means taking obfuscated Javascript back to readable code is far easier than one might suspect.

Another big strike against obfuscation is that Javascript can be employed in very diverse and powerful ways. Closures, functions as objects, objects as associative arrays, and the like, can all lead up to some fairly complex Javascript. Often times this kind of programming can confuse an obfuscator that is not designed to handle the diversity of the language. Even when writing this email I managed to break one obfuscator with just the sample for loop code from above.

Obfuscation, at its best, serves to help keep honest people honest. It is not going to stop someone whose intent is to copy your code, it’s not even going to put up a decent struggle.

Minification, while not technically an obfuscator, does provide some obfuscation like processes. The removal of whitespace and the collapsing of localized variables all makes the code harder to read. Yet, not that much is really changed otherwise. Consider our sample code block that we looked at earlier. With minification obfuscation, it is still fairly readable:

for(var L=0;L<100;L++){var dS0=Math.floor(Math.random()*L);document.write("A random number between 0 and "+L+" is "+dS0);}

Given this code and about 2 minutes on the internet or a few search and replace calls and you can turn it back into fairly readable code as shown here:

for (var L = 0; L < 100; L++) {
    var dS0 = Math.floor(Math.random() * L);
    document.write("A random number between 0 and" + L + "is" + dS0);
}

It’s not a perfect match of our original code, but it is fairly close and takes little real work to achieve.

Ultimately, Obfuscation can have some utility in giving you a very basic first line of defense, but the ability to debug and read your code is reduced and in some instances obfuscation can add to code size, albeit a very small amount. These limitations must be carefully considered before undertaking obfuscation. What are you really trying to do when you obfuscate your code?

Unfortunately, there is no way to really protect your Javascript code on the internet. The design of HTML, Javascript, and CSS is all meant to be plain text readable formats and this means that absolutely nothing stands between the site code and the end user. The only real protection you have from people reading and copying your code is in how much the worry about your legal recourses.

CONCLUSIONS

So where does this leave us with regards to Minification?

Well, we showed that from a size compression stand point, minification has some small value, but not nearly as much value as just turning on HTTP Compression. From an obfuscation standpoint we outlined the fundamental weakness of obfuscation in general. Given these factors my recommendation is for careful consideration of whether or not minification is actually needed in the particular case you are making.

I would ask myself these questions:

1). How important is the ability to read and debug my code?

2). How much time and resources do I wish to invest in tracking down bugs in minified code?

3). How relevant is the commenting in my code to the ability to debug and read my code?

4). With Obfuscation, whom am I trying to protect my code from and how competent are they?

Ideally, I think the best application is to do no Obfuscation, HTTP Compression, and a reduced form of Minification in which only comments are removed from the code. This provides you with high compression and still maintains the ability to read and debug your code. In my opinion obfuscation really is not worth the effort to employ it for the benefit you receive from it.

CONFIGURATION NOTES

HTTP Compression can be turned on in either Tomcat of Apache Web Server with just a little bit of effort. Tomcat requires a mere 3 lines of code to get HTTP Compression working. Apache HTTP Server requires a few more lines, but it is still relatively easy. For more information about configuring tomcat see http://viralpatel.net/blogs/2008/11/enable-gzip-compression-in-tomcat.html. For more information about configuring Apache Web Server see http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.

TOOLS NOTES

Finally, I will plug the YUI Compressor. There are a lot of Minification programs out there, but YUI Compressor seems to allow for the most configurability. Also, I liked YUI Compressors ability to minify both CSS and JS files within one simple program. You can find out more about YUI Compressor at http://developer.yahoo.com/yui/compressor/.

comment on this post