Monday, March 21, 2005
« Hilarious Tech Ed promo videos - check '... | Main | More on Avalon/XAML »

As I’ve mentioned before, I personally like using VB. I tolerate, and have become quite competent in, C#.

 

But the current situation is frustrating.

 

I am speaking at an event in a couple months, and the organizers requested that all code samples be in both VB and C#. On one hand this makes sense, but I must say that it means I’ll likely have half the demos I’d otherwise use.

 

Porting VB to C# or visa versa is boring work. It is time wasted redoing something that’s already done. And I don’t do it. I already have more cool ideas than I have time to try out, and wasting time adding or removing semicolons from my last cool experiment merely cuts into time when I could be doing something interesting.

 

The sole exception to this is CSLA .NET. In that case I have chosen to maintain two identical versions of the code. It is painful and frustrating, but important. The most frustrating part of it though, is that I have numerous enhancements to CSLA .NET that I’ll never publish to the world, because the pain involved in porting to the other language is too high.

 

From time to time people have suggested that I use a tool to convert the code. But I opted specifically against that option with CSLA .NET because I wanted the VB code to look like VB and the C# code to look like C#. Code conversion tools don’t capture the subtle stylistic differences between languages, and I consider those differences to be important.

 

You can always tell VB code that came from such a tool. It looks like crap, and no self-respecting VB developer would ever write such poor code. Likewise, I have no doubt that comparable C# code would be equally offensive.

 

Since the code I’m talking about here is intended to teach programming concepts, the quality and style of the code is even more important than normal. Thus I just can’t see how using tools of this nature is good.

 

Perhaps we’ll find out. If I can find a good VB->C# converter maybe I’ll convert some of my demos for this upcoming event and see if the C# attendees howl… (and visa versa)

 

But I can’t say I’m going to invest a huge amount of time figuring it out, because I’ve got some other cool ideas I’m working on and can’t afford the distraction.

Monday, March 21, 2005 1:35:39 PM (Central Standard Time, UTC-06:00)
Why don't you write the code in one langauge, and use a converter on the assembly to have crappy code in BOTH VB .NET and C#? :P
Monday, March 21, 2005 1:42:39 PM (Central Standard Time, UTC-06:00)
I understand having samples in both languages is nice to have but I'm supprised this is required anymore. Especially when talking about VB.NET and C#, the code is so similar it seems either language would be easy enough for developers of the other language to understand.

(Hypocracy disclaimer) I'm a CSLA user who is VERY happy you provide the framework in C# as well ;-)
CaymanIslandCarpeidem
Monday, March 21, 2005 2:44:56 PM (Central Standard Time, UTC-06:00)
You are definitely correct on one aspect Rocky,

with all the work that you do, in addition to the speaking engagements, in addition to fielding random questions from people like myself,

you absolutely have better ways to spend your time than porting code back and forth through the C#/VB mirror.

Besides, since I've been programming in C# lately, it's not like I can't use the books I've picked up over the last few years for VB and do whatever translation I need to do.

Sounds like you're interested in pursuing the VB version solely in the future.
Monday, March 21, 2005 2:45:38 PM (Central Standard Time, UTC-06:00)
Rocky .. see this ---

http://wimontheweb.com.dotnet17.hostbasket.com/ca_main.aspx
Monday, March 21, 2005 2:50:15 PM (Central Standard Time, UTC-06:00)
I am a C# programmer who has been working with VB .Net at my current job for a couple months. Took me all of 5 minutes to start programming in VB .Net, though some of the subtle differences have taken longer to figure out.

I am not really sure why you don't develop the framework in VB.Net and let C# users inherit from the that instead of a C# version. If there are any incompatabilites you could write a thin layer in C# to handle the differences. Am I out to lunch? Personally I want to improve at using both languages.

Jamie
Jamie Macleod
Monday, March 21, 2005 3:16:20 PM (Central Standard Time, UTC-06:00)
Wow, this sure generated comments!

I appreciate all the support, for the most part I was just ranting :)

