Reviewing code requires to have a fresh and different view on (your colleague’s) code. You need to look for bad practices, think out of the box, follow your gut feeling, know about best and bad practices. You need to find a balance between advising about improvements and flat out rejecting code.
This Wednesday Evening Training, we had a practical overview and deep dive into code reviewing. One of our C# champions, Bart Roozendaal, showed us what we can look for specifically in code.
This evening was all about sharing experiences and opinions. There is no definite right or wrong, there are only considerations that you should make in a sensible manner. For example; there are multiple strategies to choose from when handling errors. How far do you have to go to catch errors in the code? This depends, for example, on the purpose of the program and the damage that specific errors can cause.
We did a walk through of an existing C# solution and discussed the different findings. Very educative. The code was written in C #, but that was certainly no problem for Java engineers.
During the walk through we also discussed tooling that you can use for testing your software. See the links below for some of the tools we discussed.
Thanks Bart for sharing your knowledge and experience with us!
List of tools for static code analysis: https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
This Wednesday Evening Training, we had a practical overview and deep dive into code reviewing. One of our C# champions, Bart Roozendaal, showed us what we can look for specifically in code.
What to look for when reviewing code?
You can take a look at the general structure, tidiness, common errors, code smells and easy to find things. And there is a lot of checks and examples to be found on the internet as well. But what is also important is to view your code from particular viewpoints like security, efficiency and exception handling (error handling). It is definitely worth thinking out of the (language) box when developing a software program. Especially if your code is part of a much larger whole. And that is increasingly the case nowadays.This evening was all about sharing experiences and opinions. There is no definite right or wrong, there are only considerations that you should make in a sensible manner. For example; there are multiple strategies to choose from when handling errors. How far do you have to go to catch errors in the code? This depends, for example, on the purpose of the program and the damage that specific errors can cause.
We did a walk through of an existing C# solution and discussed the different findings. Very educative. The code was written in C #, but that was certainly no problem for Java engineers.
During the walk through we also discussed tooling that you can use for testing your software. See the links below for some of the tools we discussed.
To be continued...
We will certainly organize follow-up sessions on this topic. Next time, participants are invited to bring their own code to have reviewed, or bring interesting samples found. The Wednesday Evening Trainings are all about sharing knowledge and experience and learning from each other.Thanks Bart for sharing your knowledge and experience with us!
Further reading
Do you want to read more on the topics in this post? Here are some links…List of tools for static code analysis: https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
CodeMaid - An open source Visual Studio extension to cleanup and simplify C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding: http://www.codemaid.net/
NCrunch - An automated concurrent testing tool for Visual Studio: https://www.ncrunch.net/
Live Unit Testing with Visual Studio 2017: https://docs.microsoft.com/en-us/visualstudio/test/live-unit-testing?view=vs-2017
C# Interactive Walkthrough: https://github.com/dotnet/roslyn/wiki/C%23-Interactive-Walkthrough
Past Wednesday Evening Trainings on all topics
You 'll find post of previous sessions on my blog and on LinkedIn: https://www.linkedin.com/search/results/content/?keywords=%23wednesdayeveningtraining
Work at Capgemini?
Do you want to join us? We're always looking for and well-motivated young professionals. Do you have a bachelor or master degree or extensive practical experience? Or do you have a relevant ICT / Informatics training and you have become curious about us? Please send me an email. Working for us gives you access to all Wednesday Evening Trainings!
No comments:
Post a Comment