CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

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.
 



Comments

Rick Fleming said:

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 :).

# July 1, 2008 12:46 PM

Guy Ellis said:

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...)

# July 1, 2008 2:27 PM

Jeremy D. Miller said:

@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.

# July 1, 2008 2:35 PM

jdn said:

What's better is when log4net is used.

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

Sweet

# July 1, 2008 3:04 PM

Josh said:

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 :)

# July 1, 2008 3:27 PM

Jeremy D. Miller said:

@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!"

# July 1, 2008 3:31 PM

Aaron Erickson said:

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.

# July 1, 2008 4:08 PM

Jeremy D. Miller said:

@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.

# July 1, 2008 4:10 PM

TSHAK said:

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.

# July 1, 2008 6:49 PM

John O'Brien said:

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

# July 1, 2008 9:50 PM

Kent Boogaart said:

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'.

# July 2, 2008 8:03 AM

Kent Boogaart said:

@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.

# July 2, 2008 8:07 AM

Bil Simser said:

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

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

# July 2, 2008 9:16 AM

Kyle Szklenski said:

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"!

# July 2, 2008 9:46 AM

Jeremy D. Miller said:

@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.

# July 2, 2008 10:46 AM

Josh said:

@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 :)

# July 5, 2008 8:56 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

Our Sponsors

Free Tech Publications

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP