I got into a conversation about supporting older systems/configurations (server environment) and that lead to browser support. I'm more familiar with the latter, as I don't work with ancient servers.
I see it all the time, people trying to teach IE7 tricks that it doesn't know through various hacks. Some people are still spouting that we should support IE6.
No. Developers need to stand up and refuse to enforce bad behavior. Many people today still won't use a <header> tag because it's "too esoteric".
Not to mention all the CSS3 goodies. There's a ton of things to be taken from, and they're mostly supported - but only in the newer browsers. This is fine. Use it, and don't limit yourself just because somebody won't click an update button.
Sure you can make your site "fall back" gracefully, but don't for a second spend too much time on such a task; it's not worth your time. Your time is to be used for research, experiments and most importantly: high quality results.
I recommend reading Hardboiled Web Design for a full grasp on this ideology. The book gives you well thought out reasons as to why you shouldn't stop yourself from growing through practice.
Use CSS3. Use HTML's new features. Use localstorage, web workers and transforms. Help the web grow, don't stand in it's way by condoning the refusal to adapt.
Sometimes we have to order by "relevance" in our queries, whether it's shown or not. You want the results to be ordered in a certain way.
Yii makes querying ultra simple with models & findAll();:
// Grab our search parameter
// and split it into a few segments.
$raw = $_POST['q'];
$full = '%'.$raw.'%';
$first = '%'.$raw;
$last = $raw.'%';
$query = array(
'condition' => 'name LIKE :keyword OR email LIKE :keyword',
'params' => array(
':keyword' => $full,
':firstName' => $first,
':lastName' => $last
),
'order' => '(
CASE WHEN `name` LIKE :firstName THEN 1 ELSE 0 END
+ CASE WHEN `name` LIKE :lastName THEN 1 ELSE 0 END
+ CASE WHEN `email` LIKE :keyword THEN 1 ELSE 0 END
) DESC
'
);
$result = Contacts::model()->findAll($query);
This will sort by the first name if available, falls back to the last name and then the final fallback goes to the email address. You could apply this to anywhere - and is great for searching.
As a software engineer for the web I resize the browser a lot. Mostly to see what other websites are doing, and if it's better than what I've done.
I came across "animated" responsiveness, where when you resize everything seems to flow into place instead of simply snap into place. It took me a while to get it, but it's really quite simple. I've been using it ever since.
Lets jump to an example.
h1 {
font-size: 31px;
transition-duration: .35s;
-webkit-transition-duration: .35s;
-moz-transition-duration: .35s;
}
/* And now our media query. */
@media screen and (max-width: 650px) {
h1 {
font-size: 15px;
}
}
When you resize, it will flow into place. Check it out http://jsfiddle.net/dzKdh/ and resize your browser window.
I recently ran into the ~ selector, which is somewhat similar to the + selector.
The difference is what changes the game. The + selector finds the nearest siblings, whilst the ~ sign is able to target any sibling. This is big news. This is the reason we can have CSS3 slideshows with controls and many other possibilities.
A great thing about the tilde is that it isn't restricted to being in the same exact parent -- rather, just one parent would do. For example:
Isn't that awesome? I think so. What's even cooler is when you add labels in the mix. You can hide the radio buttons or checkboxes and use labels as a navigation.
Experiment with this. I think we're on our way to see pure CSS sliders; which is great because CSS3 animations are way better than anything jQuery can muster.