Archive for Rants

Religious Wars and New Years Resolutions

Yeah, so I suck at keeping this blog fresh.  Sue me, I have a business to run.

Actually, please DON’T sue me.

Wow, do one’s perspectives change on so many things once responsible for owning a business.  Take that funny little “sue me” colloquialism.  One part of me enjoys the snark, the other part of me feels the cold tentacles of fear wrap around my heart.  Lawsuits aren’t a joking matter when one could put you out of business.  Never mind the fact that there’s nothing legitimate for which a party could take legal action against us; just the cost of paying an attorney to dispense of unwarranted litigation would bring the pain.

Here’s another thing you don’t care about once running your own business: religious wars of the nerd kind.  I just read a comment thread on Slashdot about Perl having moved over to using the source code version control system git.  These guys were blasting away at each other with warheads like “git takes up less space” or “subversion has better GUIs” or “you’re just too lazy to use the command line” or “git runs faster.”

These are the arguments and conversations of developers who are on someone else’s payroll.  I can tell you straight up, I don’t give a damn about hard drive space, not when I can buy a terabyte for less than it costs to pay an developer to work for a couple of hours.  I don’t care which is better, command line or GUI; I care about what will enable my developers to spend the least amount of time jacking with version control.  Nor do I care about which runs faster (within reason) as I can buy a dual-core funny car for, again, less money than a couple hours of highly skilled labor.

Simply put, owning and operating a business has stripped me of all nerdly religious beliefs.  In place has grown an agnostic pragmatism.  My goal is to get code written at the highest quality within the smallest reasonable timeframe at the lowest cost.  In our case this means running Apache on hardened Windows servers, writing PHP using Microsoft Visual Studio, using SVN to manage source code, and Python on roided up Ubuntu boxes for number crunching.

On a different note, my only conscious New Years resolution is to be more diligent about this blog.  I believe that what we’re doing and learning represents a unique perspective, but if I don’t take the time to communicate that perspective is lost to time.

How To Make Your Site Web 2.0 Compliant

I originally wrote this bit of snark at the very end of 2006, just barely over two years ago.  It’s been sitting in my “Drafts” folder ever since.  The funny part is that two years later, I pretty much employ all of this stuff (or encourage my graphic designers to do so).  Yesterdays snark has become today’s best practice.

Having made a decent living from “Web 1.0″ back in the late nineties and early part of this decade, I have to say that I’m really happy to see that “Web 2.0″ has arrived. Hopefully I can get in on some of that sweet Google buyout scratch, because I need a new BMW.

But to do so, I need to make sure that the sites I create are Web 2.0 compliant. After doing some research, I’ve compiled a short list that defines a sure path to Web 2.0 success.

1) Take up the whole screen width.

Seriously, keeping the width of your screen limited to 780 pixels or 1200 pixels or whatever is SO 2002. None of the cool kids do that anymore, and you want to be one of the cool kids, right?

2) Use LOTS of gradients and rounded corners. Bonus points if your gradients are blue.

Nothing says “I’m ready for some of that sweet buyout money” like gradients. And nothing says “I rock the Web 2.0″ like blue gradients. Look at all the coolest sites: Digg, Flickr, etc. Blue gradients abound!

Furthermore, nothing shouts “I’m a square” like square corners. And you don’t wanna be a square.

3) Make graphics all glass and mirrorish looking

Everybody knows that glass and mirrors are totally sweet.

4) Big bold fonts in big colored text input boxes.

Now that you can buy a 19″ LCD for under $200 bucks, you’d think that since these displays are vastly superior to the CRTs of Web 1.0, we webbish folks can use 10 point fonts with impunity.

Think again. Black is white, what’s new is old, blah blah blah. The really clever thing is to use BIG fonts, especially in your input text boxes. Just remember that only the kids with velcro sneakers leave the background on those boxes white. Throw some color back there…and don’t forget rule number 2.

5) Do something AJAXy.

Nobody has time to wait for a screen refresh these days. Those are just annoying. So be sure to have stuff that happens without a screen refresh. And note that since AJAX is the new Kleenex, you don’t really even have to go to the trouble of actually doing any nasty AJAX. Just make sure to have some stuff that bounces or jiggles or fades in and out or opens up like venetian blinds. Don’t worry, these are TOTALLY different than the Stupid Javacript Tricks ™ of Web 1.0.

