Skills of an excellent C# .NET developer

In my opinion here are some skills of an excellent C# .NET developer, I suggest to grow and strive for excellence to become one of the such developer.

He has 50000 foot view of C# language and .NET framework features

You must master the basics of C# and .NET framework. However there is no need to learn every feature provided by the language and framework. You should know your programming language and framework basics thoroughly and be aware of all the other features. There are only 24 hours in a day to spend, and one can’t learn everything in one go. So learning should happen gradually but in time bound manner.

Have 50000 foot view and get into details as and when necessary.

That means, you should know enough where you can apply knowledge and when you need, get into details and learn the functionalities in detail later on.

For example, you do not need to master all of the functionality LINQ queries upfront, there is so much to learn. You just need to know the basics of static extension methods and basic LINQ query syntax, and then later on as and when required you can enhance your knowledge as per need basis.

He is master of the IDE

You must master Visual Studio or whatever IDE you use. This not only improves your productivity but also helps in building your reputation amongst your colleagues as a reputed developer.

Increase your productivity with following

  1. Know all the required IDE shortcuts
  2. Know all the features provided by IDE
  3. Master how to search within code and files outside of the solution
  4. Know how to use bookmarks
  5. Know how to use and apply code snippets
C# .NET developer skills : Master the IDE
C# .NET developer skills : Master the IDE

He knows how to effectively test the code

Testing is lot harder than you think. I wonder how many developers actually thoroughly test the code they themselves have written. Writing automated VSTS test cases is an art, and one must master it, either write VSTS test cases to test your code or have some test app / UI test cases to test your code. I strongly suggest to write VSTS/NUNIT test cases as we can use automated testing to test the code going forward.

As the number of arguments to API increases, so does the complexity of the API increases exponentially.

And in the busy day (tea/coffee/chitchat/news/gossips/online shopping etc.) one might not find time to write VSTS test cases (or might not be able to write them effectively) or might forget few use cases to test manually.

Consider below sample API and find out how many test cases one must cover as part of unit testing:

Refer complete sample code here

Sr. No.
Unit test cases to consider
1 num1String when empty, throws ArgumentException
2 num1String when null, throws ArgumentException
3 num2String when empty, throws ArgumentException
4 num2String when null, throws ArgumentException
5 num1String when invalid value, throws ArgumentException
6 num1String when greater than int.MaxValue, throws ArgumentException
7 num1String when less than int.MinValue, throws ArgumentException
8 num2String when invalid value, throws ArgumentException
9 num2String when greater than int.MaxValue, throws ArgumentException
10 num2String when less than int.MinValue, throws ArgumentException
11 When num1 + num2 result goes out of positive range (i.e. greater than int.MaxValue), throws OverflowException
12 When num1 + num2 result goes out of negative range (i.e. greater than int.MinValue), throws OverflowException

He knows how to add documentation in the code

Adding XML documentation comments not only helps other developers to understand your code, but also it helps you to understand your code later on when it is long forgotten. Documentation comments should be well written and easy to understand.

While adding code documentation consider below points –

  1. Any decisions should be documented and links to external/internal site and/or bug/backlog tracking system should be added for reference purpose
  2. Maintain internal code references as appropriate
  3. Document what kind of exceptions are explicitly thrown by the API
  4. Mention if there are any assumptions in the API code
  5. Explain about each parameter and validations present in the API for that parameter
  6. Provide any example code as and when necessary

Refer sample code for documentation example

He knows how to handle error and exceptions in the code

This is the area which most new developers need to excel at. I have seen that even senior developers lacking expertise in this area.

Ask below questions to yourself when writing code –

  1. Do you need argument validation in public methods of class?
  2. Find out possible permutation combinations of arguments and their inter-dependencies in class’s public methods that require complex checks. Do you need to raise any custom exception or just raising ArgumentException suffice the purpose?
  3. If your data come from file(s) or from database, then do you need any sanity checks? What will you do if sanity check fails?
  4. Do you raise .NET framework provided exceptions like Exception, FileNotFoundException, NullReferenceException that are intended to be raised only from within .NET framework?
  5. Do you need to create new custom exception or exceptions provided by .NET Framework can be reused (like InvalidOperationException, ArgumentException, ArgumentOutOfRangeException etc.)?
  6. Can you recover from any Exception that is being raised by any other external/your own code?
  7. When will you need to catch and suppress generic exception? Do you really need to suppress generic Exception?
  8. Can you just catch specific exception like ArgumentException, IOException etc. as per need?
  9. In case you have created your own custom exception, why would you care to make it serializable?

He knows how to debug the code in an effective manner

This is most needed and at times challenging skill. Debugging not only means using state of the art IDE to debug your code, it also means debugging production issues in an effective manner when no IDE is available.

