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

C#

Thoughts on IsDate() and Arguments as Locals

Categories:  | |

C# and VB.NET IsNumeric() and IsDate() Functions

For some reason they left IsNumeric() and IsDate() functions out of .NET. I end up needing these is almost every non-trivial project. In this post I share C# and VB.NET versions of the functions I use. Your mileage may vary depending on your performance needs; if you're calling these thousands of times in a loop, then be sure to test them against alternate techniques. (Updated in light of new native IsNumeric() and IsDate() functions in VB.NET 2.0.)

Categories:  | |

Awkward behavior of System.Collections. Generic.List. BinarySearch

I found counter-intuitive that BinarySearch (Int32, Int32, T, Generic IComparer) does not always return first occurrence of item, if there are duplicates...

Categories:  | |

Getting Down with Generics

I recently finished my first "real" Windows Forms app in .NET 2.0, and when I finally got to a "complete" working version I was ready to do some cleanup and refactoring. So, I began combing through my code, reading for things I wasn't completely satisfied with. After correcting a few "magic numbers" type issues, it so happened that Brian came by my desk. Brian is a younger colleague here, really sharp guy, great attitude--one of the ones who "gets it". And he points out that I'm using "old school" Collection classes, when I could be using Generics.

Categories:  | | |

XmlCsvReader Is My Friend

I've been busy and I've been on vacation so it's been awhile between posts. But I found a cool doodad that just saved my bacon so I wanted to post a link to it.

Categories:  | | |

The transition from Visual Basic to C#

D'oh, as my Eldest Yi Number One Son would say. I got a development laptop but delayed getting Visual Studio with MSDN because I need to better manage my finances, and I need neither toy for my six day week job as a LaoShih (teacher) in dear old Hong Kong. So I downloaded and installed Visual Basic Express. But then I asked myself, well why not get as another interim product, C Sharp Express?

Categories:  | |

Subterranean Certification Exam Prep Blues

...The upshot was, about 2 hours later, I still had to destroy most of the rainforests of Laos and Ecuador to print the damn thing out. And as far as portability goes, have you tried carrying around half a ream of loose sheets of paper lately? Fun with binder clips.

Jeffrey Richter talk on Safe Threading

I was surprised at how technically "unsafe" certain very common aspects of managed code use were under .NET Framework 1.0 and 1.1. Particularly, any kind of Interop activity in a multi-threaded environment has some potential resource leaks and even security holes.

Categories:  | | |

To Dispose or Not to Dispose ?

Dispose() is merely a convenient place for a class developer to place any resource clean-up code, in the hope that clients will call it. Dispose does not free the managed memory allocated for an object.

Categories:  | | |

Request to my readership for clarification concerning C#

OK, I can see why the designers of C# did not implement the preprocessor of C++ and C. It creates obfuscated code, and its functionality, as I learned several years ago from Number One Son, its functionality is largely replaced by objects.

For me, furthermore, it doesn't go far enough. This is because the preprocessor of PL/I was Turing complete in that you could create loops in the preprocessor and, from a logical standpoint, the preprocessor was a full "computer", allowing you to ship seriously customizable (and, seriously obfuscated) solutions.

But I find the string model of C# supports the concept of "scan for any one of a SET of characters" that is found in C strspn, but FAILS to support (as far as I can determine) the concept of "scan for any one of the COMPLEMENT of a SET of characters" as seen in strcspn.

Categories:  |

On the triviality of certain problems

One problem with a tendency to get outa hand in mixed VB.Net and C# environments is the issue of Optional parameters. In VB, Optional parameters may appear or not as in

Public Function trivialPursuit(ByVal intNeeded As Integer, Optional ByVal strOptional As String = "")

intNeeded must be specified, but strOptional may be omitted as in

trivialPursuit(intNeeded)
Categories:  | | |

I find the great VB.Net versus C# .Net debate rather tiresome

...because throughout history, second-rate intellects have proclaimed the superiority of one natural language over the other.

French is considered by the xenophobic, conservative Frenchman was considered to be more "clear and logical" than English or German. This is a language in which "personne" abbreviates "no personne" and in ordinary speech, when I say "personne n'aime Bush" I don't mean "there exists at least one person who likes Bush": I mean nobody likes Bush.

Of course, this telegraphic shorthand, while it would be ambiguous in a programming language, is perfectly acceptable in speech because (1) many personnes understand it in context and (2) the usual Gallic tonality and shrug, coupled with the Gauloise being lit communicates the meaning.

Categories:  | | |
Syndicate content

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 21 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