Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Let's see, if I...

...am facing a hard problem, that seems like it must be a common scenario, I should probably...

Write an all new logging tool?  Um, no.

Reinvent Sql?  Um, no

Use IL generation?  Immediately stop whatever it is you're trying to do

 

 

The correct course of action Grasshopper is to GOOGLE IT FIRST!!!!  If it seems like a function that should be in the .Net framework, it is.  If you think that somebody has to have already done this, they have.

 

Listening to a friend, who shall go nameless to protect the victim's privacy, gripe about some co-irkers.  I like my job.
 


Posted 07-01-2008 11:04 AM by Jeremy D. Miller

[Advertisement]

Comments

Rick Fleming wrote re: Let's see, if I...
on 07-01-2008 12:46 PM

I've worked this way for a very long time, and it has worked out very well for me.

Key is just having the right intuition, for what is "special" and needs to be written and what isn't "special".  And it's even easier now with a common framework, in the past I remember finding what others had done, and having to port it, now usually it just works :).

Guy Ellis wrote re: Let's see, if I...
on 07-01-2008 2:27 PM

I contend that one day (perhaps today) it'll be possible to write an averagely complex application by copy/pasting code found on the web and then renaming a few variables.

BTW What logging features does .NET have baked in? (that you were alluding to...)

Jeremy D. Miller wrote re: Let's see, if I...
on 07-01-2008 2:35 PM

@Guy,

log4net or the equivalent in Enterprise Library.  It's essentially a solved problem, or at least solved well enough to just use an existing tool out of the box.

jdn wrote re: Let's see, if I...
on 07-01-2008 3:04 PM

What's better is when log4net is used.

And then an all new logging tool is built around it.

Sweet

Josh wrote re: Let's see, if I...
on 07-01-2008 3:27 PM

Wow - that looks like a direct attack on this project: www.codeplex.com/ukadcdiagnostics

Which is both a logger (well, it extends what's built in to .NET already) and uses IL.Emit!

Josh

Yes, I am a contributor :)

Jeremy D. Miller wrote re: Let's see, if I...
on 07-01-2008 3:31 PM

@Josh,

Nothing of the sort.  I hadn't heard of your tool before this post.  I was thinking more or less along the lines of "I'm building an Invoice processing system, and I need something like a rolling file logger, so let's go write one from scratch!"

Aaron Erickson wrote re: Let's see, if I...
on 07-01-2008 4:08 PM

Your post is timely.  I just wrote DuckCallLib (www.codeplex.com/DuckCallLib) before my colleague Jason Bock notified me that I basically just wrote a very poor man's Dyanmic Proxy, which is a problem both he and you have already solved.

My bad :)  Thankfully, I am only 12 personal hours into this, not work hours.

Jeremy D. Miller wrote re: Let's see, if I...
on 07-01-2008 4:10 PM

@Aaron,

Not me, I never went that far.  And you can tell your colleague Jason that I wrote the IL emitting portions of StructureMap with his CIL book open at all times.

TSHAK wrote re: Let's see, if I...
on 07-01-2008 6:49 PM

Or give search.msdn.microsoft.com a shot! We're working really hard on improving search for developers and I think you'll be plesently surprised with the improvements that we've made thus far. For more info check out blogs.msdn.com/msdnsearchblog.

John O'Brien wrote re: Let's see, if I...
on 07-01-2008 9:50 PM

Warning.... using google can be like looking through a garbage heap for something edible. There are a lot of experienced people out there share good things.

But there are lot more people who spend more time blogging than actually "eating their own dogfood".

Another warning... Don't be a CoPaster

www.obrienjd.com/.../The-copypaste-generation-(CoPasters).aspx

Kent Boogaart wrote re: Let's see, if I...
on 07-02-2008 8:03 AM

I think you're touching on a bigger problem: developers *want* to develop technical solutions, not business ones. They'll often jump at the half-chance to develop a new logging infrastructure or utility layer of some sort to the detriment of actually producing something with business value.

I'm not so sure it's entirely out of ignorance of what's out there, it's often more a case of 'I can do better' and 'working on X utility code is more interesting than working on Y business code'.

Kent Boogaart wrote re: Let's see, if I...
on 07-02-2008 8:07 AM

@Josh

I, too, have side projects that are aimed more at providing framework/utility code. I don't see a problem with this: it's a project dedicated to solve a particular problem, and that problem just happens to be technical rather than a business problem.

I think what Jeremy's getting at (and I apologize for putting words in your mouth, Jeremy) is that if there is a business problem to be solved, we should be *avoiding* solving technical problems, especially when they've already been solved well.

Bil Simser wrote re: Let's see, if I...
on 07-02-2008 9:16 AM

Heh. "co-irkers". A typo or...

And just ask Oren, he would have written the solution for you in 8 lines.

Kyle Szklenski wrote re: Let's see, if I...
on 07-02-2008 9:46 AM

What bothers me is when someone writes an application and starts it off as godawful complex, without even trying to do something simpler.

An example would be a co-irker of mine wrote an application for which there are multiple different hardware types to be abstracted. He wrote a single base class, to which he adds all the functionality of a new piece of hardware to whenever that hardware is added. In most cases, 50-90% of the interface is dead code/degenerate functions. What I realized is that, the way it's set up, it's much simpler to use the command pattern and that's that. How is it that a relative nublet programmer (me - 1.5 years experience) came up with this significantly simplified version of the base class interface (no specific functions, just the one called Send(ICommand command)!), when a person with 15+ years of experience was completely blind to it? As a friend of mine said, "Welcome to the real world."

The fact is, the author of said class didn't look for anything simpler. He made it ridiculously complex from the start, and now when someone else has to add a new piece of hardware to the top, that person is left in a coma - because their brain shut down when they saw how it was "designed"!

Jeremy D. Miller wrote re: Let's see, if I...
on 07-02-2008 10:46 AM

@John,

Nice comment.  However, if you aren't smart/experienced enough to cut through the garbage on Google, you certainly aren't going to do any better writing your own stuff.

@Kent,

"I think what Jeremy's getting at (and I apologize for putting words in your mouth, Jeremy) is that if there is a business problem to be solved, we should be *avoiding* solving technical problems, especially when they've already been solved well."

Ditto from me, with the proviso that yes, sometimes you can come with an innovative way to do it better.

@Kyle,

Welcome to the world of a professional software developer.

Josh wrote re: Let's see, if I...
on 07-05-2008 8:56 PM

@Kent and Jeremy

I sort of realised that you weren't attacking this type of activity but I wasn't going to pass up the chance to draw your attention to the project :)

Add a Comment

(required)  
(optional)
(required)  
Remember Me?