Meta-Blog

SEARCH QandO

Email:
Jon Henke
Bruce "McQ" McQuain
Dale Franks
Bryan Pick
Billy Hollis
Lance Paddock
MichaelW

BLOGROLL QandO

 
 
Recent Posts
The Ayers Resurrection Tour
Special Friends Get Special Breaks
One Hour
The Hope and Change Express - stalled in the slow lane
Michael Steele New RNC Chairman
Things that make you go "hmmmm"...
Oh yeah, that "rule of law" thing ...
Putting Dollar Signs in Front Of The AGW Hoax
Moving toward a 60 vote majority?
Do As I Say ....
 
 
QandO Newsroom

Newsroom Home Page

US News

US National News
Politics
Business
Science
Technology
Health
Entertainment
Sports
Opinion/Editorial

International News

Top World New
Iraq News
Mideast Conflict

Blogging

Blogpulse Daily Highlights
Daypop Top 40 Links

Regional

Regional News

Publications

News Publications

 
I Love C#!
Posted by: Dale Franks on Thursday, October 05, 2006

Well, it's 9:00pm here on the West Coast, and I just got home after a workday that started at 7:30am. My days have been jammed full of stuff for the past several days, and probably will through next week, too.

But a couple of things happened I wanted to write about.

The highlight of today's very long day was using the first real, operational C# application I ever built.

I've been a Visual Basic guy for several years. Way back when I was in college, I programmed in Fortran, Pascal, and RPG, and picked up a little COBOL and C along the way. All of which I promptly threw out the window, in order to spend 10 years traipsing around the world at the government's behest, carrying an M16.

When I got back into programming professionally, by accident, really, 10 years ago, everything was in Visual Basic. That's not because VB was the best language around. But it was, in most cases, the best choice for the business world.

Let's say you go into the CFO's office and tell him, "We're ready to convert the organization's big database application into Windows. We can do it in Visual C++. It'll take 6 months and cost $100,000. Or, we could do it in VB at 1/3 the time and cost. You won't really notice any difference as a user, of course, but the VB solution will be less technically elegant."

Guess what he's gonna choose?

So, I built up a huge wealth of VB experience, doing database and web, and other applications for so many customers that I've lost count. In fact, the blogging software that runs this web site, .Blog was done in Visual Basic.Net.

But recently, I've been working in C#, the other programming programming language for the .Net Framework, and I simply love it. C# is based on the traditional syntax of the old C language, upon which Java, Javascript, C++, and others\ programming languages are based.

Compared to VB, C# is a much more terse language. For instance, let's say you want to compare a value in visual basic, then do something based on that comparison. In VB, the code would be:

If x = 1 Then
    y = 2
End If

That same code in C#:

If (x == 1)
    y = 2;

Even for something so simple, you just dump one line of code on C#. Another example, let's say I want to use a variable, and fill it with text. To do so, I have to tell the program that I am creating a new string variable, a process called "dimensioning".

VB:
Dim strValue as String

C#:
string strValue;

The logical structure of C# is much more rigorous as well, and is a far better fit for object-oriented programming than VB. And learning the syntax and other things necessary to make the switch has been very easy.

But, best of all, the huge time difference between programming in a C-based language compared to VB has just disappeared. Now, C# provides you with a programming environment in .NET that is every bit as much of a rapid application development environment as VB. So C# really gives you the best of both worlds.

I've had a blast learning it and programming in it, and am planning to use C# almost exclusively in the future.
 
TrackBacks
Return to Main Blog Page
 
 

Previous Comments to this Post 

Comments
As a C++ (and occasional Perl) user, I have the opposite experience. When I sit down to write in C#, I feel ready to have a temper tantrum: "Where are my containers? Where are my algorithms? My function objects? Where the hell are my types?"
 
Written By: sammler
URL: http://stonecity.blogspot.com
I love VB, i don’t think it gets the love it deserves :)

 
Written By: josh b
URL: http://
crap. why do I always acquire skills in the reverse order of their utility? What is all this VB I’ve been learning? "Valuable programming experience?" Bah.

