The First Commandment of Parameters June 3rd, 2008
def transform_params(params)
params.delete(:action)
params.delete(:controller)
# Other code, and then...
params
end
It took two hours before I realized those missing parameters weren't Rails' fault. Repeat after me:
"Parameters are passed by reference. Thou Shalt not modify without warning."
If you're going trash your gifts, try "transform_params!". Destructive methods should end in an exclamation points.
This Cannot Work May 21st, 2008
def Timeout::Error
def an_instance_method
# Code goes here
end
end
Someone mixed up "class" and "def." This opens a wormhole, sending that method to an alternate history where the Russians won the Cold War.
Another Ridiculous Job Posting: Facebook Developer April 12th, 2008
You can't beat Craig's List for great software developer job postings.
[Name Withheld] needs lead developer to build a Facebook application and Widget for new project. Requirements:
- 2 Years experience with Facebook applications and several launches.
How can you have two years experience on platform that launched 11 months ago?
- 2 Years experience with building widgets.
I do not think that word means what you think it means.
- Experience with fast UI prototyping, rapid iterations, agile web development.
Looks like someone's been browsing wikipedia!
- Ruby on Rails: Rails experience a plus, PHP, MySQL, CSS/XHTML
Zed was right. Rails is a ghetto.
- Have professional experience with Restful, RPC, SOAP, and Service oriented architectures
REST:SOAP::functional:object oriented
- Documented experience building high quality commercial web sites in the area of media, publishing, e-commerce or social networking
Is there a website you didn't cover?
- Experience with Java, Java parsing, svn, Ajax, XML.
The JVM does a great job at Java parsing.
And Java doesn't really have to do with subversion.
Or ajax.
Or xml... well, ok, it does, but your witty commentary is purely coincidental.
- Experience is creating scripts to convert data
"Must regularly breath."
- Great aesthetic sense would be a major plus including experience building user interfaces with a high degree of usability and stickiness. i.e. a great web site experience.
"We don't have a designer."
- Ability to interpret analytics to adapt site to increase usability and UX.
I don't think anyone else works at this company.
- 2 plus years experience with MySQL, Oracle, or another RDBMS including data modeling, stored procedures, and SQL optimization.
You're lucky if you find a DBA alone with those skills.
- 2 plus years experience in designing and creating online consumer websites
Uh, I was joking about the graphic designer.
- BS in a technical field; MS a plus (or highly relevant experience)
Can you get a Master's in facebook applications?
- Familiarity with project management and development best practices
If one man had all these skills, who would they need to manage?
- Experience with creative mash-ups a plus.
I once edited Trigun to Coldplay.
- Flash
You left out Silverlight, C#, and COBOL.
Instructions: Please email us your resume/CV as a Word doc saved lastname_firstname.doc
Do you think anyone with those skills would touch Microsoft Word?
Contradictory? April 8th, 2008
While running a new test, I came across a pair of great validation errors.
@errors={ "listing_source"=>["can't be blank", "is too long (maximum is 60 characters)"]}
It's been a long time, shame. March 26th, 2008
Here's a special gift.
def self.return_url_for(subdomain)
'http://' + ({'att-yahoo' => 'sbc.yahoo.com'}[subdomain] || 'sbc.yahoo.com')
end
My shame February 29th, 2008
When you change database settings for one production-like environment and the changes work, you should probably go ahead and update the other environments. Here's to me keeping the infrastructure guys at work late to redeploy when I fixed my problems.
yay
Conversation with everyone's favorite employee February 14th, 2008
My lines are the ones with capital letters and punctuation because of my intellectual superbrain.
"o noes it says address in use but its not in use hlep mi~~~~"
"Well, that port is probably in use."
"no waiz lol"
"Go to localhost:3000."
[begins to type localhost:3000 in a command line]
"No, no, no, firefox. Pop open firefox."
[opens firefox and looks at me]
"Okay, local host colon three thousand."
[A page pops up, and it says "no such gem to load--sqlite3"]
"So there is something running on that port."
"no i think it just can't find sqlite ^-^"
"Or maybe you're running it on 3000 in that window."
"no its 7000"
"Pop that window up...Look, it says port 3000."
"wao~~~~~~"
"Good luck with that."
When Upgrades Go Bad January 27th, 2008
There have been a number of 500 errors on a freelance site I'm on. For the first round of troubleshooting, I'm updating the web server. My favorite web servers are nginx and lighttpd, but this dedicated server has two legacy apps, both built around Apache.
My favorite platform is Debian Linux because updates are fast and painless. This legacy server runs gentoo.
Unfamiliar Operating System + Unfamiliar Software == Disaster
At 11:00 pm I ran the upgrade. When it came back up, I found my Rails app working wonderfully. For safety, I checked the legacy PHP apps, and they were down. Hard.
It's midnight. I estimate I have until 8:00 a.m. before I'm in deep trouble.
After much research, I learned Gentoo decided to upgrade me from Apache 2.0 to 2.2, and 2.2 breaks a lot of things. One of which is fastcgi, now replaced with fcgid. I haven't used fastcgi in a year, since Mongrel makes it irrelevant for Rails. Fcgid will require much hacking.
It's 1:00 a.m. It's clear I'm better off installing mod_php. You'd think it's as simple as "sudo emerge mod_php". Well mod_php has merged with the base php package. you enable mod_php with a flag in some file. I enable the flag.
I start the compile at 2:00 a.m. And wait. And wait.
You see, Gentoo's philosophy that everything should be compiled from source. So for two hours, php compiled, just so I could get mod_php.
It's a little past 4:00, and things are back. What have I learned?
- PHP is harder to deploy than Rails
- Gentoo is for people with no sense of priorities
- Apache 2.0 to 2.2 is a nightmare. Changes that break things belong in a x.0 release.
Keeping up to Date January 25th, 2008
Many months ago, we changed from Prototype to jQuery, and couldn't be happier. Sadly, we had this recent commit.
$('.time').each(function(s) {s.innerHTML = date_string;})
This is some perverse hybrid of prototype and jquery. You see, jQuery selectors use the '#' and '.' to denote ID's and classes, respectively. Just like css. $('id_name') in prototype is the equivalent of $('#id_name') in jQuery.
Obviously, this javascript doesn't work. The submitter is not only out of the loop on our framework, but also so lazy as to not check their work. Yes, these people exist.
Formatting Dates January 17th, 2008
Wrong:
<% time = Time.now %>
<%= Date.today.to_s.gsub('-','/') %> <%= "#{time.hour > 12 ? time.hour - 12 : time.hour}:#{time.min}" %>
Right:
<%= Time.now.strftime('%m/%d/%Y %I:%M') %>
Please learn and love Time#strftime
Version Control Repository Structure January 15th, 2008
We noticed a project in our repository by a former developer. Its trunk was empty, but it had six branches. Yes, six. Six, six, six, six. Time for an introduction to repositories!
The Folders
A subversion repository, by convention, has the following folders.
Trunk
You put your app's code in trunk. You do development in trunk.
Branches
When you're making a significant change:
- Duplicate trunk and put it in the branches folder.
- Do development on the new branch.
- Merge the branch back to trunk.
- Delete the branch.
Tags
If you need an unchanging snapshot of code for when, say, you release 1.0, you put it in your /tags folder.
This isn't brain surgery
These are universal concepts. Different version control systems, like Git, represent branches differently (read: better), but it's the same idea. Maybe he was confused since subversion treats branches as just another folder. Maybe nobody taught him the finer points of version control.
Then I see-- in spite of our repeated lessons on test-driven-development-- this project has zero test coverage.
Never have I been happier with the word "former".
Profanity December 17th, 2007
We just noticed our profanity filter bans the world "uncircumcised," but not "circumcised."
Merry Christmas!
Announcing a product of my frustration December 3rd, 2007
I get tired of writing tests sometimes. Not because I find it boring, or that I find it unproductive. I usually enjoy the regular test-fix-testsomemore cycle. What gets me down is when I feel like I'm the only person writing tests on a project.
So I wrote a plugin to tell me.
You can check out the plugin, or just ./script/plugin install https://kablame.googlecode.com/svn/kablame
It allows you to check how many lines each contributor has added to tests or specs, according to git or svn blames.
Here is the most recent set of results from our company. Names have been changed to protect the guilty.
**WINNER** ben **WINNER**
ben ==> 2784
jacob ==> 1800
austin ==> 1475
no_longer_here ==> 786
no_longer_here ==> 453
our_team ==> 157
performance ==> 148
architect ==> 135
our_team ==> 74
our_team ==> 52
our_team ==> 45
our_team ==> 29
search_team ==> 25
some_test_hater ==> 3
**LOSER** some_test_hater **LOSER**
So a quick review of our test code? We have three people who have produced the vast majority of tests. After that, there are a couple of users who don't even work here any more, the project architect and a performance architect. Then we've got the bulk of the development team.
Then... Way down at the bottom. There's some guy who has written THREE LINES OF TEST CODE.
If that's not a punchline, I don't know what is.
You Get What You Pay For November 30th, 2007
Here's two anecdotes over two days where people say "deal" when they mean "cheap."
Cheapskate Anecdote One: Hosting
Someone asked who I use for Rails hosting. I mentioned Joyent, a pretty solid VPS (if there is such a thing). Yeah, Solaris takes some getting used to, and yeah, don't even bother with their web-admin interface. But they seem like cool people, and their wiki is pretty good.
"How much?" guy asks.
"It's $45 a month for their starter box." (A much lower barrier of entry than EngineYard's $350.)
He reels. "That's too much. My client spends $5 a month on hosting."
Hobbyists are always suckered in by ultra cheap shared hosts. "You get two terabytes of transfer a month!" Except, they oversell their hardware, and they'll shut you down for CPU usage long before transfer limits.
I once volunteered to write a CMS for a friend. I should have ran the moment he mentioned Dreamhost. They shut down my app because it was spiking at 80% CPU. I moved it to my first-gen mac-mini running debian in a colo, and it's never spiked above 2%.
I'm sure shared hosting is fine for some people. Some people can live at a YMCA. But for anyone but a hobbyist, shared hosting today is a joke.
Cheapskate Anecdote Two: India
Someone told me about their original-online-video-comedy site.
"We got a great deal! A local company told us it would cost $15k. We hired some people in India to do it for $500. It turned out great!"
Let's put aside the aesthetics, (which could politely be called "dull", honestly called "ugly", and articulately called "lacking talent, skill, or ambition." (Yes, let's forget the very first impression, that split second "blink" where people judge you. (I miss lisp.))) Let's look at the code.
- With all the unquoted attributes, lack of doctype, and unclosed tags, I'm surprised this even parses.
- Tables. Welcome to 1994. Good luck with maintenance.
- Gotta love a look behind the curtain: <!-- ImageReady Slices (independentcomedy.com1.psd) -->
Sorry, an American college kid would gladly half ass this for less.
The Point
Some people can't or won't spend the money to get something done right, and the reason they'll fail at this and the rest of life is their lack of commitment. I have never heard of a dot-com millionaire who cut corners on infrastructure. You aren't saving $40 when you waste hours troubleshooting your host. You aren't saving thousands on your site when it only hurts your image.
If it's too good to be true, it is.
How to Discourage Candidates November 26th, 2007
I present highlights of a post from Craig's List "gigs" section.
Happy Holidays!
Before you learn about this exciting opportunity, PLEASE DO NOT APPLY IF ANY OF THE FOLLOWING ARE TRUE:
"YOU IDIOT"
- You do not have strong references. All references will be verified.
"We don't trust you."
- You cannot pass a state and federal criminal background check. It is mandatory for this position.
"We REALLY don't trust you."
- You do NOT live in Southern California or are unwilling to commute on the 405. We hate traffic just as much as you do.
"Life is a sequence of suffering."
- You are NOT willing to be on-site. This is a full-time on site job.
Your manager will bug you every 10 minutes.
- You are an off-shore firm hoping to get my business.
Notice "my."
You are a Linux-obsessed, PHP-loving, Ruby-on-Rails guru who is addicted to Apache fanatic.
No mention of Hitler?
We are a Microsoft shop (ASP, SQL, .NET, ASPX, C#, IIS, etc.) and are looking for Senior-level web-based application developers
Microsoft owns SQL?
This is not a development team lead position; this job opening is for an individual contributor who works as a team player.
You have no say.
All development tasks will be assigned and approved by your supervisor.
This is his company.
Our clients are:
- Inc 500, Fortune 1000, and Russell Global 2000 firms
Did you know JC Penny is on the Fortune 500? Seriously.
- Financial Services, Healthcare, Government contractors, etc.
"Help us help them fuck you."
Some of our benefits include:
- Full medical, dental, and vision
- 401k, AFLAC, Life insurance, Long term disability, and more
Like Google!
- Ping pong & foosball tables on site.
Like Google!
- No stock options – it’s not the dot com days anymore!
Oh.
- Walking distance to very large mall, Movie Theater, dining, bowling, and more.
"We are conveniently located in a renovated Panda Express."
- Access to the MSDN, TechNet, and Action Pack libraries to build your own lab at home, work, in one of our datacenters, etc.
But there's no such thing as free software, Hitler.
Requirements
- At least 5 years of solid experience with database-driven web development using Active Server Pages, SQL Server, and IIS.
- Responsible team player with strong client-facing interpersonal skills.
- Demonstrated excellence at working effectively with all levels of staff, clients and other personnel
- Attention to detail a must.
- Strong follow-up skills. This is critical.
- Effective verbal and written communication skills and the ability to interact professionally with a diverse group of people.
- Displays strong listening, writing, presentation, speaking, and meeting mechanics skills.
- Expert -level knowledge of Classic ASP and HTML.
- Expert -level knowledge of T-SQL programming. Must know stored procedures, functions, views, triggers, and more.
- Intermediate knowledge of .NET architecture.
- Intermediate knowledge of SQL Server 2005 Reporting Services.
- Intermediate knowledge of IIS 5 or greater.
- Intermediate knowledge of Windows Server 2003.
- Intermediate knowledge of XML, XSL, and XSL-T.
- Intermediate knowledge of VB 6.
- Intermediate knowledge of Web Services. Must have previously integrated web applications with back-end systems via published APIs and web services.
- Must have developed software in a shared development environment before.
- Must be familiar with all aspects of the Software Development Lifecycle – dev, test, staging, etc.
- Must be familiar with how to use the Microsoft Office suite (2003 or newer).
- Must be very familiar with the Visual Studio IDE and integrated version control software.
- Must be very familiar with SQL Enterprise Manager, Profiler, Query Analyzer, and SQL Management Studio (2005).
- Strong understanding of Object Oriented architecture and best practices.
- Firm understanding and experience with structured development processes and methodologies (agile, RUP, iterative, waterfall, etc)
- Strong analytical and problem solving skills.
- Recent Microsoft certifications. Your MCP number will be used to verify status.
- Strong, positive references from past clients/employers.
Good luck with that. I knew a "Senior Engineer" who couldn't write valid HTML.
Salary: I thought you might be wondering that. Let’s just say it’s over 80k.
Hahahahahahhahahaha.
That idiot Senior Engineer drove a Mercedes SLK.
It's hard to find a developer with 5 years of experience and all those qualifications, but impossible to find one who will put up with a douche-bag so cheap they won't pay $25 to post to the jobs section.