Archive for September, 2007

Link Round-Up for 9/27/07

Links that make you think, not stinkHere are some of the interesting links I ran across this week:

Software Development Links
Abhijit Nadgouda wrote this piece, It Is Really About You, Not The Tool, that ties in well with some of the things I’ve said in my articles. I agree with his point, “It is never about the tools, it is always about you and the solution”

Over at Java Lobby Jason posted this article, 7 Top Tips for Quality Java Software. Most of his 7 tips are also applicable to .NET development as well.

Daniel Versteegh asks an important question, Is it possible for a small company to switch their development language? While he’s not talking .NET but Java and Erlang, his comments do apply well to what we see with the VB6 vs. VB.NET problem.

Ian Suttle had me worried a minute with this article, 8 Traits for Being Mr. Right Engineer, when it seemed to set the perfection level a little too high for most humans but he clarified his position. He has good advice as long as Lumbergh isn’t your boss’ name and the “Bobs” aren’t consulting at your company.

Programming Job Interviews and Other Related Links

I’ve published a number articles on this topic recently but I’ve not been the only one.

Andrew Wulf has this interesting article called Interview Technique: A Topdown Approach. I like his idea about picking an item from a candidate’s resume and asking them to give you the details about it. I’ve tried this one a few times and it’s worked well.

Jay Fields plays a hand of interview poker in his post entitled Semi-bluffing your interview. However, he doesn’t say what to do when you get dealt aces and eights at an interview.

Steve Yegge has some good resume tips in this article: Ten Tips for a (Slightly) Less Awful Resume.

.NET Links

I’m going to wind things up with a few neat .NET articles.

Here are some neat tips for the VS IDE: 11 Visual Studio 2005 IDE Tips and Tricks to Make You a More Productive Developer. It’s centered around C# but many of the tips work in VB.NET too.

The Open Source .NET Application Generator project looks interesting. I haven’t had time yet to really examine it yet but I plan to soon.

That’s all for this week. Let me know if you read anything interesting that I should know about by leaving me a comment.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone

Add comment September 27th, 2007

An Undercover Guide to Programmer Job Interviews

A job interview is a lot like a blind dateSeveral of my recent articles have dealt with interviewing programmers. This time around I’m going to sit on the other side of the conference room table. I was given some of these interview tips from professional recruiters plus I’ve added some of my own observations drawn from my own experiences.

It is common these days for one to have upwards of 6 to 8 separate interviews with people of all different levels and positions. If you flub one part of the interview, then you may not get the job. Let’s look at dealing with these different levels/positions.

Dealing with Human Resources

These people are usually the gatekeepers of the company. Some act as your friendly tour guide to the company while others can be a bureaucratic nightmare to deal with.

The first type is easy enough to deal with, just be courteous and polite. Ask a few general questions that reveal your interest in the company. Don’t delve too deeply into benefits (for example, don’t ask “How are your substance abuse benefits?”) but ask reasonable questions about them. After all, you don’t want to be surprised by a lousy benefits package after you’ve accepted the position.

The bureaucratic type is the personification of Dilbert’s Catbert, a person who seems to take delight in tormenting interviewees and employees alike. They’ll have tons of legal paperwork for you to fill out, psych tests, and so forth. They’ll insist that you fill out a 5-10 page application by hand even though you have a perfectly good resume. They’ll talk about personnel plans like the vitality curve and other things that make employees miserable and at each other’s throats. Generally this person is on a power trip and this is usually a good indicator of a messed up company. Do you really want or need to work for this company? If so, grin and bear it. Otherwise, bow out gracefully and head for safety.

Of course there is a lot of room in between these two but the HR person will usually give you your best initial feel for the culture of a company.

Dealing with Non-Technical Persons

If you do interview with a non-technical person they’re probably going to be someone who you will be working with or for, either directly or indirectly, on the project that’s being staffed. Avoid getting deep into technical details but try to draw high level parallels between what you’ve done in the past and what they want done. For example, they’re wanting to build a document manager for insurance claims and you’ve done a similar project with auto loans. Let them know in confident, but not cocky, terms that you can help them due to your previous experience.

