Is code quality important to your team? It should be at the top of the list, not only to make your customers happy, but make your team happier when bugs arise and when features need to be added. Putting quality in your code in the future is a lot more expensive than doing it when … Continue reading Is Quality Part of Open-Source Projects Your App Is Using?
Tag: Tip of the Week
Defensive Programming – Let Type Checking Work for You
Since I have been a speaker and a teacher, I have always stressed the importance of practicing proper object-oriented programming (OOP) techniques. If you don’t practice OOP, no matter what language you are using, I guarantee you will end up with a “house of cards” and they all eventually fall. The first “pillar” of OOP … Continue reading Defensive Programming – Let Type Checking Work for You
Collection Performance: SortedDictionary vs Dictionary
For the update of this article (for .NET), I researched how developers are sorting a Dictionary and then show the differences when compared to the SortedDictionary.
Make Encapsulation Easy with dotNetTips.Utility
Encapsulation is the first pillar of Object-Oriented Programming (OOP), yet most code that I see does not implement encapsulation correctly or not all. Like I say in many of my conference sessions "If you do not implement encapsulation, you aren't doing OOP!" I also say "Bad data in, bad data out!".Several years ago, Microsoft Labs … Continue reading Make Encapsulation Easy with dotNetTips.Utility
Properly Implementing the Singleton Pattern
One of the popular coding patterns is called Singleton. I use it currently in my dotNetTips Dev Utility for the configuration object. The pattern is defined: In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is … Continue reading Properly Implementing the Singleton Pattern
Getting Unit Tests Created with IntelliTest Working On VSTS
While evaluating Visual Studio Test Services to build, test and deploy our projects for the company I work for, ran into an issue with running unit tests created with IntelliTests. Simply, the test project would not build due to the PEX engine DLL's not being installed on the images VSTS uses. I contacted support and … Continue reading Getting Unit Tests Created with IntelliTest Working On VSTS
.NET Framework => Core: LINQ AsParallel
In the .NET Framework, if we wanted to process a loop on multiple cores, we simply added AsParallell to the end of the collection as seen below: var files = new List(); foreach (var directory in directories.AsParallel()) { if (directory.Exists) { var foundFiles = directory.EnumerateFiles(searchPattern, searchOption); lock (files) { … Continue reading .NET Framework => Core: LINQ AsParallel
.NET Framework => Core: Getting The App Data Folder
This is the first in my series of blog posts that will describe major changes to coding if you are trying to convert from the .NET Framework to .NET Core. First up, getting the folder the app should use to save data. In the .NET Framework it was really easy by doing the following: public … Continue reading .NET Framework => Core: Getting The App Data Folder
Check To See If Process Is Already Running
Do you need to see if a process is already running? It's pretty easy with the code below. I wrote this code for my console apps .NET back utility and .NET file cleaner utility. ''' <summary> ''' Check to see if the current app is already running. ''' </summary> ''' <returns><c>true</c> if app is not running, <c>false</c>.</returns> Public … Continue reading Check To See If Process Is Already Running
Compress Files
There are a number of ways to compress things in .NET, but I found out that only the code below works for files. I wrote the code below for my console apps .NET back utility. Imports System.IO.Compression ''' <summary> ''' Compresses the file. ''' </summary> ''' <param name="sourceFileName">Name of the source file.</param> ''' <param name="destinationFileName">Name of … Continue reading Compress Files

You must be logged in to post a comment.