Archive
If programming languages were drugs
C – Caffeine
It’s cheap and it’s ubiquitous. It ain’t exactly safe, but at least its effects are predictable, and there’s a general agreement that it’s just the de facto drug of choice.
Assembly – Cocaine
It’s faster than C, but it’s also scary, so not many people are going to do it with you.
Ada – LSD
Ada and LSD were both created by the government in order to punish people (and coincidentally, they were both created for military purposes). You’ll see strange things, but you won’t like ‘em.
Ruby – Ecstacy
It’s what the kids do, it’s colorful, and it makes people happy. However, like ecstacy, the morning after a Ruby hit will leave you forlorn and depressed, as your happiness fades and you realize that Ruby is just another programming language.
Perl – Magic Mushrooms
You’re going to see a lot of things that don’t make a lot of sense, but repeated exposure isn’t going to elucidate anything.
Java – Clove cigarettes
It’s safer, but it’s also not much fun after the first few times.
Zend Framework validators and context
Did you know that in any custom validator you write for a Zend Framework project, you can include a second parameter called $context in your isValid() method, and if you do, $context will contain the other values of that form?
So, your isValid() signature would look like this:
public function isValid($value, $context = null)
{
// …
}
This is crucial information if you’re trying to validate a password field with a password confirmation field – but Zend/Validate.php makes no mention of it. However, if you check Zend/Form.php and Zend/Form/Element.php, you’ll see that it’s happening.
jQuery: Good enough for whitehouse.gov!
It’s pretty validating when the Javascript framework you love is used on www.whitehouse.gov: