Archive for July, 2007

Marine Corps Leadership Secrets - Part II

USMCIn this second article in my series I’ll continue my explanation of how to apply United States Marine Corps leadership traits and principles to software development team leadership. (You can read Part I here.) In this part I’ll be discussing the traits of Decisiveness, Dependability, Initiative, and Tact.

Decisiveness

Nobody likes to work for someone who leaves important decisions up for debate by the group or who simply leaves them up in the air, unmade. Nor do they like to work for someone who is inconsistent or wishy-washy. Managers who publicly vacillate over making key decisions usually lose the respect of those underneath them. However, people will respect a leader who can make a decision, tell everyone the decision in clear, confident, terms and then stick to it. They’re a person who says what they mean and means what they say.

This doesn’t mean that you should be inflexible about the decisions you make though. Situations change and, when they do, a leader is required to decisively act upon the new information. For example, a development tool a lead decided upon isn’t working right due to serious bugs that the vendor isn’t going to fix anytime soon. Instead of muddling on toward failure, the decisive leader takes steps to fix the problem quickly and save the project.

Being decisive also means be accountable for your decisions. If you make the call, you are responsible for it. Don’t pass the buck to your team members, peers or your management.

Dependability

Can your team depend on you? Can your management depend on you? Dependability works both ways.

To be dependable to your management is really basic Work 101 stuff. It means you show up on time, that you don’t make excuses or complain without a good reason, and stay on the job until it is completed. If you aren’t doing these things for your management, then why should you expect those you’re supposed to be leading to do the same for you?

How can you be dependable to your team? You do this by first of all being an example as I mentioned above. You are the role model they’ll look to, for good or for bad. However, it goes beyond just that. It means that you are willing to stand with them if there is an emergency that needs to be handled or if there is extra work needed to complete a project. If the team is coming into the office over the weekend to work you should be there too if at all possible. If there is a disaster, like a failed database, you are there working to correct the problem, even working through the night and into the next day if necessary. Your dependability will inspire those working for you while shirking your responsibility will, over time, demoralize your team.

Initiative

If you only do what you’re told to do and wait for others to take action, well, you aren’t much of a leader. Take a look around and see what needs to be done to either help you reach your goals or that’s keeping you from reaching them. For example, if someone on your team is having a problem with their PC, take the initiative and help them get it fixed. If there is a new tool that would greatly speed the development of your project, take the initiative and get it in for testing. Are there classes you and your team could take? Get them signed up.

Don’t be satisfied with the status quo. Learn to think outside the box and to solve problems in new ways.

Tact

Tact. It means a sense of what to do or say in order to maintain good relations with others or to avoid offense. You may be surprised that this is on a Marine Corps leadership list after seeing movies or TV shows about boot camp. You see a lot of insults and screaming and yelling there. But, courtesy and respect plays an important role within the chain of command once a Marine leaves boot camp. Likewise, the courtesy you show to your team and to your management is important as well.

When you assign work, do it in a courteous, direct and personable manner. This helps insure the work will be understood and will be carried out correctly and with enthusiasm. If you give out assignments in a careless or brusque manner it might very well have the opposite effect.

Tact also applies to how your respect your team member’s time, property, and feelings. Wasting their time in useless meetings, not respecting their property, or hurting their feelings, intentionally or unintentionally, will hurt your authority within the team.

The simple management axiom is to praise in public and reprimand in private. This is one of the key ways to be tactful with your team. A public reprimand or even one that is private in name only can seriously damage your credibility within the team and harm morale. If you must reprimand, make sure that you are fair, firm and friendly about it.

With your managers, you should approach them in the manner that you would want to be approached if you were in their position.

Here are the other parts of this series:

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

Add comment July 26th, 2007

VB.NET Link Round-Up for 6/26/07

LinksHere are some links to some useful articles and blog posts I’ve ran across recently.

On his new blog VBDudes, Dylan C decided to test out my Reverse String function against a looping method. My version won his test. I would also suggest he try the same function with String.Concat and StringBuilder to see how they perform.

At CodeGuru, Paul Kimmel has a good article called Process is Irrelevant. He makes a very good point, “Knowledge, flexibility, and the discretion of smart individuals beats a one-size fits all rule book any day.”

