3 Tips & tricks for Kickass Developers in 2019

0

Hi,

For those looking for new ways to kick off 2019 with a bang with your .NET skills, keep on reading 🙂

1. Leverage more LINQ in your C# code

Lately, functional programming has been a really hot and trending topic. C# is becoming more of a functional programming language to stay on par with the industry trends and one of the feature that it provides to developers since .NET 3.5 (2007). It’s been then for over a decade and truly makes your code more readable.

With LINQ, you can express directly your intent when iterating through your collection instead of using a looping construct. When looking at a Where statement, immediately developers will understand that your statement is meant to filter data as opposed to writing the equivalent code in a loop, you need to look inside the loop to understand what’s going on.

2. Document your code as you type it

Something I’ve witness so much in 2018 was the lack of documentation in code. And let me tell you, 3 to 6 months after writing your own code, if you don’t maintain it for a while and it is poorly documented or even, not documented at all because you think you will remember, that’s wrong.

Writing documentation for your code shows deep understanding of your product and respect for next people in charge of maintaining the code and adding more features to it. When you need to do a knowledge transfer, it’ll be a breeze because the documentation is already there to back everything you have built from the ground up. More to the fact, if only you touch that code, you will be thankful for helpful documentation whenever a bug hits the system and you’re responsible to go through those lines and figure out where that nasty logical bug is hiding and finding a way to get rid of it.

3. Write your methods side-effects free when possible

Your code should not have the need to create side-effect. From a certain point of view, your code should strive to always generate the same output with the same input. What does that mean? It means that let’s say you create a method to increment a counter every time you click on a button in a user interface, you have in fact a mutable state that’s based on user input. So from the first time I click on button to the 100th time I click on it, I shall never have the same output since the state keeps being updated.

I’m not saying to never write mutable code. That’s not what I’m trying to share as a tip. Mutability is unavoidable, but it can be contained and isolated. Most of your code can be pure, as in stateless. You can make sure to have readonly fields and properties. You can also provide APIs that give you solely readonly collections that you can’t update. Instead of updating a meaningless field in your class that’s used only in a single method of said class, simply make it a local variable of a method and update it there. From the client’s perspective, if your method has within itself mutability, but the same input generates the same output, you’re golden 🙂

 

Kevin out.

Advertisements

Integrated Development Environment (IDE)

0

I can assure you, this is the last post I’m writting before you’ll finally be able to dive into programming. On the plus side, this post is meant to help you with coding. To be able to program any software, a programmer needs an integrated development environment (IDE).

Before, .NET applications were only able to be used on the Windows operating system. But since a great event that happened a few days ago, .NET became an open source project! Hearing this was a source of great joy for us, .NET developers. This means that now you’re not force to have the Windows operating system on your machine, you can now have it on either Linux or Mac OS X.

You have a great selection of IDE to create a software using .NET. Below, you’ll be able to find a small list of IDEs you could use.

  • Visual Studio
  • Xamarin
  • ReSharper
  • SharpDevelop

For my case, I’ll be mostly using Visual Studio, the Community Edition. Some IDEs can be expensive to buy, but this edition is not only free, but gives you the ability to create various kind of apps like :

  • Video games
  • Mobile application
  • Web application

You’ll be able to find the Visual Studio Community Edition here : http://www.visualstudio.com/news/vs2013-community-vs.  Now, we are all set to be able to create awesome stuff!

Kevin