People in these positions are also good indicators of company culture outside of IT. Watch for warning signs of a dysfunctional organization or, hopefully, indicators that people really do like working there.

Dealing with Executives/Owners

When you interview with a member of executive management or, in smaller companies, one of the owners, it’s best to deal with abstracts when it comes to technology and dollars and cents issues when it comes to business. They’re going to be paying a lot of money for your time so you want to make sure you look like a good investment for the long term. Stick with topics like how your work has improved efficiency or increased ROI at your previous employers.

Mild flattery can help here too. Show them that you’ve researched their company by saying something like, “I noticed that you’ve been in business since 1996.” or “I read that you won the Human Fund’s Costanza award last year.” Just don’t lay it on too thick, they’ll see through it more than likely. Also, be careful about stumbling into something that might better be left unsaid. A faux pas at this level might kill your chances.

As for company culture, they usually aren’t the best indicator of it. They usually imagine that their employees are all happy campers and often don’t see cultural problems developing until it’s too late.

Dealing with IT Managers

Sadly, many of these people moved into management from programming, or another technical field like network administration, and, for their efforts, have become little more than bureaucratic paper pushers. They will generally be fans of processes, metrics and other busy work. The worst ones will be micro-managers and choleric jerks. Others will be nice but obviously lacking technically. Others, the good ones, will have technical savvy. You can generally get the feel for the situation quickly by seeing what kind of questions they ask and how they answer your questions.

If you’re being interviewed by Bill Lumbergh, you know it’s time to retreat unless you’re desperate for work. If you must stay in the battle, mention your love of metrics, well documented processes and your willingness to work on weekends.

The nice but non-tech guy/gal can usually be bedazzled by throwing out hot buzzwords like AJAX, Agile and Scrum, or just about anything else you can gather from the front pages of DZone, ZDNet or other popular tech sites as long as it seems to fit in with what they want to do. Don’t overplay your hand though because even if they aren’t up on things, somebody on their staff probably is and you may be called on it at some point.

The technically savvy manager, in most cases, will be your best or worse interview. It will be the best if you know your stuff and present yourself well, but the worst if you try to BS your way through. For the best results, treat them like you would a senior, knowledgeable, peer. If you impress them you’re more than halfway there.

Dealing with Other Programmers

These guys/gals should know both the technology and their problem domain. You may have a technical edge on them but don’t be a show-off about it. That’s a good way to get black balled. Listen attentively to what they say about their problem domain and, if given the opportunity, ask about a few details to show your interest. If you try to scam them with buzz words you’re very likely to fail and, if you do manage to dazzle them with BS, it probably isn’t the right place for you to be working anyway.

Remember that mess of an application or web site they share a few details about may be somebody’s pride and joy. Therefore, don’t talk about any design flaws you may notice without being invited to comment directly on them. Treat it just like you would treat a parent who just proudly presented you with a picture of their ugly baby. Likewise, if you’re awestruck by the perfection of their development methods you may want to find somewhere else to work if you know your skills aren’t up to the challenge.

Show them that you have a sense of humor but don’t go overboard into creepy, annoying or goofy territory. You want to be someone they wouldn’t mind hanging out with at lunch or after work. Smile and be friendly, even if it hurts.

If the programmers you interview with are obviously lacking in skill, this could be a warning sign. You may be handed the responsibility of improving things which can be a daunting task. If they hint at morale problems or other troubles, this should be a big red flag to you. Ask them to provide a few details about the work environment so that you can get a feel for what you may be getting into.

Ultimately, these people will usually be your best source for information about the inner workings of the company and will have a lot of control over the hiring decision their manager makes.

Well, this article went on for a little longer than I expected. I’ll have to follow it up later. Let me know if you thought these hints were helpful or not. Feel free to throw in your own hints and tricks and if you disagree with what I said. I always welcome your opinions and perspectives, even if they’re different from mine.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone

1 comment September 25th, 2007

3 Handy VB.NET File Functions You Can Use

File Functions in the 50’sHere are three VB.NET functions you can use for some common file operations. These operations are: Getting the File Attributes, Reading an INI File, and Touching the date/time of a file. By providing wrappers for some of these common .NET functions it makes it easier to add checks and exception handling/prevention to the base routines. These routines are certainly open to expansion and improvement so use them as templates that you can build upon.

