Sanity Check Failhttp://sanitycheckfail.comJust a nerd trying to get out of his head.en-usCopyright 2008-2009 sanitycheckfail.comzacharydangercampbell@gmail.com (Zachary Danger)Sanity Check Failhttp://sanitycheckfail.com/img/stencil-clem.gifhttp://sanitycheckfail.com350404...Finally Grokking TDDhttp://sanitycheckfail.com/post/2009-02-15/13/Finally_Grokking_TDDzacharydangercampbell@gmail.com (Zachary Danger)15 Feb 2009 20:09:51 CST _bar = $bar; } public function getBar() { return $this->_bar; } } $F = new Foo(); $F->setBar('asdf'); ?> And then check the output to make sure that `$F->_bar` was actually set to 'asdf'. TDD you just formalize and capture this into a unit test. In PHPUnit a simple unit test for this would look like: So now you've got a test that will make sure you've `Foo::setBar()` will always set bar correctly. If in a few months someone needs to update the Foo class to do something new, they can just re-run the `FooTest` unit test and know that they didn't break anything. Rather than write throwaway tests while building code, I now write unit tests which will last for the duration of the project. The tests will also help document the code going forward. Never again will I need to worry about what a certain method is supposed to return.]]>No Blarg Post This Weekhttp://sanitycheckfail.com/post/2009-02-03/12/No_Blarg_Post_This_Weekzacharydangercampbell@gmail.com (Zachary Danger)03 Feb 2009 11:43:11 CSTDue to an awesome fever I wasn't able to write anything this week. Instead I will direct you to some pretty good advice from Vic over at Leftnode Software.

http://artisansystem.com/blog/entry/28

]]>
You're Doing IT Wrong: Coding Testshttp://sanitycheckfail.com/post/2009-01-25/10/Youre_Doing_IT_Wrong:_Coding_Testszacharydangercampbell@gmail.com (Zachary Danger)25 Jan 2009 17:33:45 CST90 days. That's how long it took me to find a new programming job in the current (Dallas / Fort-Worth) market. During that time I learned some lessons about the hiring process that I'd like to share in this series of posts. This is post 2 of n and is by no means advice about the “right” way to do things, mostly just what I've taken away from the experience. Warning: may contain generalizations derived from a sample size of 1. See part one about tech recruiters here.

Lesson 2: Coding Tests are a Mixed Bag.

During my job hunt I was exposed to many variations of the coding test. Some good. Some bad. While Joel Spolsky would have had me write code during my interview, I was never actually required to do this at any interview.

First, the bad tests. The worst coding tests aren't really coding tests at all. They're trivia questions. Trivia questions that if you ever needed the answer to in real life (the majority of which you would never need) would be a 15 second documentation lookup. These questions should be a major red flag to anyone being interviewed. It means the interviewer cares more about your memorization of arcane facts than about your thought process which might be construed as a disconnect with the real world of day-to-day software development. What's worse is I've actually had interviews where the company standardized a multiple choice test that they give to all their applicants!

"How many SQL queries have you written?"
"Are you serious? It's innumerable."
"So... more than 50?"

This was an actual conversation I had during a phone interview and it's probably the most ridiculous question I've ever been asked. I didn't realize I was supposed to be counting the number of SQL queries I've written in my lifetime. I'd imagine there have been single mornings when I've written more than 50 SQL queries and I'd also imagine that anyone who's ever built anything on top of an RDBMS has written more than 50 queries.

Onto the good tests! And by "tests", I mean "test". Singular. I only had one good one out of the whole lot and I actually really enjoyed taking it. It was simple, open-ended and didn't require tremendous effort (less than an hour) on my part to complete. It consisted of three sections: PHP / MySQL / JavaScript. The three technologies they needed someone to be competent in to work there.

The PHP section was a block of code with a handful of questions about the code. Are there any bugs in this code? What does this code do? Do you see anything wrong with this code? Refactor this code. The instructions stressed that they were more interested in getting your thought process when working through these problems than the answers themselves. The MySQL section was a simple, "we have data for X / design a table structure to accomodate it". And the JavaScript section was almost identical to the PHP section.

This test succeeded on succeeded on a few levels. They got to see my thought process at work and I got to demonstrate my skillset which brings me to the next lesson...

Lesson 3: You want a web portfolio? For a programmer?

I get it. PHP is largely used in the construction of websites so any PHP developer must have a portfolio ready to go, right? Wrong. If I pointed you to any of the websites I've worked on the likelyhood that you'd be judging me on a graphic designer's skillset rather than my own is fairly high.

Hell, most of the work I did at my last job is only exposed in an administrative panel and isn't public facing. Yes, I worked on website X, but unless you're the accounting system the code I wrote interfaces with I doubt you'll get a feel for my work.

Ask for a coding sample instead. I'll be happy to point you to an open source project I've been working on.

]]>
You're Doing IT Wrong: Tech Recruitershttp://sanitycheckfail.com/post/2009-01-18/9/Youre_Doing_IT_Wrong:_Tech_Recruiterszacharydangercampbell@gmail.com (Zachary Danger)18 Jan 2009 19:12:58 CST90 days. That's how long it took me to find a new programming job in the current (Dallas / Fort-Worth) market. During that time I learned some lessons about the hiring process that I'd like to share in this series of posts. This is post 1 of n and is by no means advice about the “right” way to do things, mostly just what I've taken away from the experience. Warning: may contain generalizations derived from a sample size of 1.

Lesson 1: Tech Recruiters are Scumbags.

During my search I dealt with many such tech recruiters. I even followed up with a few which only lead to disappointment and frustration.

The main problem with tech recruiters is that they honestly do not care about your situation, just their bottom line. And their bottom line is the direct result of placing someone (anyone really) in a given position. No matter what flowery language a tech recruiter throws at you (and they will), they're still just looking to fill a slot for the highest amount they can.

Technical recruiters are also widely non-technical people with horrendous judgment of technical ability. So they use metrics like the “number of buzzwords in your resume”. Number of “years working experience” is another metric recruiters seem to love equating with ability. I've been hacking on the LAMP stack for roughly four or five years now, have worked on a wide variety of projects, and consider myself to be a skilled programmer, but because I haven't attached a company name to the majority of those years it's all for naught in a recruiter's eyes. Yet, so often, these are the gatekeepers to our industry.

Another common theme I've found in dealing with tech recruiters is that when you don't get hired, they tend to just dismiss you entirely no matter how many “other opportunities they have for you if this one doesn't work out.” The truth is you'll likely start being forwarded straight to their voice mail and your emails will be with silence or the occasional out-of-office message. A friend and former co-worker of mine has related similar cold shoulder stories even going so far as to call using a different name to prove a recruiter was just dodging his calls.

In short, tech recruiters are non-technical dolts who use bad metrics to squeeze the highest dollar out of the companies they're contracted to while alienating otherwise prospective talent. I'm not sure what the value is that they're adding to the hiring process. Is it really worth $10,000 to not sift through resumes?

If you're looking to hire, I'd beg you not to use a recruiting firm to do it. The message it sends to potential employees is that you don't care about the hiring process.

]]>
Broken Windowshttp://sanitycheckfail.com/post/2009-01-12/8/Broken_Windowszacharydangercampbell@gmail.com (Zachary Danger)12 Jan 2009 09:44:44 CSTIf you're not familiar with the “Fixing Broken Windows” theory of crime prevention, it basically states that if a building has a few broken windows that aren't repaired the tendency is for vandals to break more windows. Thus, the more petty crimes that aren't corrected the more likely a neighborhood will deteriorate into more serious crime.

Jason Kotkke recently wrote a post about applying the theory to the online world.

“The appearance of one troll encourages others. Undeleted hateful or ad hominem comments are an indication that that sort of thing is allowable behavior and encourages more of the same. Those commenters who are normally respectable participants are emboldened by the uptick in bad behavior and misbehave themselves.”

And from my experience this generally holds to be true. But what if we apply the theory to software development?

At my last gig, we built and maintained custom osCommerce (OSC) applications for our clients and for those of you that don't know, osCommerce is widely used open source shopping cart software and a complete mess. If you've ever worked on an osCommerce project then you know the abject terror that resides in its source code.

In my early naivety working with osCommerce I would try to fix the broken windows and refactor some code while making my modifications. This quickly lead to frustration and hours wasted working on an insurmountable task.

At the end of the day, the legacy OSC code beats you down. It's simply unmaintainable code. You try your best to squeeze your new features into it without disturbing its ancient voodoo. In doing so you end up writing code you're not proud of.

You break more windows. You can't repair the broken ones. At least, not without demolishing the entire building first.

If anything the “Broken Windows” theory holds especially true when applied to software development. Does your code read like it was written by someone who genuinely cared? Or is it an invitation to neglect?

]]>
HTRM v0.01 Released!http://sanitycheckfail.com/post/2008-12-18/7/HTRM_v001_Released!zacharydangercampbell@gmail.com (Zachary Danger)18 Dec 2008 14:40:48 CSTI just released version 0.01 of HTRM, my post-commit auto-deployment script. You can find it at http://htrm.designsauce.org if you're into having Subversion automagically update remote checkouts of your code. Now it even emails you the output of the remote updates.

]]>
Blarg!http://sanitycheckfail.com/post/2008-12-17/6/Blarg!zacharydangercampbell@gmail.com (Zachary Danger)17 Dec 2008 12:43:24 CSTThis is the new blog. Until I get some content together, go buy some pottery.

]]>