Stay away from job postings like this! – level 000

I came across this on a message board, and I just HAD to blog it:

Requirements(.Net Developer position):
*2 yrs exp programming in .NET.
*Exp with C# and VB.NET required.
*Experience with ActiveX DLL, EXE, and OCX programming required.
*Experience and knowledge with Windows 32 API.
*5 yrs exp with Structured Query Language including custom coded SQL logic.
*Strong understanding of database normalization.
*Experience with n-tier design including logical and physical model implementation.
*Experience in creating, changing, and collecting data using custom defined business objects.
*Prefer exp in Web and Palm development .
*Understanding of third party reporting tools (e.g. TxText Control, Crystal Reports).
*Understanding of object oriented principles and methodologies
*Experience using source control and change management procedures.
*Understanding of Microsoft Windows Installer (MSI) and creation of custom installation packages.
*Thorough understanding of data access techniques
*Must have strong attention to detail
*Must have experience working in a team environment and be able to interface with management and internal customers
* Prefer Bachelor’s degree in Computer Science, or Engineering. Minimum requirement is Associates degree or equivalent from two year college or technical school in Computer Information Systems or Programming Certification.

Pay Rate:  up to $29/hour

#1 and 2 seem reasonable, and I meet that.  OCX programming???  I’ve NEVER done that.  By the way, is this .Net developer position going to require daily OCX programming??  Give me a break?  n-tier design:  This candidate must have experience implementing both logical AND physical designs.  Well, I’m disqualified because I’ve never implemented a logical design.  Then there is Palm development.  Never done that. . .and then who can understand Crystal Reports (I mean REALLY understand it?). 

Then at the bottom, there is the college requirement.  And then for this super-developer, they want to pay up to $29 per hour???  What a laugh!  Most of the time, it will take 3 or more people to get all these skills, and they want one to work for $29.  That’s great.  They’ll get what they’re willing to pay for:  someone who lies on his resume about all these things and can stumble his way through to something that works (for up to 3 users). 

These job postings are all over the place.  The recruiters don’t have a clue who they need to hire.  Targeted job postings impress me.  They have required skills (what the job needs on a daily basis), and that’s it.  And usually the rate of pay is only mentioned when it is low.  My advice to anyone reading is to stay away from the above job.  This reeks of poor management and an environment of frustration.  May ye be warned.

Watch out for this MSN IM virus – level 200

You need to read: http://www.sarc.com/avcenter/venc/data/w32.bropia.m.html

If you get an IM message (even from someone you know) that reads something like this: LOOK! http://members.chello.nl/g.geurts1/handcuffs.XYZ. . . .  Don’t click on it.  If you do, you’ll need to clean it before rebooting because it adds an executable to your run-once list. 

If you are skeptical of everything and don’t click, you are safe.  I know a LOT of people who have been affected by this.

If your mind can’t keep up with your fingers – level 100

I learn things from Google.com every day, and today, I was typing very fast and typed Googel, and before my mind could process it, I had hit the CTRL + Enter keys.  I expected to have to retype it, but it was redirected to the correct url.  What a great plan.  Knowing that malicious sites would pop up with spellings close to Google, they bought these common misspellings and redirect them.  Other sites could learn from them.  Check out these sites:

http://www.gogle.com
http://www.gooogle.com
http://www.googel.com

If you log exceptions, watch out for Response.Redirect() – level 200

A common practice with any web application is to log fatal exceptions.  After all, if the user can’t complete the intended operation, wouldn’t you want to know about it?  I log all fatal exceptions in my apps because if one of these happens, I want to know about it so I can fix the bug.  Often, a production environment will uncover bugs in fringe use cases — bugs that would never turn up in the normal test cycle.  The exception information can help you reproduce and fix the bug.

Recently I employed the use of Response.Redirect( ) for a situation where I wanted to stop doing the work on the current page and go to another that was dependent on the query string.  I used Response.Redirect( ) for this, and my exception log started growing.  After investigation, I found that a ThreadAbortException was being thrown with every Response.Redirect( ) call.  By looking at the call stack, I discovered that Response.Redirect( ) actually calls Response.End( ) internally.  Response.End( ) throws the ThreadAbortException to terminate work on the current thread after sending the redirect message.

The elusive Path class and it’s “hidden” static methods – level 200

If you ever find yourself manually parsing a file name or any part of a path, stop!  It’s very tempting to use a couple of lines of code to trim an extension off of a file, but why do it.  Also, if you ever have a directory path and a file name, don’t concatenate the two strings together (making sure that a “/” is in between), us Path.Combine instead.  I think that a lot of code can be reduced by reusing the BCL.  Every now and then you might save 15 minutes by taking 5 minutes to research what is available in the BCL. 

Let’s take a look at the System.IO.Path class and see what it can do for us.  Just by looking at the following method names, I’m sure you can figure out how to use them to reduce your codebase:

Public Fields


















public fieldstatic (Shared in Visual Basic)AltDirectorySeparatorChar

Supported by the .NET Compact Framework.

Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.
public fieldstatic (Shared in Visual Basic)DirectorySeparatorChar

Supported by the .NET Compact Framework.

Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
public fieldstatic (Shared in Visual Basic)InvalidPathChars

Supported by the .NET Compact Framework.

Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the Path class.
public fieldstatic (Shared in Visual Basic)PathSeparator

Supported by the .NET Compact Framework.

A platform-specific separator character used to separate path strings in environment variables.
public fieldstatic (Shared in Visual Basic)VolumeSeparatorChar

Supported by the .NET Compact Framework.

Provides a platform-specific volume separator character.

Public Methods







































public methodstatic (Shared in Visual Basic)ChangeExtension

Supported by the .NET Compact Framework.

Changes the extension of a path string.
public methodstatic (Shared in Visual Basic)Combine

Supported by the .NET Compact Framework.

Combines two path strings.
public methodstatic (Shared in Visual Basic)GetDirectoryName

Supported by the .NET Compact Framework.

Returns the directory information for the specified path string.
public methodstatic (Shared in Visual Basic)GetExtension

Supported by the .NET Compact Framework.

Returns the extension of the specified path string.
public methodstatic (Shared in Visual Basic)GetFileName

Supported by the .NET Compact Framework.

Returns the file name and extension of the specified path string.
public methodstatic (Shared in Visual Basic)GetFileNameWithoutExtension

Supported by the .NET Compact Framework.

Returns the file name of the specified path string without the extension.
public methodstatic (Shared in Visual Basic)GetFullPath

Supported by the .NET Compact Framework.

Returns the absolute path for the specified path string.
public methodstatic (Shared in Visual Basic)GetPathRoot

Supported by the .NET Compact Framework.

Gets the root directory information of the specified path.
public methodstatic (Shared in Visual Basic)GetTempFileName

Supported by the .NET Compact Framework.

Returns a uniquely named zero-byte temporary file on disk and returns the full path to that file.
public methodstatic (Shared in Visual Basic)GetTempPath

Supported by the .NET Compact Framework.

Returns the path of the current system’s temporary folder.
public methodstatic (Shared in Visual Basic)HasExtension

Supported by the .NET Compact Framework.

Determines whether a path includes a file name extension.
public methodstatic (Shared in Visual Basic)IsPathRooted Gets a value indicating whether the specified path string contains absolute or relative path information.

Evaluating CommunityServer RC1 – level 000

I downloaded CommunityServer RC1 today, and it looks promising.  Setup was a snap.  The installer is great.  I went through the forums, blogs, and gallery features, and it looks very good.  I love the photo gallery feature.  This is some really great UI work!  The blog part looks very similar to .Text v0.95, but the admin section has been really beefed up.  There are a lot more settings:  comment moderation, publish date, show post on main feed, etc. 

I also like it that every screen has been made a control, so even though it’s distributed with .aspx pages, I can concieve an easier integration into an existing site by putting the CS controls in already existing pages.

I predict that current .Text sites will upgrade to this and facilitate an even more productive community where each member can have a small part of it to call home for not only the online journal(blog) but also a photo album.

Great work, Telligent!

Use Master pages in v1.1 – level 200

Ben Reichelt blogged about using Master Pages, and I realized that I never put out the word that I posted my version of v1.1 master page controls to my website.

Go to http://palermo.cc/MyToolDownloads/Default.aspx to download my “EZ Master Pages” controlset.  It is based on the foundation of the controls from Paul Wilson, but I’ve made significant improvements including programmatically setting and changing the master as well as facilitating nested masters.  My controlset follows the pattern of 2.0 closely, so you will have a very easy migration path with these controls.

I’m famous. I guest-starred in a TestFixture on a Whidbey webcast! – level 000

Rory Blyth gave a webcast on the unit-testing features of Whidbey, and he mentioned my name in the test.  I’m flattered.  I will completely ignore that “Jeremey Palermo” was mentioned.  I’ll assume it was “Jeffrey Palermo” and go on with life. 🙂

The recorded webcast can be viewed at http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032267323&EventCategory=5&culture=en-US&CountryCode=US

Go to 29 minutes into the presentation, and you’ll hear where Rory introduces me.  Then go to 38:40 in the presentation, and that’s where he corrects my first name. 🙂

Thanks Rory (if you are reading this).

Don’t use public const EVER (if you want maintainable code) – level 200

The c# const keyword is great.  At compile time, the contant is actual replaced by the actual string anywhere that the constant is referenced.  The compiler just does a find/replace.  This is great for private and internal constants.  If ever the constant changes (and it might), it’s replaced when the assembly is rebuilt.  If you use the contant 50 times in your code.  Use Lutz Roeder’s Reflector to look at one of your assemblies that references these contants.  You won’t find the constant name.   You will actually find the string that the constant was set to.  This is the optimization benefit fo constants. 

Now, what happens when you have a public constant, and you reference it from a client assembly?  Same thing.  The compiler takes the value of the constant and replaces it with the literal string.  100% optimized.  Then, a new version of the shared assembly comes out, and the constant has changed.  You drop this new assembly in your app directory and try your application.  No dice.  Your assembly has the old constant string hard-coded in it.  The shared assembly is expecting the new string.  Bad situation.  You have to recompile the client assembly (hoping that the 5-year old source code is the right copy and that things weren’t misplaced over the years) and completely retest the new build (the cost of that depending on the size of the application).

The good news is that there is a very easy way to prevent this maintenance nightmare:  don’t use public constants.  Instead, use public static readonly varName.  This is a normal variable with the same scope as a public const, but client assemblies reference the variable instead of replacing it with the literal string.  Now when the const changes, the client assembly gets the new string through the public static variable.

It only takes a minute to do a global search for “public const” to see if your application might fall prey to this problem.  Also, be sure to convert protected constants as well because client assemblies could contain classes that derive from the offending class.