6) Don’t use tables.

Tables are for losers. People that use tables are like the kids that got the plain metal braces. But people that use DIV tags and CSS are like the kids that got the super cool braces with the clearish anchors and colored wires. The results are the same, but you look so much cooler getting there.

It doesn’t matter that tables are (pretty much) homogeneously supported across all browsers and that getting anything beyond basic CSS layouts to render consistently across all popular browsers is a game of Sisyphean whack-a-mole.

Just don’t be the kid with the metal braces.

7) Arbitrarily drop a vowel, add a consonant, or 1337itize to your url

Digg.  Flickr.  Del.ico.us.  What do these sites have in common?

That’s right, a sweet domain name that has a really clever spelling.

Naming your site something relevant to the service it provides is so Web 1.0, so here’s how you figure out a sweet domain name.  Let’s use this site, “CompulsiveCoder” as an example.
Step 1, drop a vowel…CompulsiveCodr

DONE!!! Heck yeah, that looks awesome!!!

That’s pretty much it.  All you really gotta do know is figure out what you are going to do when you get bought out for millions of dollars.

Relativity

Chris:
the fix process is probably two-fold
i need to do a COUNT(*) GROUP BY work_order HAVING COUNT(*) > 1
to ascertain the frequency of similar issues
then look at the sync code to see what the issue is

jimmynash:
sounds like gangs of fun

Chris:
heh
other peoples databases make me cry

jimmynash:
can I help?

Chris:
yeah, jump in your time machine and go back to about this time last year and tell me to just deal with their developers denormalized and incomprehensible database because that way i could blame stuff on him rather than having to deal with trying to normalize it
:)

jimmynash:
here I go…

Chris:
lol

jimmynash:
WHOOOOOOOSH

Chris:
i doh’t think it worked because the prior conversation is still on my screen
your time machine suxors

jimmynash:
it was built in lasso

The High Cost of Cheap Hosting

We have a number of clients who regularly ignore our advice, usually to their detriment. The latest debacle involves a client who sought our advice on hosting. We told them to just spend the money to get a Rackspace dedicated server. We also told them that under no circumstances should they use a GoDaddy solution.

Naturally the client chose to use a GoDaddy Virtual Dedicated Server. After all it only costs $50 a month! That’s $250 per month less than Rackspace! And besides, we don’t need all that horsepower!

So they signed with GoDaddy, but not before we told them that we washed our hands of any server related issues. If we were called in to deal with an issue that was determined to be server related, they would be obligated to pay our full ad-hoc rate.

You can imagine my (lack of) surprise when I opened up my Gmail this morning to find panicked emails from the client. The site was behaving strangely. After a bit of snooping, I found that both PHP and MySQL were running out of memory…no great surprise since this great GoDaddy deal only came with 256MB of RAM and since this web application involves some very complex queries on some decent sized tables.

The client called GoDaddy to see if they could upgrade their RAM allocation to 512MB, which they can…provided they move to a different server.

Let’s run the numbers on this deal: I’m dinging them for $125/hour, not excluding taxes. They’ve already used about 6 hours of time this month on server related issues, not counting the two hours I spent this morning. The server move will probably take another 6 hours, especially if they ignore my advice (again) and refused to spend the money and migrate to Rackspace. That brings us to 14 hours, or just under $1900 with taxes. I know for a fact that their guys have spent about 20 hours (not just on this issue) trying to get the server to play nice…say their guys make $35 an hour, that’s about $700. The annualized cost of the server is $600.

That comes to $3200 invested into this server, they’ve not yet been up two months, and it’s been one thing after another with this GoDaddy Virtual POS. Rackspace would have come to $3600 per year.

I have several other clients on equivalent Rackspace platforms and guess what we’ve had to deal with for server issue? Zip, nil, nada, null. Factor in the incredible customer service that Rackspace provides, the ridiculous connection speed, easy scalability, managed backup and it should be an easy decision.

(I don’t work for or have any affiliation with Rackspace other than being an extremely happy client).

Hitler, Stalin, and Domain Squatters

What do they have in common?  Not much, except for my wish that they all occupy the same hot and senselessly torturous level of hell.

MathGeek and I are starting a business.  One of the first things to do is come up with a decent name.

There is problem however.  Every single domain name is taken.  Every single one.  There are no open domain names left on the internet.  Some cybersquatting piece of human excrement has occupied every one of them.  There needs to be a law whereupon someone having a legitimate business need to a domain name can exercise said law and wrest the domain name from the slimy paws of whatever sleazebucket owns the name.

Have you ever tried to trademark or service mark a business name or trade phrase?  It is a major pain.  You have to display all types of usages to demonstrate that you have legitimate claim to the name or phrase.  There is no facility whereby someone can just sit around thinking up potential trademarks and business names, call up an attorney, and hold the assets hostage until someone willing to pay some arbitrary and exorbitant fee comes along.

But on the internet, this practice is not proscribed, it’s prescribed!  Companies like GoDaddy and 1&1 make a healthy profit selling domain names, selling lists of domain searches that went unpurchased, and taking a percentage of transaction profits when a domain name is exchanged.

The situation is ludicrous.  I’m not a fan of governmental intervention, but the monopolization of domains by those who have no legitimate business claim other than anticipated ransom is completely out of control

Would you use a .NET framework construct with Pure C++?

I would.

Let me explain…

After diving into the .NET world head-first over the last 4 months with C# in a pure .NET shop I must say my reticence towards embracing the core technology has faded somewhat. Well, ok, a lot. It *is* very productive. And the C# grammar has some very handy features I will allow.

But I still feel a bit dirty not cleaning up after myself (I detest GC at a fundamental level, it perverts a language enforced ctor/dtor element to the acquire/release model intrinsic to OO programming, but that’s a different post….) … but, alas, I love the .NET framework. It’s what MFC never was (or Ritchie forbid, ATL) - or any other monolithic framework designed to help with all the grungy bits of code we all know and hated in a pure Win32 world.

Anyone who has coded perfmon counters, version info blocks and anything network related along with a ton of cobbled together bizarre interfaces (raw com anyone?) that comprises the life of a low level win32 jock must agree immediately, or risk being discarded as disingenuous.

So I’ve brought this up to coworkers - fellow C# jockeys mind you - would you write pure (unsafe, *gasp*) C++ if you had a library as clean and elegant as the .NET framework?

I sure would.
…If for no other reason than sheer romanticism.

On CLR Memory Management: Problem Solved…?

I respect the fact that MS took great pains to make the GC in the CLR high(er) performance than most (slow) GC implementations in the past. Mid Life Crisis and Always Penalized Finalizers aside, they did a good job on the implementation.

But there’s a vast difference between doing the right thing and doing the thing right, I’ve grown to understand. The reason for GC to begin with, in my estimation, was to improve software quality. Many, many applications suffered from memory leaks brought on by lazy programming practices - I don’t question that, there’s no controversy.

But what about - instead of going the GC route - we improve the tools and education? BoundsChecker is a staple run for most serious hard core developers I know. And guess what? Most of those guys find little if no issue in their software. Why? Good practices, attention to detail.

But now, here we are, reaping what we’ve sown. Again, there are MANY good things in the .NET paradigm, but alas, this is a GC rant, so I shall continue and pose this question: Has GC completely solved the core issue of memory management?

Yes and no.

Check these out, straight from the horses mouth:

Rediscover the Lost Art of Memory Optimization in Your Managed Code
CLR Inside and Out:Investigating Memory Issues
Inspect and Optimize Your Program’s Memory Usage with the .NET Profiler API

I would submit to you, that indeed, after all this time, it’s true: There Is No Silver Bullet

We’ve simply moved issues around the Issue Space that is software development. I would even go so far as to offer up a axiom based on Brooks’ seminal work:

Issues are neither created nor destroyed, but rather, change from one form to another

Yup, that’s right. So now our memory issues are much more subtle - and have profound and often unexpected impact on application performance. But the average developer is probably shocked by some of the content in the above articles since they have “put their faith” in GC and think that memory issues are a thing of the past. Which is, well, simply wrong.

