Code

A few performance tests for .NET value types.

I've been using the Visual Studio 2008 beta for a while now, and recently I discovered the built in support for unit testing. It's pretty slick, well integrated, and soon I found myself using it to answer some performance questions that had been lingering for some time related to how to best pass large value types around in C#. In my case, I'm interested in Matrix3D, a struct with a 4x4 matrix for a total of 16 doubles in it weighing in at 128 bytes. That's quite a chunk of data to pass in as a parameter to a function or to copy from the stack as a return value. Because I have so much code that depends on passing matrices and other large value types around, I decided to use the new unit testing features to try to measure which approach would produce the best performance. This is what I found out.

Useful books for a programmer looking to learn C#

A while back I took it upon myself to learn C# and also to update my understanding of the best way to do UI programming with Windows. In the process of my research I found several books that I found very helpful. The books listed below cover a range of topics that helped me get closer to my goals. None of these are to be considered beginner books, however an experienced C++ programmer might find themselves breezing through an occasional chapter due to the similarity that some of the concepts have to C++. This was bound to happen given that C# draws so much from C++.

Avoiding security exceptions when running .NET applications from a shared drive

Something I had noticed a while ago but had never found the time to investigate the cause was why running .NET applications form a shared drive would cause the program to crash. If the same program were copied to a local drive, the program would run just fine.

Chungarian notation for C/C++

  1. Introduction

    This document describes a code style that is my preferred variation of what is commonly referred to as the "Hungarian" code style that has been widely used over the years with C and C++. The goal of this document is to provide a specification for people who wish to use this style of coding but, like myself, were unable to find a suitable reference to follow that was consistent and complete. Like most things, I'd like to spend more time on this but it's current state it is at least “mostly there”. I will add more details and examples in the future as time & interest permits.

The lost printouts of ancient code

I have found the ancient printouts of Trissaighty! Well, they were never really lost. Just never scanned. Sort of like old photos, these bits of code had been sitting in an ancient peechee folder since the early 80's undisturbed once I stopped using the TRS-80. I have been lugging them around with my Star Wars cards and train set as part of the small collection of mementos I have actually managed to hang onto despite all the moves over the years. The printouts were made using a 4-color pen printer that printed on a spool of paper 4 inches wide. When it printed, it would have this little rotating chamber of pens that it would spin to get the correct color in contact with the paper. Pretty high tech, everyone was impressed when they saw it because most printers at the time were about the size of a piano. Cassette drives were the only way I had to store my programs and so a printer was highly valuable in making sure I'd be able to recover my lost work. Good thing too because it's been a while since I've loaded up data from a cassette!

Office 2007 services can be a useful API to developers

I'm not usually one to get terribly excited about Microsoft Office (and that's an understatement), however the next update to this suite of applications is perhaps the most significant one ever. I think it may have the potential to affect developers who may not have expected Office to provide any functional benefits to the application development process. While there are many new features, far too many to list and I am sure there are more than I realize, there is one change that has the potential to have a significant impact to developers. Specifically, the Office applications are no longer just client applications. As I understand it, the Office applications are now capable of providing services, much like a web server or other back end application where there is no visible user interface and instead provides support services for other applications that build upon the functionality. Of course, the applications continue to provide all the features you expect from a client standpoint when used in that manner - you can still edit documents, spreadsheets and so forth just like you always have. However, with the new services features, it now becomes possible for developers to programmatically take advantage of all the abilities of the Office applications in the context of a UI-free server application. This is a fundamental change in the way office applications can be used; by separating the user interface of the client from the logic of the underlying application services, the office applications can now provide their functionality as an API to any managed code application.

Syndicate content