Why should "I" use C#

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
Right, bit of pride swallowing here, but I'm an open minded kinda chap so here goes.

As well as having a full time job (or did have!), I have also worked for myself for the past 15 years. Got a great customer base, they come back for more, and every project has been developed in VBA or VB/.Net. VBA has used the Access backend, VB/.Net projects have used SQL Server.

NEVER had a days complaint, they've worked as required when gone live, I get paid, brilliant.

Yesterday however I was approached by a new potential customer. Their requirement was simple, but they probably won't use my services because their project wasn't going to be coded in C#!

Despite my fair discussions with them, querying them as to why it was so important, the meeting ended with them saying that they have heard so many 'bad' reports of VB.Net that they want a C# coded project or nothing at all!

So...

Why C#? I'd like somebody to give me SENSIBLE answers as to why I should take the week off and learn C# a bit more. I can 'get by' (loops, clauses, methods, etc.) but would need to reach for the manual on things like threading, data calls, etc.

I won't accept "It's a better language", because that's rubbish. 15 years writing software in VB with happy customers and a healthy bank balance will not reflect that. And despite the thoughts of people with **** all knowledge of the industry and a years dabble with it in College/Uni and touting it because it's fashionable it just will just not work with me!

OOP I won't accept, because .Net can handle it beautifully.
Unsafe variables I won't accept, because BY DEFAULT this is now a part of VS2005.
It's easy I won't accept, because everything has a learning curve.

But what I want to know, in a nutshell, is why C#?

Does it make faster executables?
IS there somewhere in it that makes errors/bugs less likely?
Does it open up something like COM that I'm unaware of, therefore making 3rd party addins access the libraries?
Are classes, modules, compiled more optimal?

I'm intrigued?


(PLEASE DO NOT TURN THIS INTO A VB v C# FIASCO)
 
Well the "Get by with" comment was actually referring to C#. Considering C# is only 7 years old, then it's impossible for me to have 15 years experience with it!! Although I do admit, perhaps I didn't make that clear.

The "Unsafe Variables" bit I just think you're been pedantic for the sake of it. There's always an argument on this forum about how C# you can't, for an example, use A=10 without specifically declaring what A is. On VB.Net you can if STRICT is turned OFF.

Not the best reply really is it?
 
So, DJ_Jestar, let me give you an example then:

I've just finished a program in VB.Net than attaches into a CNC device and monitors parts scanned (via RFID), saves this unique identifer into a database, and continues until the entire manifest is complete, which then prints a packing note, retrieves the next incomplete job and continues.

So are you really saying that for me to learn:

COM Port reading
Dataset handling
Printing

Would take me an hour to learn? Or are we talking an hour per area?
 
C# or VB a question I hear often. Is C# better, nope, but plenty of elitists think it is. I'm currently a VB developer and me and another colleague are thinking about moving to C#. Why do we want to move to C# because there's seems to be a lot more call for C# developers.

There is, but what I can't fathom out is just WHAT the major difference, advantages are! The only thing I can see is that the syntax is more like C/C++/Java which means someone coming from those backgrounds would find it easier to migrate into C#.

I can't see any other practical advantages at the moment other than it's new and people are wanting work done in it. Question is - why?
 
I can't see any advantages. One advantage from a company might be if they develop an app in C# and two developers leave, it will most likely be easy for them to get someone in to replace them. Remember managers, etc love new buzz words and C# along with .NET are the buzz words at the moment so they think it must be wonderful.

I agree 100% with you, the only advantage I can see is it's the latest craze. Like I said, I'm going to swallow a lot of pride and keep an open mind on this one, and open to listen to any 'sensible' reasons.

If I was getting into the business, I certainly can see an advantage of having it under my belt, because as you said, it's new, managers love it, it's a buzz word, so will employ people with the skill.

But once you're in the industry, doing what you do best, proving your worth, what advantage does it have (other than moving employer) over VB.Net?

If it produces quicker executables, then I'd say that was it. If it produced smaller code, I'd point at that. And if someone said "Do a full SOP system in a week" and VB.Net took 1000's of lines more code, dozens upon dozens of testing to ensure it was bullet proof, and C# had controls that had, say, a mask input on every text-enabled control, brilliant garbage collection and no need to create data adapters then I'd point at C# and say "You rock".

But I just don't see a practical advantage at the moment.
 
Thanks growse, the kinda response I was looking for :)