Jamie, you'd think I could do CSLA .NET in just one language. But the purpose of the framework is as a teaching tool - to show the concepts as well as to provide a potentially useful implementation. It isn't a product, it is a tool, and as such I firmly believe it needs to exist in both languages.

But other demos and code I create isn't (in my mind) subject to that restriction. While much of it would be useful in both languages, the burden of having a reader convert it is acceptable to me. More acceptable than me spending the time to write it twice anyway :)

But I had a reader of the C# book send me a nasty-gram because the DataListView control is in VB, not C#. The fact that it isn't covered in the book, nor is it part of CSLA .NET didn't phase this person - they were absolutely indignant that they had to see code without semicolons! Poor unfortunate soul...
Monday, March 21, 2005 3:34:07 PM (Central Standard Time, UTC-06:00)
My upcoming book will have both C# and VB.NET code. Converting is the mostest boringestest job, the thing that annoys me the most are the "[]" that are shown as "()" in VB.

I just do all my conversions at the very end. It's hella bothersome !! The minor nuances are awfully annoying.

Rocky, you've gotta read this http://codebetter.com/blogs/sahil.malik/archive/2005/02/26/56081.aspx

Some rather interesting discussion over there about VB.NET and C#'s paths diverging .. you might know better.
Monday, March 21, 2005 3:52:29 PM (Central Standard Time, UTC-06:00)
Broad-scale language divergence is VERY unlikely. Virtually all innovation going on is in the BCL, not the languages. What core innovation does occur at the language level happens in both languages, because it impacts the framework too - witness generics.

Sure C# got some syntactic sugar in 2005, and VB got the rest of the OO features it was missing, but the really interesting stuff is the new Windows Forms databinding features, all the new ASP.NET stuff and so forth.

You could also argue that there's innovation in the IDE. In 2005 C#'s IDE is seriously ramped up - comparable to or perhaps even better than VB (which is really wierd). The partial class concept is purely to enable VB6-style development of Windows and Web Forms in both VB and C#, and that's really just an IDE "innovation" (in quotes, since it gets us back to where we were a decade ago).

But I really don't expect to see a lot of divergence. Not at the language, library or IDE level.
Monday, March 21, 2005 4:58:46 PM (Central Standard Time, UTC-06:00)
Rocky -

Not sure if you've checked out the converter instant C# (www.instantcsharp.com) or not? I'm not affiliated with them in anyway, but I did use it when we were evaluating converting some rather large VB.NET projects to C# (don't ask) and it seemed to work pretty well. We ended up ditching the conversion, but I still use their trial versions for small projects <500 lines. They have a C# to VB.NET converter too that I use for small stuff. May want to give it a quick test drive. All things considered, it's pretty cheap too at about $149 or so.

HTH...
Leigh Kendall
Monday, March 21, 2005 6:34:16 PM (Central Standard Time, UTC-06:00)
Hi Rocky,

I've gotten to the point now that I do most demos in VB. I find the C# guys read VB just fine as it's designed to be legible anyway.

Regards,

Greg
Monday, March 21, 2005 10:07:49 PM (Central Standard Time, UTC-06:00)
Greg - I didn't know C# guys could read VB. I thought it was too verbose, uh, I mean legible... (just kidding folks! really)
Leigh Kendall
Tuesday, March 22, 2005 3:55:20 AM (Central Standard Time, UTC-06:00)
Lots of replies - but I am surprised no-one else has picked up on the intriguing sentence:

"I have numerous enhancements to CSLA .NET that I’ll never publish to the world, because the pain involved in porting to the other language is too high."

Any hints as to what they are? :-)
Tim Ensor
Tuesday, March 22, 2005 2:00:41 PM (Central Standard Time, UTC-06:00)
Sounds like what you want to do is just publish a book in Intermediate Language(IL).
:)
Thursday, March 24, 2005 2:23:46 PM (Central Standard Time, UTC-06:00)
Everybody's missing the important question - what is the speaking engagement? I'm mostly concerned with the reasoning of the people making this demand.

My opinion is that in 2005 any VB.Net or C# developer ought to consider it a core requirement to be able to at least follow code in the other language. I mean really - is it likely that a C# guy is going to just have a big blank stare as you explain VB code and then understand the concepts when he sees it in C#?