Plus, .Net is Microsoft’s satanic deal to own the Internet, so ethically speaking I have to avoid learning that language... so C# had better not actually be this useful.
The logical structure of C# is much more rigorous as well,
I interpret this statement as meaning "basically, amateurs and dittelantes like me can expect to be totally unable to successfully debug anything." :-P

DALE RESPONDS: If you can learn VB, you can learn C#. Really, in .Net, the commands are really very similar, since they both access the .Net Framework.

As far as your disparaging comments about .Net, well, I have to say that you are...misinformed.
 
Written By: glasnost
URL: http://
I can’t say I had the same reaction when I had to do two weeks of work in C#. If I left off parentheses from a method, C# complained with a snitty error message saying I should put them in. Well, if the dev environment for the language knows they are needed, why doesn’t it just put them there?

And then there’s case sensitivity, which I hate. I spent about ten minutes deciphering the error message from capitalizing the New keyword. (Try it - the results are most educational.)

The extra End statements in VB are more verbose, but then it’s a lot easier when you’re scanning through code to tell the difference between End If and End Sub than between two identical braces.

I do prefer the C# declaration syntax, but it’s a minor issue. OTOH, I like the way VB is integrating XML and dynamic querying into the language (next major version) much better than the way C# is doing it.

All that said, though, the two languages are a lot more alike than they are different. It’s the underlying framework that counts, and the languages just expose it with slightly different flavors.

In fact, I long ago proposed a new language. I call it B#. It would have options for

- End statements vs. braces
- semi-colons on the end of statements or not
- which declaration syntax to use
- case-sensitivity on or off
- choose Using or Imports

and a few other things. Then each developer could configure the language to look and act the way they want, but the code they wrote would be dynamically translated when loaded to any other developer’s preferences.

An end to the language wars!

Unfortunately, the language teams at Microsoft seem noticably unenthusiastic about the idea...
 
Written By: Billy Hollis
URL: http://
I’m a Visual FoxPro programmer, with 10 years of true object oriented programming experience. Have been a programmer for 20 years, after a "old fashioned" education in Computer Science and Information Technology. Got most of my learnin’ on a mainframe, and we barely scratched them new fangled IBM PCs with MS-DOS.

Programming is programming. If you understand how to structure a program, the rest is all syntax.
 
Written By: Keith_Indy
URL: http://
Agree KI.

And Glas - .Net is the one thing I will wholeheartedly say that Microsoft did right and continues to improve. Their dev environment is top notch with nothing even approaching it as far as features go. I’m an Oracle guy and it plugs in just as easily into VS2005 as SQL Server does.

Dale is a little wrong on his example. This is valid VB

If x = 1 Then y = 2

I use both 50% of the time. With .Net 2.0, a web application can use both C# and VB in the same project. I tend to use C# for business rules and VB from front end work. VB is faster when it comes to syntax errors. C# is cleaner to look at. They both compile to the same IL, so outside of the .0000009% chance you need to overload an operand, it doesn’t matter which one you use.

While I commend Dale on .Blog, I personally find Subtext to be a superior .Net based blogging engine. And me being a developer of it has nothing to do with that, trust me ;)

DALE RESPONDS: You are technically correct, but only for a single-line command. Otherwise, you need the "End If" construct. In c#, you never need "End" constructs, other than your braces.
 
Written By: Robb Allen
URL: http://blog.robballen.com
I program uCs, not PCs, but I’m wondering if like 1 of 5 of the regulars here is a programmer?

What gives?

Yours, TDP, ml, msl, & pfpp

DALE RESPONDS: Robb Allen is a programmer. Billy Hollis, of course, is a nationally recognized expert in programming, having written several books for Wrox Press. There are a number of Geek Pros that are regulars here.
 
Written By: Tom Perkins
URL: http://
Tom,
You beat me to the question - we all programming for a living or what?
 
Written By: looker
URL: http://
What the devil else is there to do while waiting for a compile?
 
Written By: Mark A. Flacy
URL: http://
What the devil else is there to do while waiting for a compile?
Blog?

Or comment.

Me ... I know nothing of programming. And amazingly I’ve been able to live full life anyway.
 
