C# blues
April 16, 2008 | 6:24 pmI have this hate-hate relationship with C# - I can’t go out and proclaim that I hate C#, ‘coz people mistake me for a Linux Zealot then. So, I usually list C# when people ask me what languages I know, but "never" use it out of choice. I always prefer VB, and with VB9, it’s got some kickass XML features that eat C#’s lunch, Dinner, and next day’s breakfast as well
One thing that does drive me crazy is people accusing VB of being "verbose", while C# is "clean". Here’s some code I’m writing:
PID = dataReader["PID"].ToString() ;
UID = dataReader["UID"].ToString() ;
Title = dataReader["TITLE"].ToString() ;
Description = dataReader["DESCRIPTION"].ToString() ;
Views = int.Parse(dataReader["VIEWS"].ToString()) ;
Favs = int.Parse(dataReader["FAVS"].ToString());
Notes = int.Parse(dataReader["NOTES"].ToString());
Comments = int.Parse(dataReader["COMMENTS"].ToString());
SmallURL = dataReader["SMALLURL"].ToString() ;
MediumURL = dataReader["MEDIUMURL"].ToString() ;
LargeURL = dataReader["LARGEURL"].ToString() ;
PhotoURL = dataReader["PHOTOURL"].ToString() ;
TakenOn = new DateTime(int.Parse(dataReader["TAKENON"].ToString()));
PostedOn = new DateTime(int.Parse(dataReader["POSTEDON"].ToString()));
MadeExploreOn = new DateTime(int.Parse(dataReader["MADEEXPLOREON"].ToString()));
CanDownload = bool.Parse(CanDownload.ToString());
This is C# 2.0, ‘coz I’m writing this to run on Mono, and I don’t want to depend on unsupported features, and their VB compiler ain’t exactly world class right now. If this mess is called "clean", then thank-you-very-much-I’ll-have-my-verbose-VB9-and-eat-your-lunch
Maybe some people prefer this. Maybe I’m doing something wrong here. I still prefer the VB (and Ruby (and Python)) approach of writing for people rather than for computers.






