X

C#

Reading process output

Here is my little example about how to catch run console program and catch the output. I used similar code to read the output of OpenSLL.

Refactoring: extract interface

Extract interface is one of the most common refactoring techniques. Motivation behindextract interface refactoring method is to avoid direct dependencies between classes. Instead of using classes in method calls we use interfaces so we can also use subclasses of those classes we used before. Also we can create brand new classes that use follow these interfaces and we can use these classes instead of current ones.

Some notes about custom C# application and Exchange Server 2003 integration

Custom C# application and Exchange Server 2003 integration over WebDAV was one of the tasks I lately worked on. I made posting about how to log on to Outlook Web Access when FBA is used but I didn’t mentioned that I had to read data from Exchange public folders. There are some stuff that may drive you nuts but there are also some tricks to use to get everything work as expected.

Refactoring: Rename method

One of the simplest refactoring methods is called Rename method. There are many reasons why one may want to change the name of some method. I think that main reason to rename a method is to give it a name that describes better what method is supposed to do.

Refactoring: introduce constant

One way to write messy code is to use constant values in code without any explanations about their values or purpose. Sometimes it feels like too small problem to think about, specially when there are only couple of constants, but I am sure that hard coded constants may waste developers valuable time more than one may think at first place. To make this kind of code easier to read and understand we can use refactoring method called introduce constant.

EnumHelper class

Some time ago I wrote blog posting Extension method for enumerators where I showed how to use extension methods to make using of enumerators more convenient. Today I found very interesting posting from Grant Barrington blog where he describes the class called EnumHelper.

Refactoring: delete unneeded code

It is not a miracle that during coding developers produce code that is later not needed anymore. It is also not a miracle that unneeded code will stay in project files waiting for the day when somebody finds this code useful (again). But this far this code is just sitting there and causing problems to people who look at these modules first time.

Refactoring: expose static method

You may discover sometimes that some of your classes have method you would like to use without creating new instance of that class. In this case we have to use expose static method refactoring to make this method static.

Refactoring: Extract method

Extract method is one of the most popular refactoring method when dealing with legacy code. In legacy code we can often find methods that are very long. My favorite findings methods about 2000 lines of code. Cool, isn’t it? Those methods have usually many responsibilities and they are hard to debug. Having more than one responsibility in one method leads also to duplicated code because some responsibility is required in more than one place in code.

ForEach method and blonde me

I want to tell you about List.ForEach method and one of my famous blonde moments when I was debugging faulty code. LINQ makes it easy to query collections and that's why I like it a lot. Today is friday and weekend is coming. Let's relax and have some fun on me. Here's one proof how n00b I can be :)