Written By: McQ
URL: http://www.qando.net/blog
Shoot, Mark what kind of machine are you on?

McQ - amazing ain’t it?
Because as a rule programmers have a really exciting life, and we get all the chicks too.
the only business that gets ya more chicks is playing your gui-tar on the MTV....
"Maybe get a blister on your little finger, maybe get a blister on your thumb"

Okay, so, I lied, a little.
 
Written By: looker
URL: http://
Dale, you’ve swallowed the u$oft koolaid... the whole pitcher.

C# is equal parts ripoff of Java and C++, as well as the usual u$oft marketing ploy after Sun refused to rollover and let Bill own the world.

And "DOT NET"... This is the most blatent attempt to confuse the market since Captain Marvel.


".net" is the top level domain for ISPs, etc, not a fscking programming environment, or at least it was, until bill decided that he needed to screw up the nomenclature for a two-bit marketing advantage over Sun and Cisco.

I could understand (I’d laugh, of course) if someone like GM attempting to name a car (or whatever) "dotnet". But The Minions know better, and they did it anyway. Now, when someone uses the phrase, I have to stop and decide whether they’re talking internet, or that pissant PE.

As we use to say, "excessively annoying".
 
Written By: bud
URL: http://
Wow. And now the you see that the software development world has it’s own counterpart to the Objectivists.

Besides, as everyone knows, Java is just a blatant ripoff of C.

There. That oughtta do it.
 
Written By: Dale Franks
URL: http://www.qando.net
Shoot, Mark what kind of machine are you on?
Fast enough, but there are >15K Java files to compile in a ClearCase dynamic view.

At least I don’t have to dick around with make files....
 
Written By: Mark A. Flacy
URL: http://
Besides, as everyone knows, Java is just a blatant ripoff of C.
Pull the other leg.

After programming in C++ for a while, Java is much much cleaner.

I tend to do a lot of Python, too. No more braces!
 
Written By: Mark A. Flacy
URL: http://
After programming in C++ for a while, Java is much much cleaner.
C++ is a syntactic nightmare compared to Java and C#. Don’t get me started on the abomination that is VB...
 
Written By: Jordan
URL: http://
Put me down as a Java convert too.
Speaking of ripped off languages - Anyone ever hear of TAL?
The surprise will be if someone has...heh.

Anyway, where’s the chicks? How come they aren’t swarming?
My instructor told me there’d be chicks
(Course one of em also told me me in 78 that COBOL was a dead language,
it must be one of those hammy death scenes that goes on forever....)
 
Written By: looker
URL: http://
DALE RESPONDS: You are technically correct, but only for a single-line command. Otherwise, you need the "End If" construct. In c#, you never need "End" constructs, other than your braces.
Aha! Not really! This is also correct

IIf(a = 1, b = 1, b = 2)

which is equivilent to

if a = 1 then
b = 1
else
b = 2
end if

Outside of a little verbosity, who cares about braces versus "End" statements. The overall objective is to use the language that you’re most comfortable with that has the ability to perform the actions you need it to. I was a Java / C programmer for a while. You can laugh all you want about how superior those languages are, and I’ll simply go kick out an entire product while you’re still trying to figure out why your pointer is all off or what you forgot to include ;)

Launguage arguments are worse than religious arguments!
 
Written By: Robb Allen
URL: http://blog.robballen.com
end-if’s are nice to see, they’re big, they’re obvious.

Braces have a way of hiding from "old eyes" at 3:00 in the morning when you’re
trying to get production back on line.

Course Dale you proably don’t have that eye problem (yet, heh-heh).

But it is like religion, ain’t it?
 
Written By: looker
URL: http://
As far as your disparaging comments about .Net, well, I have to say that you are...misinformed.
So is this guy misinformed as well? He apparently created C++, so I think he’s in a fairly well-informed position.

http://www.research.att.com/~bs/bs_faq.html#Csharp

What do you think of C#?
I have no comments on C# as a language. It will take a lot to persuade me that the world needs yet another proprietary language (YAPL). It will be especially hard to persuade me that it needs a language that is closely integrated with a specific proprietary operating system.