Any chance you can give a quick example on calling the WIN32 API so I can see what it's like in C#? VB.Net is a bit 'messy' when it comes to that.
 
I think a more appropriate thread title would be:

"Why I should use Google"

Always one isn't there!! Get that joke in a cracker or saw the response somewhere else and been saving it for the appropriate moment?

Anyway...

Thanks for the responses over the last few hours.

stx666, how do you mean about the probability calculations? Any examples?
 
I've had the opposite situation recently: my preference is to develop in C#, but a client wanted the code delivered in VB.NET so their resident VB hobbyist could make changes without needing me (sob). I'll sting 'em if they ever want me to fix his bugs though :D

THAT could be the answer then. Never thought of that! Maybe they have another coder who's C# efficient. The swines!!!! :p

And:
Mr Jack said:
*You* should use C# because you're losing income because of not using it. What more needs to be said?

You're right! Hence why I started this thread with an open mind and not to diss the language (like I usually do!).

Think I'll finish thse few jobs and take some time to learn it.

Thanks folks, 'really' appreciate the none-biased answers on this one, it's been really helpful.
 
Given all .NET platforms can read any of the above, no, it would take you less.

15 years experience and you can't see that?

I think you've proven in every post that your opinion is absolutely worthless. Sorry to be harsh, but it's fact. (15 years has shown me that those who know nothing tend to mumble about nothing)

Thanks anyway, you've had your skit, I've had mine, let's leave it there and do things more constructive in life.
 
OK, let me continue then.

1) Your first reply was worthless. It attempted to be a skit, but failed miserably because you had the facts wrong. Other people knew what I meant, they answered it sensibly. Even some questioned your own comprehension of the question. Granted it could have been worded better, but the fact remains your answer was obnoxious and didn't help the question at hand. To me, it appeared as if you attempted to raise onto a little soapbox and protest as someones lack of understanding of something foreign to them.

2) By your OWN admission, and I quote, "I don't use C#, but my colleagues do." Stop there. I don't want to know. I don't want hearsay, I want answers from people who know what they are talking about. Again, fact is your professional opinion on something that you don't use is absolutely worthless to me (and anyone else that the thread may help).

3) Your answer of, and again I quote, "any of which would take less than an hour to learn, providing there is competence in other mediums." Really? So are you really saying, and choose your answer carefully, that YOU (someone who doesn't use C#) knows how long it will take someone to learn the basic fundamentals of a new language? Are you saying that my extensive knowledge of the programming fundamentals of VB.Net (Loops, events, classes, generics, serializations, interoperation, reflection, globalization, delegates, threadings [shall I go on?]) that I can learn the general syntax on handling all this WITHIN ONE HOUR - providing I'm, ahem, competent in other mediums?

Yes, I've found out that my simple:

[VB.Net]
Dim pVariable AS String = "My String"

is wrote as
[C#]
pVariable String = "My String";

I've picked that up quite well. But when I have to learn about the new syntax for loops (granted it's relatively easy), then we start to add in a bit more time for it to sink in.

When I start to add in file handling routines (and I'm not talking about ye olde dialog box, I'm talking down to the nitty gritty file handling events), then that's a little bit more to take on board.

Yes I accept that pVariable.ToString will work on VB.Net and C#, nothing much to learn there, but there's a whole world of difference between:

[VB.Net]
Dim pItem as StockItem = New StockItem
Dim ds as FileStream = New Filestream("StockItem.XML",FileMode.Open)
Dim xs as XmlSerializer = New XmlSerializer(GetType(StockItem))
pItem = CType(xs.Deserialize(fs), StockItem)
fs.Close()
Return pItem

and

[C#]
StockItem pItem = new StockItem();
FileStream fs = new FileStream("StockItem.XML",FileMode.Open);
XmlSerializer xs = new XmlSerializer(typeof(StockItem));
dsp=(StockItem)xs.Deserialize(fs);
fs.close();
return pItem;

Still say learning all this is gonna take me less than an hour? Or is my incompetence starting to show through? 15 years been a waste of my time?

4) Another quote - "Given all .NET platforms can read any of the above, no, it would take you less. 15 years experience and you can't see that?" See what? What the hell are you on about? O sorry, you're saying that all .Net platforms can read COM ports, Printers and dataset handling? Er, yes I guess you're right. Forgive my stupidity on that one. Or are you trying to impress me with your intelligence and know that the ending syntax will probably be the same, i.e., .Open()

Now, follow me to example land and let me show you something else I've picked up:

[VB.NET]
Dim pProcesses() As Process = Nothing
pProcesses= Process.GetProcessByName("explorer","machinename")
For Each pProcess As Process In pProcesses
Console.WriteLine(pProcess.ProcessName)
Next

[C#]
Process[] pProcesses =null;
pProcesses =Process.GetProcessByName("explorer","machinename");
foreach (Process ThisProcess in pProcesses)
{
Console.WriteLine(ThisProcess.ProcessName);
}

Little bit more to learn there. You agree? Thought not. Well there is for me, y'see for one I've never used a null in programming. Sure I've used it in SQL, and I know what a null is (took me 14 years to learn, but hey ho), and those funny square brackets. What are those? Quick flick in the book reveals it's an array.

foreach, that's something new. Different to VB.Net, but, yes, I understand that now (tick tock tick tock, there's the hour countdown again). Curly braces, hey they look familar, I've saved a bit of time on this magic hour by knowing about curly braces.

Yes I can see perfectly well that the commands are the same, they are, after all, .Net commands which are common throughout the framework. But the syntax to acquire the results DOES differ, and in my mind, someone who hasn't touched the language before, it's new to me.

Getting bored yet? 'Cos I sure as hell am!

Anyway...

Finally:

5) Can't be bothered to quote it all, but the "15 years experience and you can't see how trivial it is to learn a new syntax, let alone a new syntax to the same system (.NET)" again bothers me slightly.

That's EVERY post (bar one) where this "15 years experience" thing has cropped up. Why? Should I know a new language because I've had 15 years experience in VB?
I've had 36 years experience in knowing what milk tastes like, should I have found out what cranberry juice tastes like after 15? I'm confused?

Let me remind you of one important thing here. I work. I work hard, I work long and I LURVE what I do. If you want to be pedantic, I've been developing for almost 21 years now so I think I can consider myself as a bit of an old hat when it comes to developing software. But as someone said in this thread (won't mention their name as it's not fair to bring them into this), but by NOT knowing the language, it's costing me money. What is ALSO costing me money is having to take time off and learn a new language and do the research. A forum is a perfect place (or should be) to ask a question and get some feedback, ideally from (and PLEASE take note) someone who has experience with the question in hand. Whether it takes someone as high and mighty as you an hour to learn, or someone with little competence (me) a week to learn, I do NOT KNOW until I ask the damn question. I'm too busy working on a customers solution to suddenly sit back and say "Think I'll learn a new language today". I don't have the time.

So please, next time someone asks a question, irrespective as to whether you think they are competent or not or whether you think their question should be posted, then either put up and shut up or offer something constructive and helpful. Otherwise you're just going to look a [Vb.Net] nothing / [C#] null



*edit* Inquisitor - thanks for that answer - yes as I've mentioend the ending syntax will be the same, but it was the syntax for the methods that I thought would be totally different. Thanks for the way you answered though, appreciated.
 
BTW: Had my answer now, so really really can't be bothered to reply to anymore of your crap DJ.

Apologie to anyone who's had to put up with the crap flying about.

*Case closed.*
 
Back
Top Bottom