Paul has another good article over at DevSource from a couple of weeks ago entitled Cigars, Lambda Expressions, and .NET. If you’ve wondered about what Lambda expressions will mean to you in VB 2008, check out this article where he explains them well with examples.

Over at Panopticon Central Paul Vick tells us what’s going to be in and not in VB 2008 in this article: What’s in VB 2008? What’s out? While it looks like several good improvements are being made, it also looks like VB will once again get the shaft vs. C# since he says, “In the end, the schedule for VS 2008 was not sufficient to implement these features with a high degree of confidence. Which unfortunately means that they will have to wait to a release beyond VS 2008.” I find this disturbing since with VB 2005 things had more or less evened out.

If you know of any VB related links that I should check out, please leave me a comment.

EDIT: D’oh!!! I can’t believe I got the date wrong in the title! Oh, well.

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

1 comment July 26th, 2007

My.Computer.FileSystem Shortcuts for VB.NET - Part II

My.Computer.FileSystem ShortcutsThis article is the second in my series on the My.Computer.FileSystem Namespace. This namespace provides several functions for working with files. In this article we’ll take a look at some more functions and rate their usefulness based on how well they compare with the related NET Framework functions and if they bring any expanded or well wrapped functionality.

DirectoryExists

First let’s take a look at DirectoryExists:
.
.
.

My.Computer.FileSystem.DirectoryExists(FolderToCheck)

This function simply returns if a target directory exists or not. It is exactly the same as this System.IO function:

System.IO.Directory.Exists(FolderToCheck)

Since this wrapper doesn’t bring anything new to the table, I’ll have to give it 2 out of 5.

FileExists

Our next function is also an exact duplicate of the related System.IO function

        My.Computer.FileSystem.FileExists(FileToCheck)

        System.IO.File.Exists(FileToCheck)

Just like DirectoryExists, it doesn’t add anything new so I’ll rate it 2 out of 5 also.

FindInFiles

Unlike our previous functions, our next one, FindInFiles, is quite useful. It searches a target folder and returns a read-only collection of strings that contains the matching files. Here’s an example of each overload:

Dim ListOfMatches As ObjectModel.ReadOnlyCollection(Of String) = _
                  My.Computer.FileSystem.FindInFiles(FolderToSearch, TextToSearch, _
                  True, FileIO.SearchOption.SearchTopLevelOnly)

Dim ListOfMatches As ObjectModel.ReadOnlyCollection(Of String) = _
                  My.Computer.FileSystem.FindInFiles(FolderToSearch, TextToSearch, _
                  True, FileIO.SearchOption.SearchTopLevelOnly, _
                  New String() {"s*.txt", "t*.txt"})

.

The search that this function wraps up is very powerful. Beyond just the directory, you also can specify the text to search for and to ignore the case of this text or not. Plus you can specify to search just the top level directory or the target directory and its sub-directories. The second overload also allows you to specify not only a single wildcard value but multiple wildcard values for a very powerful search.

Finally, the results come back in a type safe, read-only, string collection that’s very easy to work with. For example, if you wanted to load the list into a Listbox, you could do the following:

Dim FoundFiles(ListOfMatches.Count - 1) As String
ListOfMatches.CopyTo(FoundFiles, 0)
ListBox1.Items.AddRange(FoundFiles)

Since this function provides features above and beyond the related System.IO.Directory.GetFiles function with its ability to search the text of target files and wildcard support, I’ll have to give it a 5 out of 5 rating.

GetDirectories

GetDirectories is similar to FindInFiles in that it searches a folder for matching directories, can recurse into subfolders, and can perform wildcard searches. Here is an example of the each overload:

ListOfMatches = My.Computer.FileSystem.GetDirectories(FolderToSearch)

ListOfMatches = My.Computer.FileSystem.GetDirectories(FolderToSearch, _
                FileIO.SearchOption.SearchAllSubDirectories, _
                New String() {"a*", "b*", "c*"})

.

The System.IO.Directory.GetDirectories is very similar to this function but there is one key difference. The System.IO function doesn’t allow multiple wildcards like this function, only a single string. This can be quite helpful if you’re needing to search a large directory structure for several different directories. Other than this, it is largely redundant so using this function vs. the System.IO function is dependant on your particular needs.