There may be a few exceptions, like hooking up events, where there's a bit more significant difference - but I would trust that you're smart enough to recognize those points as you're discussing that line of code and make a point to ensure the "other" guys understand it.

Daniel Billingsley
Thursday, March 24, 2005 4:18:55 PM (Central Standard Time, UTC-06:00)
It is actually a pretty common request - especially from user groups. Conferences are typically open to either language, looking for a mix of both. But user groups are often extremely focused on one language or the other - or they are a mix of both and then they want both.

This really illustrates why knowing only one language is a poor choice on the part of any developer. An open mind is key to success.

But there's so much misinformation out there it is amazing. Yesterday I was asked (seriously) if VB would have any way to deal with generic types in .NET 2.0. I said "of course!". The guy then clarified that he wasn't talking about generic things like "integer", but actual generics like C#. I damn near laughed in his face (which wouldn't have been polite)! That level of blatant ignorance is simply unjustified in any competent developer.

Hell, even I (a .NET guy) know that Java is also getting generics. I also know that the implementation is more syntactic sugar and less runtime mods, so it won't give Java the massive perf benefits we'll enjoy in VB and C# due to generics. I would CERTAINLY expect any .NET developer that's worth a damn to be aware of the feature sets of both VB and C#...
Friday, March 25, 2005 3:38:04 PM (Central Standard Time, UTC-06:00)
>>I would CERTAINLY expect any .NET developer that's worth a damn to be aware of the feature sets of both VB and C#...<<

I totally agree and would certainly hope so as well, BUT, I believe the simple reality is this, (and this is a blanket statement, so yes, there will be exceptions), but:
1) C# developers and those "generally" adverse to VB feel that VB was and always will be inferior, and hence, they don't need to bother learning much about VB.NET or it's latest capabilities since it will always just be "VB".
2) VB.NET developers don't like to poke their heads out of their comfy little VB cocoon and see what C# is up to. All I need to know is VB. Plus, C# is "too" hard and I don't like those squigly things and semi-colons and case-sensitivity makes my head hurt.

