Monday, January 18, 2021

Clean Code et bonne pratiques en général

 

Règles générales concernant la longueur des classes et méthodes

  1. Les méthodes devraient avoir au plus 20 lignes

  2. Les classes devraient avoir au plus 200 lignes

  3. Une classe devrait contenir au plus 10 méthodes

  4. Plus les méthodes et les classes sont grandes, moins elles sont réutilisables   

    Principe de proximité

    • Regrouper ensemble une méthode publique avec ses méthodes privées

      • Permet de lire le fichier comme un journal : Grand titre = méthode publique, sous-titres = méthodes privées, etc.
      • Éviter les régions

        • Moyen artificiel d'organiser les fichiers
        • Dissimulent la véritable longueur d'un fichier et sa complexité
        • Ne valent pas mieux que les commentaires si on les compare au code auto-documenté


Créer une branche de feature dans Visual Studio et Azure DevOps

Sur Visual Studio

  1. Basculer sur la branche master.

    • S'il y a des modifications dans la branche courante, il faudra les valider (commit) ou les annuler (undo) avant de basculer sur master.
  2. Tirer la dernière version de la branche master.

    image.png

  3. Créer une nouvelle branche à partir de la branche master locale et la nommer selon la règle de nomenclature.

    image.png

Sur Azure DevOps

  1. Sélectionner New Branch à partir de la branche master.

    image.png

  2. Nommer la branche selon la règle de nomenclature.

    image.png

  3. Tirer la nouvelle branche sur Visual Studio

    • S'il y a des modifications dans la branche courante, il faudra les valider (commit) ou les annuler (undo) avant de tirer la nouvelle branche.

    • Récupérer la liste de branches distantes à partir du serveur (fetch).

      image.png

    • Basculer vers la nouvelle branche en faisant un double clique sur son nom. La branche sera automatiquement tirée.

      image.png

Thursday, December 17, 2020

Check your C# in Visual Studio

Steps to check your version of C# in your Visual Studio projet.


  1. Right click on the project name and select Properties from context menu
  2. Select Build tab from left
  3. Scroll down and click Advanced button to open advanced build settings
  4. From Language version dropdown select C# version you are interested in


Tuesday, October 27, 2020

39

Here I am 39, one more cucke and more year and one year less. SHOULD always make it count wether is enjoying nature, working on a project or simply by spending time with good friends a d family that appreciate you, is the way enjoy the ride of life which could end in any moment. Stay in the moment.

Thursday, October 22, 2020

Old classic casting in C#

The classic difference between int.Parse(), Convert.ToInt32() and int.TryParse().

int.Parse(string s)

Simply, int.Parse (string s) method converts the string to integer. If string s is null, then it will throw ArgumentNullException. If string s is other than integer value, then it will throw FormatException. If string s represents out of integer ranges, then it will throw OverflowException

 

Convert.ToInt32(string s)

 Simply, Convert.ToInt32(string s) method converts the string to integer. If string s is null, then it will return 0 rather than throw ArgumentNullException. 

 If string s is other than integer value, then it will throw FormatException. If string s represents out of integer ranges, then it will throw OverflowException.

 

Int.TryParse(string s,Out)

Simply int.TryParse(string s,out int) method converts the string to integer out variable and returns true if successfully parsed, otherwise false. If string s is null, then the out variable has 0 rather than throw ArgumentNullException. If string s is other than integer value, then the out variable will have 0 rather than FormatException. If string s represents out of integer ranges, then the out variable will have 0 rather than throw OverflowException.

Tuesday, September 8, 2020

lost of sites for programmers


I have listed some websites that I follow for coding tips and programming techniques, hopefully this will serve me as a quick link sheet.


https://billthelizard.blogspot.com

Friday, August 7, 2020

.NET Conf 2020.

Here are some notes on the Microsoft .NET Conf.


Here the link of the event: https://focus.dotnetconf.net/


Here the full list of youtube videos: 

youtube videos on .net conf


Some microservices tutorials:

https://dotnet.microsoft.com/learn/aspnet/microservice-tutorial/intro






ref for videos: 

https://www.youtube.com/playlist?list=PLdo4fOcmZ0oUc2ShrReCS7KoBbPEONE0p




Monday, July 27, 2020

on iA as a developer and the some cool tools.

I started this year as a software developper for Morneau Shepell. Good company with some flaws like everywhere but with a good work environnement.

Now after 5 months as a software dev for Industrielle Alliance I realize that not everything that shines is gold. Good things in this new position but also many small details that I do not necessarily like.



I had to understand how this teams uses Kanban and agile with a team who is still working on his mission** and the scope of their tasks.


**



Anyways here some cool features:



- Azure DevOps: This is of course the widely used tool for agile teams with Microsoft.



- Microsoft Whiteboard. I like this tool, very creative.


- Classic Teams, Microsoft Teams. I say classic with reserve cause Teams is a recent tool added to the office Microsoft toolbox.




- Workday. Great RH tool, user friendly.



There are a few more tools  but these were the ones I got more use of in my daily tasks.


And here some Agile notes that got me thinking on a certain point.