Getting File Attributes

Often you’ll find the need to determine the attributes of a file before you perform some action on it. Here’s a handy little function to do just that.

Public Function CheckFileAttribute(ByVal filename As String, ByVal attribute As IO.FileAttributes) As Boolean
    If IO.File.Exists(filename) Then
        If (IO.File.GetAttributes(filename) And attribute) > 0 Then
            Return True
            Return False
        End If
        Return False
    End If
End Function

This function checks to see if the target file exists and, if it does, it checks the specified attribute to see if it’s set or not. We’re using the IO.FileAttributes Enum as the second parameter so that we can use the same function to check several different attributes like Hidden, Read-Only, Compressed, or Encrypted.

Note that if the file doesn’t exist a False value is returned. You may want to change this to True depending on how you want your program to flow. Another option would be to make it an optional parameter or an overload where you can decide on the file not found return value.

Here are some example calls:

If CheckFileAttribute(CurrentFile, IO.FileAttributes.Hidden) Then
If CheckFileAttribute(CurrentFile, IO.FileAttributes.ReadOnly) Then

Read INI File Contents

Here’s a simple function to read the contents of a standard Windows INI file. The target filename is passed in and a generic list of string array is returned. The list does not contain commented out values but does contain section headers with the value for the header in both elements of the array. The VB.NET TextFieldParser class is used to parse the INI file, using the = sign as a field delimiter. Here’s the function:

Public Function ReadIniFile(ByVal filename As String) As List(Of String())
    Dim IniContents As New List(Of String())
    If Not IO.File.Exists(filename) Then
        Return IniContents
    End If
    Using INIFileParser As FileIO.TextFieldParser = My.Computer.FileSystem.OpenTextFieldParser(filename, "=")
        Dim CurrentLine() As String
        With INIFileParser
            .TrimWhiteSpace = True
            Do While Not INIFileParser.EndOfData
                CurrentLine = .ReadFields()
                If CurrentLine(0).Length > 0 Then
                    Select Case CurrentLine(0).Substring(0, 1)
                        Case ";"
                            'ignore comments
                        Case "["
                            'section header
                            IniContents.Add(New String() {CurrentLine(0), CurrentLine(0)})
                        Case Else
                            IniContents.Add(New String() {CurrentLine(0), CurrentLine(1)})
                    End Select
                End If
        End With
    End Using
    Return IniContents
End Function

Note that this is a very simple function. For more sophisticated uses you would probably want to use a class to represent the section and have a list of key/value pair classes as members of that class. Also, some further error condition and parsing logic could be added to insure smoother operation.


Our last function is a ‘Touch’ function that sets the file dates and times to a specified date. Here’s the function:

Public Function Touch(ByVal filename As String, ByVal newDateTime As Date) As Boolean
    If IO.File.Exists(filename) Then
        IO.File.SetCreationTime(filename, newDateTime)
        IO.File.SetLastWriteTime(filename, newDateTime)
        IO.File.SetLastAccessTime(filename, newDateTime)
        Return False
    End If
End Function

As you can see, this function sets the creation time, last write time, and last access time to the specified date and returns a True on success and False if the file doesn’t exist. You could expand this function by adding exception handling and more condition checking. You could also do overloaded versions for each date type.

That’s a wrap. Let me know what you think, if you notice any mistakes or if you have any questions by leaving a comment.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone

Add comment September 25th, 2007

How To Update Controls Using BackgroundWorker in VB.NET

BackgroundWorker Paints a FormThe .NET Framework 2.0 BackgroundWorker class makes it easy to code simple threading into your applications. However, a common question that gets asked in VB related forums is, “How do I update a control, or controls, from the worker thread?”. Many people seem to be in search of a simple explanation of how to do this. In this article we’ll create a quick and easy example program that will walk you through the steps.

Getting Started

First, we will need to create a new Windows application. On our form we’ll add two buttons, btnStart and btnCancel, a progress bar, prgThread, and a listbox, lstValues. You may also want to import System.ComponentModel into the project namespace or onto the form or you can just spell it out like I’m doing below.