And the affect of GC language grammars? Well, as substantial as the above issues are (not the problems themselves, but how they morphed into a more subtle animal which hunts on the trusting yet unsuspected dev slumbering in his tent pitched on Mount Redmond) this might be my biggest complaint.

One of the core Pillars of OOP is the acquire/release resource approach which is elegantly modeled via constructors and destructors (pick your OOP language). With the advent of the CLR and it’s GC approach please say goodbye to deterministic destructors.

And this is progress somehow? Or a vain pursuit of the Silver Bullet?

The result has been a serious dumbing down of the average developer - shoot, GC has rewarded lazy programming - simply because paying attention to memory is just “too hard”?

And for all the progress (yes, I fully admit there has been progress in this area), the issues have for the most part simply morphed into newer and more subtle forms.

AJAX Is The New Kleenex

It’s funny how AJAX has become such a buzzword. Even the CEO of my corporation uses the word in conversation about the corporate website, as in, “We need some of that new AJAX stuff.”

Never mind the fact that the 3rd party company that owns the infrastructure behind our website can’t competently coordinate client side validation, even with the brain-optional power of .NET. But that’s another rant for another day.

Anyway…AJAX technically describes an interaction between client-side Javascript and XML that is returned as a response to a query driven by the XMLHttpRequest dealio… Asynchronous Javascript And XML.

But the word has grown in scope to the point where it’s used to describe almost everything that takes place on a web page that doesn’t involve a page reload.

For example, I recently employed a stupid Javascript trick on an HTML textarea. I put a couple of hyperlinks that with onclick behaviors increased or decreased the vertical size of a textarea field. Very simple, kinda dumb, but it performs a necessary task and took all of about 30 seconds to write and implement.

The comment I overheard as the end user was showing the feature to his supervisor was, “oooh, AJAX.”

Another similar yet more technically arcane situation arose when I reverse-engineered Google’s Suggest feature. I thought it was cool and I saw a use for a similar feature in the call center management suite I wrote.

Basically, on page load, a loop sniffs every few milliseconds to see if there’s been a change to an input text object. If there’s been a change, it fires off an XMLHttpRequest. The recipient of the request makes a database query and returns a string which is eval’ed by the Javascript…said string contains a function call and passes an couple of arrays as arguments. There are then some Javascript gymnastics performed with DIVS and SPANS and thanks to the W3C NON-compliance of IE, there’s even an IFRAME in the mix. End result is a nice little “drop down” box that is automagically populated with the company’s part numbers and those part number’s descriptions.

No XML involved whatsoever.

But of course, when I show it off to someone, the response is “oooh, AJAX!!!”

And a big part of me wants to scream “IT’S NOT FRIGGIN’ AJAX!”

Show Me The Wizard!

First off, let me frame this post by asserting that I’m not a Microsoft hater - far from it, actually. I dig many of the dev tools (i.e. Viz Studio), the tablet pc os and their mobile technologies are pretty cool.

Additionally, the .NET family of technologies certainly has some really cool stuff buried in there. Beyond the CLR and some of the (potentially cool uses) other low level technologies, the overwhelming coolness to .NET is the well packaged framework. Building on the lessons learned from older frameworks and APIs (mfc, atl, win32, swing, jfc, yada) the Mother of All Frameworks arose. And we - the dev community collectively - clapped.

Who has written a low level C# service and not oohed and ahhhed over how simple it is to do such tasks as, oh, add performance counters (which are horribly nasty in raw win32), implement a windows service or access networking resources? I don’t care how low-level you consider yourself, you probably look on with a sense of awe with how slick the framework itself really is. Well done, ms, well done.

Ok, enough cheerleading … on to the rant aspect of this post…

There’s a certain allure to a shrink wrapped prepackaged dollop of code that I can’t deny exists. I mean, given a particular task, how cool is it to find a class or assembly or com object already written to solve said task? Sweet, I can go play some video game tonight and not be stuck at the office. A bit of that ain’t a bad thing, right?

Well, here’s my issue. A lot of developers I’ve met these days are completely addicted to drag-and-drop Wizardry. They have Wizarditis. Their approach to writing something new and outside of their comfort zone is “Show me the wizard!”

What’s a symptom of wizarditis, you query? Well, here’s a few, and I trust you can extrapolate from there…

  • Do you break out in a cold sweat if you can’t find a free .NET assembly for sending secure SMTP mail messages?
  • Do you head to monster.com if you are tasked with writing a TFTP server and your google searches come up shooting blanks?
  • Do you lockup whenever a customer issue is brought to you that appears to be - Gasp! - inside the blackbox of one of your shrink wrapped bits of code you googled off the net?

If this is you, you may very well be among the afflicted. Never to worry, it’s not a terminal condition - IF you act right away.

My prescription for you?

The next time you have to solve a problem you have no experience with, write your own set of classes from the ground up. Every. Last. Line.

That’s right, the ground up. Use as little prepackaged code as you can get away with (search/sorting you get a pass) to accomplish the task at hand. And mind Occam’s Razor, make it only as complex as needed, no more. Code for contingency cases. Think about run time traces to make it diagnosable for field issues. Think about reuse. Use good OOP practices. Research the thing at hand first. Is a standards based protocol you need to work with it? Read the original RFC. Learn, dig, be curious.

Now clearly I’m not saying do this for every last thing. You have customers, you have a boss, you have deadlines. But every so often just say No to the “Wizard” approach to software. Dig in, understand stuff, learn and grow a little.

We’ll all be better for it.

3rd Party Providers

I have grown to loathe 3rd party service providers, AKA “consultants,” largely because I have yet to see one deliver a service that is proportionate in value to the fees charged. The latest provider in my bad book is the new payment processor for my employer. We’re currently in the stages of testing the routine that send credit card payments by batch, and to say it’s been a complete CF is to understate the issue. Their recommended way of transferring the data is as follows:

  1. Use WinZip to zip the batch file.
  2. Encrypt the batch file using WinZip’s proprietary encryption format.
  3. Upload the file via FTP over SSH (aka SFTP) to their servers.
  4. Chill out for: BatchRecordCount * TwoSeconds + ThirtySeconds (my figures calculated from observation, not theirs).
  5. Drag and drop the response file to wherever it needs to go for our inventory system to process it.

Considering that this process must be completed several times per day, it made sense for us to attempt to automate the process as much as possible. I started by asking what type of encryption algorithm they wanted to use to encrypt the zipped file, seeing as WinZip has its own algorithm in addition to AES/Rijndeal 128/256. The answer I received was, basically RTFM. TFM said “encrypt the file” without providing specifics. So I basically said “yeah, thanks, if the information necessary was there I’d not have asked you about it.” To which I received a reply “we just need it encrypted.”

Nnnnnnyeah. FU2.

Fortunately I figured out during testing using Winzip and WinSCP that the only encryption protocol supported was WinZip’s.

At this point I feel obligated to point out that TFM contained various CYA statements about not supporting any specific software such as WinZip. Never mind the fact that’s all that works. So now we’re at the point where we are trying to put the error code handling in place for the response batch file (the one that comes back after processing). The only catch is that the test system that we use is ALSO the test system for their engineers. So when their engineers push a new release and it’s buggy (and they seem to do this on a weekly basis), the whole test system goes down.

I have to question the intelligence of having a test system for commercial users that is ALSO an internal test system. “Test” should not mean that I’m using the same buggy beta testing unit that developers use. “Test” should mean that I’m using an identical facsimile to the production system, the only difference being that transactions are not fully processed.

The other issue is that getting in touch with someone who knows what’s going on is damn near impossible. We have three contacts at the company.

  1. “Vice President of Accounts” (there’s a BS title if I’ve ever heard one)
  2. The VPA’s technical support flunky
  3. The testing technical supporty flunky

Thing is the VPA never answers her phone and never returns calls. The VPA’s technical support flunky is the idiot that sent me the RTFM message. And the testing flunky plays the game of making return calls at odd hours and saying “I didn’t get an email” if I called her or saying “I didn’t have a voice mail” if I emailed her. The ultimate frustration is that it’s not as if we’re a rinky-dink Mom ‘n Pop shop that are going to process half a million annually. Our fees alone will be in the millions. Yet this is the level of implementation support provided.

Back with my original statement about 3rd party service providers…I wish I could say that this experience was an anomaly. Sadly it is par for the course.