Matthew Cox Team : Web Development Tags : Technology Web Development Featured

Writing code is easy, reading code is hard

Matthew Cox Team : Web Development Tags : Technology Web Development Featured

Often when I’m stuck on how to accomplish something with a software library I, like most other developers, will begin googling which will inevitably lead straight to Stack Overflow. Now before I start, I’m not disparaging Stack Overflow, it’s generally a great resource but often times I will find that the accepted answer will be just flat out wrong.

Perhaps I have a different definition of right and wrong than a lot of programmers, but something that does what you want, while introduces huge performance bottlenecks, works only in limited scenarios, or has hidden gotchas is not what I consider to be a correct solution.

I think this image sums up the situation fairly cleanly (I don’t know where this image came from so sorry if it’s stolen).

 

What’s even more troubling is questions where there is no “eloquent wall of text” answer.

 

Look under the hood you bum

It’s for this reason that I always encourage developers struggling with open source libraries to download the source and work it out for themselves. The internet is not a black box, it’s just a very big box with a hell of a lot of stuff to learn in it. You should never hesitate to pop the hood and take a look underneath. Documentation can be wrong, advice can be misleading but if you actually look at the code you will be able to see without any ambiguity what it’s doing.

My number one favourite tool for looking under the hood is RedGate Reflector, I know there are some competing products out there that may be just as good, but this is the one I’ve had for years and never steered me wrong. My second favourite is Telerik Fiddler, knowing what requests are actually being made by your application and being able to examine the request structure has been invaluable in more instances than I can count.