NOT that I agree with this reasoning (I use both C# and VB and come from a VB background), but these have been my unbiased observations over the years.

In a nutshell? I think C#'ers need to tone down the attitude and VB'ers need to grow up a little.

Just my $.02...
Leigh Kendall
Friday, March 25, 2005 9:37:41 PM (Central Standard Time, UTC-06:00)
After sending out my last comment. I thought about it more. Rocky, I really believe you should use more C#. It is not about the language, it is the culture attached with the lanugage: The MS VB team is obviously a stupidity team. Further, they are allowed and encouraged to be stupid! As a result, they will not become competent in any foreseeable future.

UI guy can be smart or stupid. So, UI guy can use VB or C#. However, middle tier has be to smart, otherwise, the system is doomed.

You are a middle tier guy. Eventually, you have to use C#. Your audience enventually will ALL go to C#. I suddenly realized this. You see, again, it is not the language spec. It is the culture--the MS VB team culture, and your audience's culture.

A person choose "custom class" eventaully cannot bear programming without refactoring; on the other hand, a person choose dataset, cannot stay in C# for too long. Dataset guy using C# or C# guy using dataset is just a paradox--it is in a non-stable status. It will go off and collapse at anytime.

Do not believe me? let's bet 2 $: you will switch to C# in 2 years, and, some "famous" ADO guys will return to VB camp.

Note that JAVA does not have dataset (at least, not yet ;-); So, a Dataset C# guy certainly does not have too much realy world large scale computing expericne. Dataset with C# is just a joke.

On the other hand, dataset with VB is also not at the stable status. You will find that each version of the studio, MS VB team will disappoint your audience, until all your audience switch to C#...

Kai
Friday, March 25, 2005 9:51:20 PM (Central Standard Time, UTC-06:00)
Just want to clarify: I use both VB.net and C#, and, in the past, I used both VB and Java, for a long time. So, I'm not THAT biased.

Also, I want to point out that currrently, there are only two good .net architecutre books: Rocky's and Matthew MacDonald's. Both author are VB guys. All (yes, I read a lot! and when talking about architecture, I certainly is a Java guy, so, when I say the following, it means something) C# architecture books are jokes!!! (of course, Rokcy's C# book is the only exception, and it certainly should be counted as a VB book though).

So, I'm not biased against VB spec, and not biased to VB6 people in general. However, becuase of C#, VB6 will divide, dummy ones in VB, grow-up's in C#, because MS VB team lead it, and after a critical tiping point (soon after VS 2005, this will happen), VB community will be forever doomed.


Kai
Friday, March 25, 2005 11:57:24 PM (Central Standard Time, UTC-06:00)
After I post the above comments, I read this, it really says a lot about culture, including "refactoring":
http://www.geekswithblogs.com/sbellware/archive/2005/03/18/26621.aspx

Rocky, you are so close, please complete the final step: give up VB as the "first language".

On the other hand, I agree with you that we should multi-lingual, otherwise, I cannot read your book, and Matthew MacDonald's. On the third hand :-), after you convert to C#, I see little reason to keep high fleuncy of my VB, other than my legacy maitenance work, which BTW, alone will force me to keep VB--that is another issue though.
Kai
Saturday, March 26, 2005 9:19:42 AM (Central Standard Time, UTC-06:00)
>>I see little reason to keep high fleuncy of my VB<<

No Kai? How 'bout for finding work? Seems to me that at 50%+ of projects for line-of-business apps are requiring VB.NET these days.
Leigh Kendall
Saturday, March 26, 2005 9:32:06 AM (Central Standard Time, UTC-06:00)
>>After I post the above comments, I read this, it really says a lot about culture, including "refactoring":
http://www.geekswithblogs.com/sbellware/archive/2005/03/18/26621.aspx<<

Ya, sure does say a lot. Sounds to me like a segment of the C# community is turning into a bunch of Java/XP wannabees? I'd slow down on the koolaid consumption if I were you. My favorite part of that insulting post? Darrel Norton's response about speed of development:
http://codebetter.com/blogs/darrell.norton/archive/2005/03/21/60161.aspx

Not sure about you're clients, but the ones I know don't give a cr*p about all the latest "process" hype; they want the project completed correctly on time and withing budget. I'm not against TDD, but it's just a small part of the whole development process of delivering a _successful_ end result to the client.

We're here to provide business solutions to end users economically and efficiently, NOT geek out and get mired in one small part of the development process.
Leigh Kendall
Saturday, March 26, 2005 11:14:37 AM (Central Standard Time, UTC-06:00)
Think about it, really it is not language. MA VB team is using C++ of course. Anothere solution is to file a petion, ask MS to switch C# team and VB teaem! Howw about that--at least, it is much a better petition ;-) than http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=8a559eb1-8408-4e47-8e00-0d3a3621f37e
Kai
Saturday, March 26, 2005 12:00:04 PM (Central Standard Time, UTC-06:00)
====How 'bout for finding work? Seems to me that at 50%+ of projects for line-of-business apps are requiring VB.NET these days.

----Did I mention "other than my legacy maintenance work, which BTW, alone will force me to keep VB--that is another issue though”? I will not throw away my VB, including VB.Net. Just like I keep using (daily, every hour) Vim and Cygwin (grep, and, yes, awk, Rocky—I read your every posting) after I left Linux. OK, OK, I know, at least I am NOT consistent, on the surface only though. Again, I am not against VB spec. As a matter of fact, seriously, I deeply believe bilingualism, and multiculturalism. I am the only guy, at least for now, in my team, proposing that two languages is inevitable. Instead ‘standardized”, just embrace it, and, BTW, extend it also, to Java or perl  . That happened before I saw Rocky’s email, of course. The reasons? Yes, Rocky is the first one, and the ActiveObject guy Petar in CSLA, and the CSLA community in general, and my friend in my team also! They are smart guys. BTW, Rocky, thank you!! – the CSLA is not any bit less smart than any java community, for example Hibernate or SpringFramework or AspectJ or Jess (ruleengine) community, and at least for now, more than 50% guys in CSLA are VB guys—no need a census, I can feel it, because I can feel the pain!—again, whenever I use my brain, instead of only my fingers, I count myself as a Java (oops, I mean C#) guy. When in CSLA, I am using my brain, so, I feel the pain that I am the minority, while at the same time, I enjoy the high of multiculturalism.

More seriously, I know two things for sure: (1) no dataset, that is the “VB guy” in its worst connotation. (2) use translator, but alternate the “first language”, please, Rocky, just show that you love us, either VB or C# guys ;0(

Leigh: after all the above conceding, I want to point out that TDD is actually not about the “process”, it is all about clients and speed. It is actually those UP (UNIFIED PROCESS) (or RUP –rationalll UP) guys impose the “process” concept to XP or agile (OK, I should say, those XP or agile guys got into the trap, and responded the invitation!). In the beginning, the “process” is only “programming” (the “P” in XP is “programming”, not “process” ;-)

Seriously, Agile and RAD have a lot in common. The only diff is dataset ;-) RAD is dataset, i.e., no middle tier, only visual programming (i.e., click-and-drag brain-dead-fingers-only programming); while Agile is custom-class, i.e., middle tier driven, domain driven, use your brain.

