This blog has moved!

Check out www.CodeBetter.com/blogs/grant.killian

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Professional Props...

Extracurricular Props...

Subscriptions

Article Categories



Wednesday, July 21, 2004 - Posts

FireAndForget

In the blogging mood today, so I figured I'd blog a useful code snippet.  Doing Fire-And-Forget operations, the one-way method calls that don't return a value and you don't want to block the main application thread, are exceedingly easy in .Net (unless I'm doing things wrong!).  Doing asynchronous operations like this used to be tricky, but not anymore.  

No, you don't want to use BeginInvoke and risk memory leaks . . . instead, you're better off using the QueueUserWorkItem method of the ThreadPool object.  Syntax looks like this:

WaitCallback cb= new WaitCallback( FireAndForgetMethod ) ;
ThreadPool.QueueUserWorkItem( cb ) ;

You'll need to import the System.Threading namespace for the above to compile.  You also need a FireAndForgetMethod like this:

private void FireAndForgetMethod( object o ){
  //code statements to run asynchronously . . .
} 

I use this sort of approach to send batches of email notifications, perform lengthly sql report operations, and other processing that doesn't need to run synchronously with the flow of the web application (this would certainly also work in a WinForms application).

Just did a quick google search and turned up this nicely packaged FireAndForget example too; it's a bit more involved, but at the heart uses QueueUserWorkItem in conjunction with a little nice Reflection.  It's worth checking out!

posted Wednesday, July 21, 2004 12:14 PM by grant.killian

MS Certification is designed for maximum scalability

More on the cert post I just made . . .

MS Certification doesn't certify that you're a good developer . . . instead, MS Certification certifies that you are fully buzzword compliant (most exams seem to exercise the latest features and novelties), have solid rational thinking skills in a test environment (for example: you can usually tease answers out of questions just by the process of elimination), and have a basic familiarity with the exam subject.  Alternately, MS Certification can sometimes certify that you can cram and memorize the Transcender test prep material.  For the record, I've never relied on Transcender as it felt like cheating.

Unfortunately, employers don't always know the above so they treat these Certifications like the gold standard of developer achievement.  If employers emphasize these exams, then you can bet the typical (and rationale!) employee will take notice!  It's too bad because Certification doesn't answer questions like:
-is your code up to professional standards (structure, conventions, comments, etc)?
-are you or is your code innovative (I'm fairly certain Don Box isn't Microsoft Certified)?
-how do you function in a real setting, as opposed to a contrived test delivered by computer?
-are you Certified by Transcender, more than Microsoft?

-can you program to a requirements doc, a UML diagram, etc?
-how many errors do you let creep into your checked-in code?
-are you a jerk?

I know, that last item can't be determined in an exam, but it would be nice.  I really think a developer credential speaking to the questions I've enumerated would be very valuable.  But, in the words of a Microsoft Certification Program manager I met, “evaluation of those elements do not scale.”  Gotta love that, even the MS Certification program is designed for maximum scalability!  The guy does have a valid point, though, and the current cert program is better than nothing.  Maybe a third party could do a “code certification program“ where they evaluate programs and award a credential based on the qualities above.  The Coding Slave software guild, pehaps?  Maybe WeProgram.Net could step into this void?  Maybe none of the WeProgram.Netters have the time or energy to pursue this?  Maybe I should wrap this post up and get back to billable work?

Now, I know many great developers that don't pursue certification because they don't like the pressure of the tests, or they say something else but secretly don't like the pressure of the tests.  I know some who won't tell anyone when they're sitting for an exam because they're worried about the shame of not passing; besides being a huge "psychology of failure" transgression, this tells you how much pressure people feel.  All of you would gladly accept an "honorary MCSD.Net" if Microsoft chose to bestow you with one, so the only reason people won't take the exams is because they don't like the process.  Unless Certification finds ways to answer some more of the above questions (except the Jerk thing), there will always be a large segment of the developer community who avoid the exams.  It's a credibility problem for the exams.  Look what happened to the MCSE program!  I've beat this drum before, however, so I'll call it post.

posted Wednesday, July 21, 2004 9:50 AM by grant.killian

On Not Passing the Beta Security Exam

Turns out I didn't hallucinate my .Net Beta Security exam after all.  I got a letter the other day saying I didn't pass the exam (scored a 650 while you need 700 to pass).  My first reaction was shame; I work with .Net day-in and day-out, teach .Net classes, and consider myself fairly proficient with it.  Like most programmers, I have a healthy self-esteem (perhaps venturing into arrogance?) and this was a blow to it. 

After reflecting on it further, however, I see how failing the exam isn't such a bad thing.  My preparations were modest; while I did read one security related book, I didn't devote a lot of time to getting ready for the exam.  I don't consider myself a .Net security expert.  The truth is, I've been taking MS certification exams for granted -- I remember really studying for my first MCSD exams in 1999, working through demo applications and all -- and when I easily passed, hardly missing a single question, I knew I was way over-prepared.  I went ahead and took all the other exams for the MCSD requirement in about 6 weeks, and passed all but 1 on the first try (I failed the Solution Architectures exam by 1 dang point on the first time around!  Took it again a few days later and passed).

When .Net came around, I didn't see the value in rushing onto the MCSD.Net bandwagon; I was stable in my job and having the latest certs come in most handy when looking for new work.  When teaching for ODU and ITPro, I figured I should really have the credentials so I went ahead and got my MCAD for .Net.  These tests were cut from the same cloth as the earlier certification exams; by using good test taking skills (ever since high school I've always done well on standardized tests) and my practical .Net experience, I made it through those MCAD exams without a hitch. I didn't have any need to get the full MCSD.Net, so I stopped at the MCAD.  This Spring I took the Beta Security exam, figuring it would get me to that MCSD.Net hallowed ground.  I kind of assumed I would pass it, since I've been so successful at the others.

Turns out I overestimated myself and underestimated the Security exam.  I was complacent.  It serves as a little wake-up call to me: Grant, don't be an arrogant ass and prepare for the cert exams!  I'm challenging myself to pass the security exam before the year is over.

Some will gasp and wonder why I would post this failure on my weblog, when future employers and colleagues (and others) are sure to check it out.  I don't follow the If at first you don't succeed, don't admit you tried mantra; instead, I think how one responds to set-backs shows more about a person than how one responds to success.  Besides, not that many people read this weblog anyway!

posted Wednesday, July 21, 2004 9:28 AM by grant.killian




Powered by Dot Net Junkies, by Telligent Systems