If you want to write exclusively for the .Net platform, C# isn’t the worst alternative, but remember that C++ is a strongly supported - though less strongly hyped - alternative on that platform.

What do you think of C++/CLI?
C++/CLI is a set of extensions to ISO C++ that provides an extremely complete "binding" of C++ to Microsoft’s CLI (Common Language Infrastructure). It has been standardized by ECMA (ECMA-372). I am happy that it makes every feature of the CLI easily accessible from C++ and happy that C++/CLI is a far better language than its predecessor "Managed C++". However, I am less happy that C++/CLI achieves its goals by essentially augmenting C++ with a separate language feature for each feature of CLI (interfaces, properties, generics, pointers, inheritance, enumerations, and much, much more). This will be a major source of confusion (whatever anyone does or says). The wealth of new language facilities in C++/CLI compared to ISO Standard C++ tempts programmers to write non-portable code that (often invisibly) become intimately tied to Microsoft Windows.



CLI, of course, is one of the basic components of .Net.

I freely admit that I don’t have any experience programming in ASP, in using .Net, or in C# or C++. In other words, I’m a rank amateur. But everything I read about .Net, and therefore C#, smells like an attempt by Microsoft to consolidate all future programming lanauage and server environment development underneath its own Microsoft Programming Universe, which is in turn dependent upon.. the Windows OS! Surprise!
In other words, to monopolize the server market, or to skew it to a consumer OS level, thorough the same indisdious product bundling as what crushed Netscape and the Media Player market.

I’m sure you disagree.
 
Written By: glasnost
URL: http://
I’m sure you disagree.
Given that my professional web site is www.dotnetmasters.com, that would be a safe bet for me.

Hey, glas, all I can tell you is that lots and lots of folks want software development done on the .NET platform. They can’t all be incompetent boobs that simply don’t understand the evil of Microsoft.
 
Written By: Billy Hollis
URL: http://
Well, Bjarne Stroustrup is a bit biased. Interestingly, he currently resides in the CS department at my university. Even more interestingly, the university didn’t have a dedicated course in C++ (opting for C and Java instead, and rightly so in my opinion) until a year after he showed up. I would have loved to have seen his reaction.
 
Written By: Jordan
URL: http://
In other words, to monopolize the server market, or to skew it to a consumer OS level, thorough the same indisdious product bundling as what crushed Netscape and the Media Player market.
Do you berate McDonalds for insidiously including french fries with their Big Macs?
 
Written By: Jordan
URL: http://
Anyone ever hear of TAL?
Nope. How about Forth or Whitespace?

I’ve actually programmed in Algol (well, in college).
 
Written By: Mark A. Flacy
URL: http://
Mark
Forth - yes. Never used it.
Whitespace - nope.

TAL is/was a proprietary langague for Tandem machines (now HP).

ALGOL I played with - along with PASCAL. TAL is quite a bit like PASCAL.
(both in college - when we used punch cards to enter the programs...sheesh....)

Howbut APL (I confess I’ve never used....but results in my favorite
programming poem) -
"There are three things a man must do, before his life is done.
Write two lines in APL,
then make the buggers run".
 
Written By: looker
URL: http://
Howbut APL
Well, not as a programming language but as a database query language. (!)

Back in the Old Days™ (1985) when I was working in the 2nd Armored Division DMMC, there was a system we could use to query for the stockage levels of various repair parts for everyone on the post. The query language for the system was APL.
 
Written By: Mark A. Flacy
URL: http://

 
Add Your Comment
  NOTICE: While we don't wish to censor your thoughts, we do blacklist certain terms of profanity or obscenity. This is not to muzzle you, but to ensure that the blog remains work-safe for our readers. If you wish to use profanity, simply insert asterisks (*) where the vowels usually go. Your meaning will still be clear, but our readers will be able to view the blog without worrying that content monitoring will get them in trouble when reading it.
Comments for this entry are closed.
Name:
Email:
URL:
HTML Tools:
Bold Italic Blockquote Hyperlink
Comment:
   
 
Vicious Capitalism

Divider

Buy Dale's Book!
Slackernomics by Dale Franks

Divider

Divider