Now, using brain is slower? I do not think so. Yes, brain-dead requires fast fingers, that I agree, I experience that also, trust me. Sorry for the smart-ass comments, but seriously, TDD is really about clients and speed, and delivering the exe’s.


,
Kai
Saturday, March 26, 2005 12:16:39 PM (Central Standard Time, UTC-06:00)
Another thing, the Java slowness. I can share something here, as a converter or insider ;-) There are two java camps. One is J2EE, which is slow and “bad”—the exact “badness” Rocky points out about “distributed” (“Layering is almost always good, tiers are usually bad” – again, a confess, I read everything Rocky put there ;-) After two projects, I refused (try very hard, and succeeded!) anything to do with J2EE stupidity (it is just another extreme of MS VB’s stupidity, I guess all fools are alike, even they are on two extremes)! There is another camp, it is POJO (plain old java object); it is fast. In this camp, you have OR mapping (Hibernate), Springframework, AspectJ, and Jess. BTW, why CSLA is so great? Because it is aspect-friendly, or, close-to-aspect (I need a better word here, perhaps “pro-aspect”?). All those regularities and disciplines in CSLA, they are “aspects”. Here is a good book about aspect (sorry, in C# --oops, I mean in Java): http://www.manning.com/laddad
Kai
Saturday, March 26, 2005 12:36:56 PM (Central Standard Time, UTC-06:00)
Guess I used "process" a little generically, but I think you got my point.

Anyhow, the use of DataSets does NOT imply no middle tier. You can certainly pass back DataSets instead of custom collections or what have you just as easily. I know this is a whole other religious fight I have no interest in entering. ;-)

>>no dataset, that is the “VB guy” in its worst connotation<<

What? Does the inclusion of DataSet ds = new DataSet(); cause compile errors? :-P I'm sure you'll find _plenty_ of C# code using DataSets as well.
Leigh Kendall
Saturday, March 26, 2005 1:03:13 PM (Central Standard Time, UTC-06:00)
====the use of DataSets does NOT imply no middle tier
----good point. dataset and business-facade can co-exist. However, then the facade now is like a plastic shower curtain ;-) You see through it, from beautiful UI to database. I know there are certain techniques avoiding that; however, after all those techniques, why bother? why not just use domain driven (custom-class)? -- too much coding, I know. How about code generator, and, other things, like Aspects.

====C# guys also use dataset
----exactly. Those guys will return to VB soon :-) according to my predition. It works like this: (1) the thought lead ("authors")of dataset guys will gradually use VB as their "first lanugage", C# is the minority in the dataset community, and then, the endangered specis; (2) antoehr version of VB has betteer support of dataset than C#, like "my";-) only for dataset though.
Man, you see, it is inevitable, that is the power of culture.
Kai
Comments are closed.