Next we’re going to add code. First, we declare the BackgroundWorker object, TestWorker. Note that we’re declaring it with events so that the event structure is built automatically.

Private WithEvents TestWorker As System.ComponentModel.BackgroundWorker

Now, code is added for the start button, btnStart.

Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
    btnStart.Enabled = False
    btnCancel.Enabled = True
    prgThread.Value = 0
    TestWorker = New System.ComponentModel.BackgroundWorker
    TestWorker.WorkerReportsProgress = True
    TestWorker.WorkerSupportsCancellation = True
End Sub

First, we disable the start button and enable the cancel button. Next we reset the values for our listbox and and progressbar. Now we’re ready to create our BackgroundWorker object. Notice that we tell it that we want to have it report progress and support cancellation. Finally, we tell it to run the worker.

The Worker

Here’s the code for our worker thread. This code is contained in the DoWork event. All it’s doing is looping 100 times and reporting the progress and sleeping 100ms between iterations. We also check for a cancellation state.

Private Sub TestWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles TestWorker.DoWork
    Dim ListText As String
    For Value As Integer = 0 To 100
        If TestWorker.CancellationPending Then
            Exit For
        End If
        ListText = String.Concat("Item #", Value)
        TestWorker.ReportProgress(Value, ListText)
End Sub

You can also see that in the ReportProgress function call that we’re passing in the current value and a string.

Updating Form Controls

In the ProgressChanged event, we get to process our values from our DoWork method. Here’s the code:

Private Sub TestWorker_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles TestWorker.ProgressChanged
    prgThread.Value = e.ProgressPercentage
End Sub

In this routine, the progress bar and the listbox are updated with values from the worker thread. Remember that the UserState value is an object and will require conversion if you can’t use an object type.

Canceling the Worker

Now, what if you want to cancel the worker? Here’s the code that goes into our cancel button’s Click event:

Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
End Sub

Here we call the CancelAsync method. However, this only sets a flag and, as shown above, our DoWork method has to check for a CancellationPending state. Otherwise, the work will continue until the DoWork routine is exited.

Finishing Things Up

When the work has been completed or canceled, the RunWorkerCompleted method is called. In our program, this allows us to reset our buttons.

Private Sub TestWorker_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles TestWorker.RunWorkerCompleted
    btnStart.Enabled = True
    btnCancel.Enabled = False
End Sub

That’s how it’s done in a nutshell. Of course, handling multi-threading in your applications can become very tricky. It is recommended that you further review how to avoid problems with threading before implementing it.

Let me know if you have any questions about BackgroundWorker or if you have any suggestions or thoughts about this example by leaving me a comment.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone

24 comments September 24th, 2007

7 Ways To Hire Smarter Programmers

OK smart guy, why are septic tank covers square?When you’re in a team lead or management role you will inevitably be called upon to do a job interview. Even if you are a team member you might interview a potential peer. So, once you’ve given them your programming language trivia quiz, asked them why manhole covers are round and had them to tell you a little bit about themselves what should you look for in the job candidate in order to hire the best candidate possible? What should you look for ‘between the lines’? And what should you avoid doing?

1. Look For Intelligence

This, of course, is the point of your programming language quiz and brain teasers. Do they know their stuff? It seems pretty straight forward, doesn’t it? Just pass or fail, right? However, you have to look beyond just what might be rote memorization. Do they seem like they’re just reciting answers to you? If you follow up with a “Why?”, can they launch into a detailed explanation or do they give you a ‘deer in the headlights’ look? Remember, you’re not looking for someone who can memorize a lot of stuff but someone who can also apply this knowledge in a meaningful way.

2. Look For Compatibility

How well do you click personally with the candidate? Do they seem able to get along with the people they’re interviewing with? Is this someone you can work with on a daily basis? Are they a know-it-all or champion BS’er? Do they seem overly nervous or reserved? Do they seem aloof or disengaged or are they involved and engaged in the interview and with the interviewers? Do you think this candidate helps you think and does it seem that you make them think? How do they make you feel? Comfortable or uneasy?

Ultimately, a programmer might be quite smart but if they don’t mesh will with the group this will reduce their ability to perform at the top of their game. Just beware of being too selective in this area or trying to find someone who’s exactly like you.

