Choose Your Theme
Warren Shea

Is there a better way to code this?

Friday, June 4th, 2010 at 11:08 am

(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;

I’m just joking That’s just the first part of the jQuery framework :)

I pride myself in great, but not perfect code. I like doing things right, efficiently…the best I can given the situation, deadlines, etc. Obviously the code CAN be better as I’m not a great developer…but I do the best I can so even if there are flaws in code, it’s done to the best of my current abilities and I’m proud of it.

Sometimes though, I get really wrapped up in my current way of thinking…and I forget to take a step back away from my code and ask myself if it’s good enough, adaptable enough, reusable, etc. For example, I developed something a year or so ago. I was very happy with it but it wasn’t adaptable and efficient. Yesterday, I took the same code and cut it down to 20% of what it was originally…which is a lot and kind of shows you how poor the code was before.

Anyways…sometimes you have to take a step back, take a break, look at code after 30 minutes or a good night’s sleep…to really make it great. A weary mind from all-nighter coding just dulls your mind and standards. Too much enthusiasm leads you to impatient and inefficient coding. Like when you code poorly just to get something to work…and then don’t go back to fix it and make it efficient because of deadlines, etc. Sometimes it’s just too much fun to try to solve something, no matter how it’s done. But really, it’s good to go back after you’ve solved the problem…and make the way you did it better.

/urge to blog during work is bad…i was working so well this morning too -_-;

Leave a Reply