Archive for February, 2008

An Interesting Pattern

Friday, February 29th, 2008
WASHINGTON (CNN) — U.S. Attorney General Michael Mukasey Friday said he will not ask a federal grand jury to investigate whether two top Bush administration officials should be prosecuted for contempt of Congress.

But…

WASHINGTON — The FBI took up the Roger Clemens case Thursday, told by the Justice Department to investigate whether the pitcher lied when he testified to Congress he never took performance-enhancing drugs.

Hmmm. I see.

Slipping Through the Cracks, Something Amazing

Monday, February 25th, 2008

With the elections, the Oscars, the Serbian riots, and all sorts of other nonsense dominating the headlines, this might have gone unnoticed. But it shouldn’t. Because it’s more remarkable than all the other petty shit.

Ex-Microsoft worker leaves $65 mil to gay rights, AIDS groups

Weiland donated tens of millions to various organizations — from gay rights groups to environmental and education organizations — before he died in 2006. He committed suicide at age 53 after a long battle with depression, and survivors include his partner, Mike Schaefer. The $65 million is among bequests totaling about $160 million — the bulk of Weiland’s estate — to various charities and Stanford University, his undergraduate alma mater, according to an estimate provided by the Pride Foundation.

This man embodies perfectly what I think those of us more fortunate should do with their left over wealth. So much about that feels right.

The Morbid Thoughts of a Web Nerd

Wednesday, February 20th, 2008

If I died today, nobody would know how to get into my Dreamhost account which hosts a bunch of websites, commercial and not. The registrations would expire, and douchebag generic Google ad sites would take over. The would would have 10 or so more shitty worthless websites. I really gotta work something out with that, huh…

Here’s an interesting question: should relatives read the emails of a deceased? I say only if it was a violent death or foul play is heavily suspected. Though I am a firm believer that it all  just ends and then you rot in the ground, I would not wish it upon ANYONE to open up the offensive abyss that is my email account – for the sake of their wellbeing, not my reputation.

Thoughts: Prices, Refactoring

Saturday, February 9th, 2008

OS Pricing:

  • Mac OS X Leopard: $129 (apple.com)
  • Windows Vista Home Basic: $155 (amazon.com)
  • Windows XP Home: $191 (amazon.com)

… and it only goes up from there… The hilarity of the fact that XP is actually valued more than Vista aside, I think it’s great that Microsoft is charging more than Apple for the stripped down version of their abortion of a new OS. After actually having to use Vista while helping a friend setup his new laptop, I am horrified. I know people said it was a step backwards, but GOOD LORD! If you ever wonder what way too much abstraction looks like, go try and use Vista. Makes XP seem like the masterpiece that it isn’t.

In this context, I am happy about two things: that I have recently put Ubuntu on my work laptop and that I am purchasing a MacBook Pro whenever the next big update comes out.

Refactoring

During my internship, I wrote a lot of bad code. Part of it was the lack of experience, part of it was the lack of time to A. truly design a right solution and B. implement whatever solution was chosen well.

I recently decided to refactor the Javascript for my main project because it was starting to impede the development of new features… and it was ugly. But I’m not talking about renaming some variable. I’m talking about changing the way data is passed from PHP to Javascript. This was a big undertaking. The end result is incredibly rewarding. Not only did I shave off 20Kb (no joke) off the app’s sheer code footprint, it is noticeably faster, the code is much more neat looking, easy to read, and semantic, and the best part: I got to close a bunch of bugs that were related to the old code – because the new code wasn’t even remotely susceptible to those bugs – or any bugs at all so far! (knock on wood) Though I still have to keep things vague due to all sorts of scary papers I signed at work, I’ll make a more detailed post about what this refactoring involved and what I learned from it.

One thing is for sure, though: initially daunting, a thorough refactoring of the logic in your application is in many cases a worthwhile undertaking. From a man who has just completed this long journey, here are some tips:

  • Avoid Denial: It’s easy to make up reasons to not do it, but if there’s a flaw in your app’s logic, eventually you just have to fess up.
  • Start Slow: Once you’ve realized that you had made a mistake in your design, figure out a better way to do it and start converting over. The best way to start is to initiate the refactoring while developing new features.
    • Though it’s a royal pain in the ass, if you’re in an “agile-ey” environment, where pushes are frequent, you’re going to have to maintain both the old and the new logic for a while. Otherwise, you might find yourself having to rush through the refactor to push out a new feature or bugfix. It’s important to take the time to get at least a vague idea of how the two systems will co-exist and how the transition will eventually be made.
  • Find The Turning Point: a time will come when you have converted enough of the functionality to the new way of doing things, that it starts to conflict with the old way (I realize this is vague). In any case, keep a look out for the moment where it becomes easier to just finish converting to the new logic completely than dragging both along.
  • Take The Time: The final push will be time consuming, but it is probably best to just get it over with in one or two sessions (of course, it could be more depending on your app). Dragging it on will lead to two things: your development will lag and you will end up never finishing the refactor, leading to more broke ass code.

Indian Food

… is delicious. That is all.