3. Look For Problem Solving Ability

If you ask them an open ended question, how do they seek more information from you? Do they just make assumptions or is there give and take between you? Are they willing to ask for or accept help or are they too arrogant or unsure to ask? Do they seem confident or confused?

Once they’ve solved the problem or stated they can’t solve it, ask them about the mental process they used to solve, or try to solve, the problem. Note, them saying, “I didn’t even know where to begin” or “I just guessed” is a bad sign while them giving you a rough outline, even if it isn’t completely right, is usually good.

This is where you examine how they apply their intelligence and use it to interact with others, a combination of the first two items on our list. Hopefully you will gain some insight into their internal problem solving process.

4. Look For Creativity

Often you’ll find programmers who lack creativity. You can give them a detailed spec and they can code it quickly but if you give them something fuzzy or incomplete where they have to fill in the blanks, they can’t do it. Or, if you give them a user interface assignment, it is very dull and takes a brute force approach rather than an elegant one. Do you need creativity in your position? Maybe not. However many organizations do need it.

So how do you gauge creativity?

One way is to ask them about outside activities. Some of the best programmers I’ve known have had outside creative interests like music, painting, or furniture making. While this isn’t a 100% solid indicator of creative programming ability it is a good sign in my book.

Also look how they draw out their thoughts on a white board or piece of paper in response to a puzzle or a design question. Do you get the feeling that they’re painting-by-numbers or are they capable of developing a masterpiece?

5. Look For Passion

Does the candidate have a passion for programming and computers? How can you determine this?

One way is to ask about the most recent programming books they’ve read. Another is to ask about which web sites they use to learn about the latest industry trends. Where do they go for help in solving problems. Do they participate in online programming forums? Do they have a programming related blog or web site?

Ask them about their home computing setup. A passionate programmer is likely to have quite a home network setup and will be able to describe it to you. However, a not so passionate one might tell you they’re still using their college PC from 10 years ago and that they only boot it up occasionally.

6. Look For Diversity

You don’t want a clone army in your organization. If every programmer is from the same school and has roughly the same background you’ll end up with a case of groupthink that will limit the overall brainpower of your group.

If you’re were a heavy duty computer science major, don’t be afraid to hire that sociology major who has a knack and passion for programming. If you went to a highly rated technical university don’t summarily dismiss the ability of a night school grad. Likewise, if you’re the sociology grad, don’t allow yourself to be intimidated by the CS major.

Don’t get hung up on finding a candidate that has extensive knowledge already in your specific field. A smart programmer should be capable of applying knowledge from one field to another. In fact, they may be able to offer a different insight from their experience in another industry.

Everyone has different perspectives and can learn from someone else. Don’t let your hiring practices cause your team to become inbred.

7. Look Past Stereotypes

Many programming job want ads ought to read like this if they were truly honest:

Wanted: Senior Level Expert In VB.NET

  • 6+ years of increasingly responsible professional experience
  • A minimum of 4 years of working with VB.NET
  • Database experience in SQL Server 2000/2005
  • Successful candidate must be a healthy Caucasian, Asian, or Indian male of between the ages of 25-35. No women, people over 35, people with disabilities or those of other ethnic groups or racial minorities need apply.
  • Hopefully you don’t think and hire this way. Sadly I’ve known many organizations that do behave this way to some degree. While such discrimination is illegal, at least in the US, many use clever HR approved code phrases to not hire or even interview people who don’t fit within a narrow stereotype of what some think a programmer should be. Narrowing your choices by allowing yourself such prejudice will cause you to cut yourself out of a pool of potential talent and often lead to hiring someone less skilled, less smart. Don’t let this kind of thinking poison your ability hire the best people.

    I hope you’ve found this article helpful. Let me know what you think by leaving me a comment.

    Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Digg
    • Reddit
    • StumbleUpon
    • Technorati
    • DotNetKicks
    • DZone

    10 comments September 23rd, 2007

    Next Posts Previous Posts

    Visit Me At My New Site, Programming In C#

    Most Popular Articles

    Highest Rated Articles


    Most Recent Articles


     Subscribe in a reader

    To subscribe by e-mail
    Enter your address here

    Delivered by FeedBurner

    VB Opportunities