« Return to the blog entry
Indeed. Simplest is always best.
Some developers don't tick that way though. It's like they go out of their way to make things as overly-complicated as possible.
Just recently I saw another case of this. A developer needed to add a link to an item in a list.
The HTML he came up with looked like this:
<li class="somewhereLink" onclick="goSomehere()">Go Somewhere</li>
Which needed its very own javascript function:
function goSomewhere(){ window.location="http://thelink.tld";}
And it also needed it's own CSS rule:
li.somewhereLink{ cursor:hand;}
I'm not even joking! I actually saw this. There was no reason whatsoever he couldn't just have done this:
<li><a href="http://thelink.tld">Go Somewhere</a></li>
It's almost as if some developers think they're doing it better if they're using JavaScript.
I see it the other way and try everything I can to solves problems without using JavaScript
Indeed. Simplest is always best.
Some developers don't tick that way though. It's like they go out of their way to make things as overly-complicated as possible.
Just recently I saw another case of this. A developer needed to add a link to an item in a list.
The HTML he came up with looked like this:
<li class="somewhereLink" onclick="goSomehere()">Go Somewhere</li>
Which needed its very own javascript function:
And it also needed it's own CSS rule:
I'm not even joking! I actually saw this. There was no reason whatsoever he couldn't just have done this:
<li><a href="http://thelink.tld">Go Somewhere</a></li>
It's almost as if some developers think they're doing it better if they're using JavaScript.
I see it the other way and try everything I can to solves problems without using JavaScript