Browse by Tags

All Tags » .NET (RSS)

C# and checked exceptions

Ever since I was at university, I've had an interest in compilers and compiler theory. When I was in third year, we were given a course called Comparative Programming Languages by Gary Marsden , which caused me to be interested in the evaluation of programming languages as well. We looked at various programming languages and evaluated then according to various criteria. The temptation would be to evaluate them according to language features (like this website did), but we chose to evaluate them according...
Posted by trumpi | 4 comment(s)
Filed under:

Some useful C# 2.0 features

Our team has recently moved over to the .NET Framework 2.0 and I've decided to catch up on this new skill by reading the C# 2.0 specification . There are a couple of well-known features such as iterators, anonymous methods (yuck) and generics, but I noticed two small features that might have a tremendous effect on our team's productivity. The first is the new double-question-mark operator. Consider the following code snippet: object foo = bar ?? String.Empty; This piece of code will assign foo to...
Posted by trumpi | 4 comment(s)
Filed under:

Short circuits and testing for nulls

While going through some code at my new job, I came across the following line of code: if (productGroups.Count > 0 && productGroups != null ) This new job should be very interesting... Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted by trumpi | 5 comment(s)
Filed under: ,

Frustrations with CodeSmith

Many many developers have had the pleasure of playing around with a tool called CodeSmith. I certainly love what it does and have been using it since my university days. But when I went to the tool's website yesterday, I was deeply saddened to see that as from version 3.0, CodeSmith is not freeware anymore. If you look up 'sellout' in the dictionary, you might find a description that resembles the sequence of events here described. Now the freeware version of CodeSmith is quite useful for simple...
Posted by trumpi | 7 comment(s)
Filed under:

A new perspective (for me) on exception handling

I was going through my normal routine of reading other people's blog posts, and I came across a very interesting post by Julia Lerman's blog about exception handling. The post can be found here . Now I've read this perspective before, but when I thought about code that I've written recently, I reckon I haven't applied the perspectives that she advocates. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted by trumpi | 3 comment(s)
Filed under:

SharpPDF

This will probably be my shortest post ever. For a while now, I've been looking for a decent PDF library for .NET. Now I think that I've found one in SharpPDF . Here is the code that is needed to create a Hello World PDF document: sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Hello World TTF Application", "Me", false ); sharpPDF.pdfPage myPage = myDoc.addPage(sharpPDF.Enumerators.predefinedPageSize.csA4Page); myDoc.addTrueTypeFont(@"c:\Fonts\arial.ttf","arial"); myPage.addText("Hello World...
Posted by trumpi | 6 comment(s)
Filed under:

NTeam

I don't know how I came across this, but I've found an open source project that is emulating the Microsoft Visual Studio Team System , or so it would seem. The name of the project is NTeam . It is still in the fledgling stages, but already there are 30 developers who are keen to get cracking at it (and counting). I'm quite interested to see how this turns out. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted by trumpi | 1 comment(s)
Filed under:

Performance Testing

I've been asked recently to conduct performance testing on one of the software products that we are developing. This is virgin territory for me and naturally I turned to Google for help. One of the products that I found is a tool called NTime . NTime works in much the same way as NUnit , but instead of failing because of failed assertions or exceptions, it fails because the test did not run within a specified time. As far as I can see, the only use of this is where there are explicit performance...
Posted by trumpi | with no comments
Filed under: