PDA

View Full Version : C#, is it any good?


Vader
7 Mar 2007, 09:17
From what I understand there are a few of you out there who write C# applications.

Now, I'm thinking about learning this since Flash went all object-based and confused me (I figure if I'm going to realearn Flash I might as well learn something worth the time and effort instead) but I have no idea about coding.

As an artist it is almost impossible for me to learn code languages. I draw things, I don't programme them.

So, what's C# all about? I have no idea. I'll be spending some time on wikipedia and microsoft's website over the next few days but they can only provide limited resources. The best resources are other people who do that same thing; you know, egging each other on and inspiring each other and whatnot.

Sorry to use a crappy web-term, but in this thread you will post anything to do with C# so that anyone else who likes the idea of learning it can just drop in and flick through (I imagine it will turn out a bit like the HTML thread I started ages ago).

AndrewTaylor
7 Mar 2007, 12:43
I use C#. I like it.

I think it's mostly the same as C++, though I've never really used C++ (as opposed to plain C). It's mostly class based, anyway. It comes with a pretty swish UI creation tool, that's all drag-and-drop and pretty easy to add code into when people do things to it. For me, the best bit is the error handling: when something doesn't work it throws an exception. So this would crash:

File.Write(Names[-1]);

But this would be fine:

try {
File.Write(Names[-1]);
} catch (Exception ex) {
MessageBox.Show(ex.Message);
}

The downside to it is that anything you write in C# will require .NET (though that can also make it very portable; there are ports of .NET). In any case, it's free, so downloading it and playing about is a good place to start.

Oh, and Visual Studio's autocomplete function is brilliant. You hardly have to type anything.

SupSuper
7 Mar 2007, 20:23
I'm pretty sure try ... catch ... blocks were also in C++. Unless you mean the whole Exception class there is in C#. Dunno if that was in C++.


From my point of view, C# is just C++ with knobs on (and C++ is object-based C). Built-in functions and what not for everything that always annoyed you or required external libraries in C++. And, yes, it's .NET-based. What that exactly means is a whole bunch of technical gibberish that you probably don't need to know about, so only look it up if you want. First-hand, it means people need .NET Framework installed to try out your stuff (or Mono for other systems)

Errr... I dunno what else to tell you. Yes, C# is good. Lots of people could argue that it's not as good as stuff or not suited for stuff, but... meh, I don't care. I do what I want.

I already knew C and C++ when I learned C#. Still, if you're starting out, C# should be easier to get into. (or at least easier than C++ and C) You'll probably find some guides online, I got this online book thing which is rather neat.

Paul.Power
7 Mar 2007, 20:44
It's pretty essential if you want to play an A Major chord.

... sorry, sorry...

AndrewTaylor
7 Mar 2007, 20:58
K^2 probably hates C#.

Pigbuster
7 Mar 2007, 23:20
It's pretty essential if you want to play an A Major chord.

... sorry, sorry...
Your bad jokes are the wind beneath my wings.

Anyway, I can only tolerate actionscript.
Non-object based code just confuses me.

FutureWorm
7 Mar 2007, 23:25
It's pretty essential if you want to play an A Major chord.

... sorry, sorry...
See, personally I've always preferred Db to C#, but maybe that's just me.

M3ntal
8 Mar 2007, 04:03
C# is what happens when Microsoft steal the Delphi team off Borland and ask them to rip off Java, but to a less blatent degree than they (Microsoft) originally did with Visual J++, which they got sued for.

Result: a kind of hybrid/cross using the best bits of C++ and Java. Good language :).

Most of the stuff in C# is the exact same as in either Java or C++ (in the case of exceptions and try...catch block that were mentioned earlier, they are the same in both Java AND C++). One exception (hehe) i've found to this that i particularly like is the way attributes are defined; in C++/Java you had to declare your attribute variable as a normal class variable, then write your attribute's accessor methods (get, set) as normal class methods. C# has a much simpler, more intuitive syntax for attributes.

As for resources to teach you, check your PM ;).

Xinos
8 Mar 2007, 11:55
I once got a book for C#, and when I told my proprietary hating linux using friend over msn he just laughed and said "I hope they paid you for it".

'tis was the darkest day of my life.

SupSuper
9 Mar 2007, 00:49
K^2 probably hates C#."Probably" isn't how I'd put it. "Most completely definitely absoutely certainly" is more accurate. And I quote:
C# exists for writing business applications by hiring the cheapest coders you can find, and still ending up with a secure product. If you actually want to learn to program, avoid C# like a plague.
I have written code for very different hardware on just about every level imaginable, starting with straight up machine code and to high level languages that are not even imperative. Primarily, I have written various simulations and renderers, some for very powerful machines, some not so much. Some ran in real time, and others needed days to give you a few seconds of animation. One thing I learned better than anything is how to write efficient code for any particular machine, using every bit of advantage that hardware can provide me, and making sure that no cycles are wasted on something unnecessary. DirectX and C# do not give you that. They both cause a lot of extra unnecessary code to be executed. You can program in what you want to program, but if you ever want to write code that will push hardware to its absolute limit, you need to drop these two and learn to rely on your own code rather than flooding your program with runtime libraries.

I bet he'd code the answer to life, the universe and everything in machine code if he wanted.

Your bad jokes are the wind beneath my wings.

Anyway, I can only tolerate actionscript.
Non-object based code just confuses me.These days you'd be pretty hard-pressed to find non-object based code.

Pigbuster
9 Mar 2007, 02:06
These days you'd be pretty hard-pressed to find non-object based code.

That I didn't know that should only prove how very little I know about other coding languages.

MadEwokHerd
9 Mar 2007, 06:32
I hate C++ (It's #4).

I also hate java (that one is #7).

Oddly enough, I kinda like C# from what little I've seen of it.

But not as much as Python.

bloopy
14 Mar 2007, 07:34
I use C# and I think it's great. It's nice to code in, and it has decent performance. I prefer it over Java, and I'd rather not have to touch C++ if I can help it.

SupSuper
14 Mar 2007, 16:01
Everyone seems to dislike Java, and I have yet to see why. I suspect it has something to do with it being the language everyone learns in college. (at least around here)

AndrewTaylor
14 Mar 2007, 16:09
I've never really used Java.

I'd take C# over it, though, just because C# produces applications that look like real-life software, and Java produces applications that look like badly-put-together web apps designed by someone using a slightly different colour scheme than my computer does.

M3ntal
14 Mar 2007, 22:03
Java as a language is great, but as a platform it's a little slow due to it not compiling into native code, and as Andrew pointed out it also doesn't use the native OS's look and feel as it is OS independant, although the actual look and feel is up to the programmer - it can do a Windows-style GUI, just look at the Azureus BitTorrent client.