More Ramblings from a Los Angeles Programmer

September 19, 2007

This is how you methodically troubleshoot

Filed under: coding, daily life, technology — Josh DeWald @ 12:09 pm

I don’t think I could possibly give a better example of how to methodically diagnose (and fix!) an issue.

Scott Hanselman had an issue firing of Microsoft Live Meeting and documents how he found the root cause. Absolutely brilliant.

He really has it all:

  1. Reproduces the issue
  2. Isolates the issue
  3. Gathers data
  4. Makes a hypothesis
  5. Tests the hypothesis
  6. Forms a conclusion
  7. Has a working system

In case it’s not obvious, yes I think troubleshooting/debugging should be performed using the “Scientific Method” as the pattern. Perhaps you don’t always specifically spell out your “hypothesis”, but you need to have one. Don’t spend too much time randomly poking around… methodically poke around. Each time you try something, you need to know what the result of that test will mean for you, and get you further along.

Update: Modified link to be direct, rather than via FeedBurner

September 18, 2007

New Turing Omnibus Mentioned!

Filed under: books, coding, technology — Josh DeWald @ 1:08 pm

For the longest time I seemed to be the only person who loved this gem of a book (I even emailed the author recently and got a nice reply).

Jeff Atwood at Coding Horror just mentioned how great The New Turing Omnibus is (and even points how that he had never really heard of it). He points to an Everything2 article that has a the complete Table of Contents (there’s only 66 chapters)… which I actually put up there in 2002!

It would not be a stretch at all to say that this book is what started me on Computer Science. I was already starting to code in BASIC when I began it (somewhere around Junior High I think), but it opened up a whole new world using very accessible chapters. This was the first time I heard about the Mandelbrot Set, Neural Networks, Cellular Automata (Game of Life!),  and 63 other core Computer Science topics.

Anyhow, Jeff’s article is really where you should head to read about it. Then you should then head to Amazon (or wherever) to buy it.

September 15, 2007

Stepping to the Dark Side

Filed under: coding, technology — Josh DeWald @ 12:43 pm

So I’m working on a hobby side project with a friend and his preference is to use the Eclipse IDE for the Java development. Eclipse makes things so “easy” that an Ant build script wasn’t included in the source repository. My entire Java development history (4 years or so) has been emacs for editing (and sometimes compiling, I like emacs jump-to-error stuff), and command line (using Cygwin) for the building and source control. So naturally I was a bit “put off” by not having an easy way to build, test and deploy the code (which my friend readily acknowledged).

I spent some time creating a basic Ant script which allowed to build the app. Then the JUnit tests didn’t work, because Ant doesn’t yet have support for JUnit 4. I google’d around for the solution, which was to add a suite() method which makes use of a JUnit4TestAdapter. Most of the tests ran but the ones that depended on external libraries still didn’t work, despite the fact that my classpath was set up properly as far as I could tell.

More and more in my life I prefer to not spend time fighting with my environment, so I gave in and decided that I’d give Eclipse a spin… go to the Dark Side. My friend said I should get the “Web Platform” version, which has integration with the JEE and web framework stuff.

Once I got that installed, it also grabbed the SVN Plugin and pulled the source repository down.

I’m still a bit ashamed to admit it, but I think I like Eclipse for the most part.  Everything you can do it in can be done in emacs (or from the command line) with the right modules and whatnot, but really just not as easily.

It’s nice to right click on a class and say “Create webservice” and also generate client stubs. It’ll warn you if the class isn’t compatible with standard WS-I formatting so that you can make sure to create compliant ones (i.e. no method overloading, objects must be easily serializable and public).

It’s nice to add a new method to an interface and be able to “Quick Fix” the concrete implementations to have a default implementation of the method.

Having standard Refactoring patterns available is awesome… having the option to change a method name and have that result in all usages changing is great.

CTRL+Shift+M to add an Import, very nice.

I’m digging on “create setters/getters”. As an aside, I’m going to admit, publicly, that I honestly see no real problem with exposing *properties* as public variables. I don’t actually do it (except for internal classes which I’m treating as structs for keeping some values together) but I honestly find that it is completely unnecessary 95% of the time to actually do get/set vs just allowing access to the method. I’ve also had times when I’m glad that I *did* have the getter, when I needed to delegate it or do some sort of change notification, etc. I’m just saying, that’s usually not needed…

Constant recompiling and the “intellisense” (or whatever Eclipse calls it) for choosing a method is awesome. I worry that those will change my coding style such that I’ll start forgetting how an API looks and will always wait for it to give me the options. I think the auto recompilation could have the effect of ruining my “flow” if I’m consantly trying to fix the all the “red” that shows up during a high speed laying down of an algorithm.

Also, one of the things that has kept me away from feature-rich IDEs is the fear that I’ll “lose touch” with the code. I really like knowing where each and every file is in and how it affects the system. When everything is accessible via a context menu or through auto-generation, I worry that my understanding of how the system really looks will become disjoint. But I’m finding that that fear seems unjustified. Eclipse absolutely doesn’t hide these things from you. When you generate a Webservice, it clearly creates WSDL and service description files. The package structure is readily apparent, you don’t just have a big list of classes with no rhyme or reason (unless you created it yourself, Eclipse certainly isn’t going to).

I’ve been experiencing a lot of lockups, which I think might be related to not giving enough memory (but 256MB should be enough!). I’ll do something trivial like want to create getters/setters and it’ll just stop responding. This happens to me at least once a session. My friend says that this has never happened to him before.

I’m still evaluating and at work I’m still an emacs guy (not that I get to code all that often any more), but if I continue to feel productivity gains from not worrying about the “little things” and can focus on the core algorithms and component interaction, then I think I could become a convert.

… especially once I find the “generate Ant build script” plugin or option.

Remember the ‘nerd test’ from back in the day?

Filed under: daily life, humor, technology — Josh DeWald @ 12:17 pm

There’s a “2.0” one now (it references the iPhone). You even get a cool graphic:

NerdTests.com says I'm an Uber Cool High Nerd

No, I have no idea what “Uber Cool High Nerd” means. I expected to be given a more “Computer Nerd” title, but such is life.

September 9, 2007

Internet Search and Rescue

Filed under: daily life, technology — Josh DeWald @ 7:42 pm

The Internet is an amazing place.

I’ve been spending the last couple of hours off and on using Amazon’s Mechanical Turk to try to locate Steve Fossett‘s plane. He went missing last week and they have very up to date satellite photos of the area they think he might be in. For each picture you’re just looking for anything that could be a plane or, hopefully not, parts of one. The resolution is about a football field per image, so there’s a good chance that if something’s there it’ll show up.

If you have an account, or even if you don’t, you should give it a shot. Who knows, you might help locate him.

Blog at WordPress.com.