Because this function has an added value to it in one of its overloads, I’ll give it a 4 out of 5.

I’ll be covering more functions from My.Computer.FileSystem soon. Please leave me a comment if your rating of these functions is different from mine.

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

1 comment July 26th, 2007

Marine Corps Leadership Secrets - Part I

USMCThe United States Marine Corps prides itself on many things. One of these is the leadership training it provides to its NCO’s (non-commissioned officers) and commissioned officers. As a software development team lead, what can you borrow from their training to use in your daily activities? How might life and death battlefield leadership methods be of use in a corporate environment? In this series of articles I’ll be discussing the USMC’s leadership traits and principles that I was taught many years ago and how to apply them to your team leadership position.

Integrity

In this context, integrity means honesty, that you mean what you say and that members of your team know that about you. If you lie to them, they will discover it and they won’t trust you at your word again. When you’re talking to your team let them know if you’re giving them a fact or your opinion. Don’t make them guess about it. Also bear in mind that even off-hand statements may be taken as fact by your team so use care in what you say about sensitive topics.

There may be times when you have information you aren’t allowed to pass on to the team. Part of your integrity is keeping confidential things confidential. If you run into a situation like this where team members are asking for information you aren’t allowed to pass on, tactfully decline to answer the question.

Likewise, also show integrity in your dealings with managers above you. Don’t lie to them, because, once again, the lie will come out. Give them the straight facts as you know them and ask for the same from them.

What you should strive for is to be known as a person of their word, someone who can be trusted by both those above and below you within the organization.

Knowledge

Part of your job is to know the tools you’re using. In whatever language you’re developing in, you should not only know it well but you should also know where to find answers to the questions you don’t know. You should be a mentor to the junior members of your team and guide them into best practices and techniques. If you don’t know an answer, admit it and then find it out. Don’t try to bluff your way through. Your team will spot it and this will damage your respect and authority within the team.

Also, knowledge also applies to knowledge of your team. You should know the strengths and weaknesses of each team member. If you don’t know this you will run into problems. People aren’t cogs that you can stick just anywhere and get the best performance. Know how to get the best performance out of each team member.

Courage

While it is unlikely that you would have to demonstrate physical courage in your normal corporate environment, you will probably have multiple opportunities to exhibit moral courage. By moral courage, I mean knowing what is right and standing up for it.

Often this may mean standing up for yourself or a subordinate in a tough situation. For example, if your boss is a office bully it may mean calling them on their antics. If your manager is doing something illegal or violating company policies, it may mean dealing with that in a proper way. If a human resources policy is misguided, it may mean challenging them on it. Standing up for what’s right might cost you your job but the alternative is often much worse.

Another aspect of moral courage is having the courage to admit you were wrong not only to your team but to your management as well. Everybody makes mistakes from time to time. The trick is to not keep making the same mistakes over and over again. Instead, learn from your mistakes. It also means having the courage not to pass the buck or blame your team for the failure. A good team leader fixes the problem, they don’t fix the blame.

Here are the other parts of this series:

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

7 comments July 25th, 2007

My.Computer.FileSystem Shortcuts for VB.NET - Part I

My.Computer.FileSystem ShortcutsThe My.Computer.FileSystem Namespace provides several ’speed dials’ for working with files. In this article we’ll take a look at some of them and see where they’re useful, where they’re redundant with existing .NET Framework functions and where they’re troublesome. Also, I’ll provide my rating for each function.

CombinePath

First, let’s take a look at CombinePath. This function takes two path parts and combines them into a single, well formatted, path string. Here’s an example using a path and file name :

NewPath = My.Computer.FileSystem.CombinePath("c:\docs\customers\", "smith.doc")

This looks rather redundant with String.Concat at first glance. However, it does add a little extra functionality in some cases. For example, if a path contains heading periods or extra or lacking backslashes the function will take care of this. But it also has it’s quirks, as seen here:

NewPath = My.Computer.FileSystem.CombinePath("c:\docs\customers\", "\smith\smith2.doc")

.

This returns

C:\smith\smith2.doc

and not

c:\docs\customers\smith\smith2.doc

Like you might expect. However, if you were to have a leading period or periods on the second string the result would be the second one. Things get even more quirky when you add network URI’s into the mix.

I give this function 2 out of 5 due to its quirky nature and that using a regular String.Concat will produce more predictable results with less chance for an exception.

CopyDirectory

The second function we’ll take a look at is CopyDirectory. This function copies a directory and its contents from a source location to a target location and has overloads to overwrite and to provide a UI. Here’s an example of each usage:

My.Computer.FileSystem.CopyDirectory(sourcePath,targetPath)

My.Computer.FileSystem.CopyDirectory(sourcePath, targetPath, True)

My.Computer.FileSystem.CopyDirectory(sourcePath, targetPath, _
                                                     Microsoft.VisualBasic.FileIO.UIOption.AllDialogs) _
                                                     My.Computer.FileSystem.CopyDirectory(sourcePath, targetPath, _
                                                     Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, _
                                                     FileIO.UICancelOption.ThrowException)

.

This function is quite handy since it combines several copying functions from System.IO into a single function. The option to overwrite or not overwrite is also quite useful. My only complaint about this function is the UI options since they don’t provide an easy way to insert your own dialog(s) into the mix.

I give this function a 4 out of 5 since it is a work saver although it could be better.

CopyFile

Now let’s take a look at the CopyFile function. This function simply copies a file from one place to another and has options to overwrite and to show UI just like the CopyDirectory function. Here are the examples:

My.Computer.FileSystem.CopyFile(sourceFile, targetFile, )

My.Computer.FileSystem.CopyFile(sourceFile, targetFile, True)

My.Computer.FileSystem.CopyFile(sourceFile, targetFile, _
                                              Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs)

My.Computer.FileSystem.CopyFile(sourceFile, targetFile, _
                                              Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, _
                                              FileIO.UICancelOption.ThrowException)

.

This function, unlike CopyDirectory, is rather redundant with the System.IO.File.Copy function. This limits it’s usefulness to times when you want to have the UI visible. Otherwise, it’s usually better just to use the System.IO.File method. One thing to remember about either method is that the file permissions are copied over with the file so make sure you take this into account.

I give this function 3 out of 5 since it’s largely redundant with a .NET Framework function.

CreateDirectory

Next on our list for today is CreateDirectory. Obviously this function creates a directory, like so:

My.Computer.FileSystem.CreateDirectory("c:\docs\jones")

Like CopyFile, this function is also redundant with a System.IO function but, even worse, it’s not as functional as the Framework version. System.IO.Directory.CreateDirectory also has an overload that allows you to set access control for the newly created folder.

In this case, this function isn’t much of a speed dial so I’ll give it 2 out of 5.

DeleteDirectory

The last function for this part is DeleteDirectory, which, of course, is used to delete a directory. Unlike the copy functions above it does offer features above and beyond its System.IO counterpart, System.IO.Directory.Delete. Here are what it’s various overloads look like:

My.Computer.FileSystem.DeleteDirectory("c:\docs\jones", _
                                                       FileIO.DeleteDirectoryOption.ThrowIfDirectoryNonEmpty)

My.Computer.FileSystem.DeleteDirectory("c:\docs\jones", _
                                                       Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, _
                                                       FileIO.RecycleOption.DeletePermanently)

My.Computer.FileSystem.DeleteDirectory("c:\docs\jones", _
                                                       Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, _
                                                       FileIO.RecycleOption.DeletePermanently, _
                                                       FileIO.UICancelOption.DoNothing)

.

As you can see, you can’t simply enter the folder name, you have to specify if you want to delete all contents or throw an exception if the directory isn’t empty. In the other overloads you can also chose to show the UI and to decide if the deleted contents should be deleted permenantly or sent to the recycle bin. It would have been nice if they had combined these options a little better where you could have had the UI and recycle options along with the content option.

On this one, I’ll give it 3.5 out of 5 because the extensions to the base System.IO functionality, while decent and relatively useful, aren’t that big of a functionality boost.

I’ll be publishing more on this series in the next few days. Please leave me a comment if your rating of these functions is different from mine.

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

3 comments July 25th, 2007

Next Posts Previous Posts


Visit Me At My New Site, Programming In C#

Most Popular Articles

Highest Rated Articles

Categories

Most Recent Articles

Feeds

 Subscribe in a reader

To subscribe by e-mail
Enter your address here

Delivered by FeedBurner

VB Opportunities

Archives