Software Development
Blogs and Discussion
developer.*
Books Articles Blogs Subscribe d.* Gear About Home

Thoughts on using C#

Pretty straightforward for me to change from VB. I am still using utilities.DLL (a large library of tools in VB.Net which is available as part of the Build Your Own download) and I have a few problems when utilities.DLL routines use VB Optional parameters.

I am planning to rewrite all necessary routines in utilities.DLL in C#.

Optional params are not, of course, supported in C# and are in general a nonstandard practice, not recommended for .Net general coding. I downplayed my use of Optional parameters after the .Net Beta but some of the routines predate 2000 and in C#, you MUST enter all the optional parameters.

Conformant to my transition to C#, I have simplified my commenting style. The BYO code uses a rather old style I first saw in the best code for IBM mainframes including magnificent "boxes" of comments which had, and to an extent still have, the virtue that they send the message, that "this is important information over which I have labored, and I have ceremoniously punched 72 asterisks on a card to tell you this".

This practice is of course of deep antiquity but should not be dismissed. In ancient China, important messages from the Emperor were sealed with a vermilion seal and when read out loud, suffixed with something like "respect this!".

This practice survives in modern China, and it is some protection against forgery. Every professional in China, it seems, has his name in Chinese characters made into his "chops" or seal. I have one of these myself.

But it has been pointed out that ceremonious commenting, rows of asterisks and so on, are hard to maintain. Of course, comments should be what and not how; they should not parrot code but instead explain the *telos* of the code, its purpose.

The purpose of the ceremony for me was to show the telos and to communicate the importance of coding considered as a ceremony.

Oh well, one of the great tragedies in life is the maintenance of beautiful code by ham-fisted people who hate comments...

I have for these tragic reasons decided when using C# to simplify my ceremonious comments, and never use two-dimensional designs to box or display C# code.

Instead, I shall use XML tags.

A researcher at Sun has pointed out that when a source language is automatically translated to another source language, it becomes nearly impossible to reposition comments so they have the same meaning, and two-dimensional structures are effectively impossible to parse as such, meaning that the translation of a comment box (which relies on the use of a monospace font for its display as anything other than a complete mess) will mess it up.

One could of course build a parser to recognize two dimensional comment structures but would that be worth it?

I also plan to stop being anal about indentation and instead be content with the decision of the C# editor as to the proper formatting of multiline statements (I'll add one tab to the lines after the first) in part because (perhaps some of my ancestors set type for a living) I have driven myself crazy in VB formatting code by pushing blanks around.

I have no apologies for the VB praxis. In C# you don't have to be as anal because the syntax is modern and friendlier, somewhat, to the eye and brain. C family languages aren't perfect (see my next blog post) but their syntax is more transparent than that of VB.

Recent comments

User login

About our advertising.

Atom Feed

developer.* Blogs also has an Atom feed, located at this url.

Click here for more information about Atom.

A Jolt Award Finalist
Software Creativity 2.0
Foreword by Tom DeMarco

Recent Posters

Based on most recent 60 days, sorted by # of posts and name.

Google
Web developer.*

Who's online

There are currently 0 users and 15 guests online.

Syndicate

Syndicate content
All views expressed by authors, bloggers, and commentors are their own and do not necessarily reflect the views of developer.* or its proprietors.
Click to read the Copyright Notice.

All content copyright ©2000-2005 by the individual specified authors (and where not specified, copyright by Read Media, LLC). Reprint or redistribute only with written permission from the author and/or developer.*.

www.developerdotstar.com