<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d601588505461698440', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks

Course Reflection: "Lessons from Real World .NET Code Reviews"

When I started going through the Pluralsight course "Lessons from Real World .NET Code Reviews" by Shawn Wildermuth, I thought it was a great topic and expected it to offer tangible suggestions that I could use a checklist. I'm a fan of checklists and I like the style & organization of the checklists in the Patterns & Practices book  Improving .NET Application Performance and Scalability  (published in 2004 but never updated). I felt that the two hour course started well but got preachy. I wish it was more comprehensive, focusing on coding issues that impact projects significantly rather than touching upon a few random experiences.

Key points from the course:

- A code review is a systematic way of quantifying code quality

- The job of a code review is to determine what is being done well as well as what can be done better. It is not a witch hunt.

- Look for common problems, not on-off issues

- Review 200-400 lines at a time

- Avoiding "Magic Numbers' can clarify your code and make it harder to make typing mistakes

- Avoid using the + operator to concatenate strings in all cases. Consider using String.Concat() & String.Format(). Use StringBuilder for large amounts of text.

- For unmanaged resources, using IDisposable correctly can prevent resource leaks

- Knowing how enumerations handle defaults makes you understand you always need a zero value

- Breaking up large methods into smaller methods can increase readability and maintainability

- Creating multiple layers of inheritance for it's own sake or identity is adding complexity

- Using nested classes for information hiding isn't necessary and hurts maintainability

- The Singleton pattern is useful, but static classes simplify the way to accomplish this pattern

- The less code inside a Razor file the better

- Building code frequently improves code quality.

- Write unit tests for both client-side & server-side code

Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »


Post a Comment