I have seen people even struggling to debug code even with development environment with Visual Studio installed. Here is my suggestion to explore and know the areas for effective debugging –

  1. Master your IDE (see earlier section on this)
  2. Get to know about call stack window, thread window, immediate window, Locals window command window and the list goes on
  3. QuickWatch and other watch windows are very helpful
  4. Thoroughly know breakpoints (how to set breakpoints conditionally)
  5. Understand the power of Exception settings
  6. Know the modules window
  7. Know how to do remote debugging with Visual Studio remote debugger (msvsmon.exe)
  8. Explore System.Diagnostics namespace and find out which classes you can use for your purpose (my favorite classes are StopWatch, Process and Debugger)

Apart from dev environment below things are required for effective debugging –

  1. Understanding of the requirements in detail
  2. Understanding of the codebase on which you are working
  3. Thorough understanding of the domain you are working on
  4. Awareness about effective logging/tracing

Here are few queries to boost your thought process –

  1. You need to resolve problem at customer location and you don’t have access to customer’s PC. What will you do?
  2. In your company domain someone is facing issue with your app. You can access users PC, now what will you do?
  3. You need to fix a defect and you have full access to development environment. What will you do?

He is the master of writing log/trace statement in an effective manner

Writing trace statements in the code is fairly standard practice for on premises debugging. Probably not every project follows this, however I would recommend it nevertheless. Because none can replace it when it comes to solving problems at customer location.

See code sample for reference.

Here are some questions to ask yourself before writing trace statements in code –

  1. Should you write method arguments to trace statements? What are the pros and cons of this?
  2. How do you differentiate when to use verbose, info, warning and error logging?
  3. Where will you write logs? (in file / database or default trace listener)
  4. Will you consider hard coded strings or using resource strings for logging?
  5. Do you need date and time info into log?
  6. Should you use .NET framework provided diagnostic Trace API’s or any other logging framework such as log4net?

He is master of designing class, interface API’s for other developers to use

Defining interface, class and their properties and methods with proper name is important. Other developers who will use these should be able to easily guess/understand the purpose.

This can be only achieved by practice. Few questions to ask yourself –

  1. Which names you will choose for class, interface, properties and method names? Can they resonate the intentions clearly?
  2. Do you apply SOLID principles while designing the API’s?
  3. Do you enforce SOLID principles by design?
  4. No design is perfect at start. Do you refine the design as you discover new challenges?
  5. Do you do design reviews?

Here is one good book that I can recommend – “.NET framework design guidelines

He quickly understands and interprets code written by other developers

This is the most required skill nowadays, since almost every project has some form of pre-written or legacy code that needs to be maintained, to either add new requirements or to fix defects in the code.

You need to spend some time understanding existing code. Yes, there are challenges however this is the most important part.

You must understand the domain and requirements first in order to be able to understand and know codebase.

Sometimes you will need to add trace statements and sometimes just debugging the code is sufficient.

He can go to the extra mile to integrate his code with other technologies

Sometimes there is a need to integrate code written in C# / .NET into other technologies such as VC++, COM, JAVA or legacy VB6. Someone needs to do this and this requires some level of understanding of the technology in which integration needs to be done.

You must be willing to take the step forward and learn the new things to make this happen. Trust me, if you do this, you will not only feel satisfied but also grow your knowledge base; and when you grow there is progress.

He knows the build and deployment/installation environment

Get familiar with your build and deployment/installation environment. Once this is done, you should be able to solve additional issues of build/deployment/installation. And more issues you solve, more your reputation will rise.

Here are some questions to boost your thought process –

  1. Do you know how to write MSBuild scripts?
  2. Can you automate tasks with any type of scripts such as MSBuild script, batch files and Jenkins etc.?
  3. Will you learn new skills required for the build/deployment/installation?

He is master of writing multi-threaded applications

Writing multi-threaded apps is not a simple task. And once you master this, I bet you can effectively do any other type of coding that can be done in C# and .NET.

Here are some questions to boost your thought process –

  1. Why do you need thread synchronization?
  2. Do you know how to do thread synchronization?
  3. Which C# language features you can use for thread synchronization?
  4. Which classes from .NET framework are useful for thread synchronization?

He can create effective proposals

A developer’s job is not only to write code but also to writing effective proposals for various purposes such as design of an interface/class or to put forward his idea about how to cater to specific requirement.

No one is going to listen to you unless you know how to make them listen to you. Otherwise you will just drift apart and write code as per what others think a good design is.

I admit that mastering this skill is not so easy, and it will take time and a quite good amount of effort. Do whatever it takes, and master this skill.

Here are some questions to boost your thought process –

  1. Do you consider pros and cons for the design or specific way of handling the requirement?
  2. Can you write summary of the proposal?
  3. Will you add sequence diagram / flow charts in your proposals?
  4. Do you ask questions to understand requirements / design before you propose anything?
  5. How will you document proposals and their multiple versions?

 

He can do effective code reviews

Great C# .NET developer skills include doing effective code reviews of peers. Doing code reviews not only increases understanding of the code base but also improves feedback and communications skills.

 

Conclusion:

One cannot become great developer overnight, it need practice and patience and experience. To become a great C# .NET developer, you will not only need to pay attention to acquire the new Skills but also need to practice, practice and practice.

Here is my final advice – Be so good that they can’t ignore you (a book by Cal  Newport).

 

Sample code: