• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

NeoGAF, teach me C#

Status
Not open for further replies.

iapetus

Scary Euro Man
Apologies if this has been done before, but 'C#' isn't very NeoGAF-search-friendly.

I do not own a C# compiler of any sort. I want to get legally started on C# coding with as low an initial outlay as possible (which probably means Mono and some form of freeware dev environment rather than Visual Studio). Can anyone recommend software and reading material (books or online tutorials) to get me started?
 

sefskillz

shitting in the alley outside your window
VC# Studio Express is pretty solid and should be good for what you need. As far as learning, do you know any other languages? C# is pretty easy to pick up on, shouldn't be too bad. You can probably find tutorials online no problem and msdn is a solid resource, so you should be able to avoid buying a book.
 

iapetus

Scary Euro Man
Looks interesting. Will grab a copy as soon as I get home.

As for other languages, I'm a damn fine Java programmer and have dabbled in C and a little C++ in the past (along with a host of other languages that probably aren't at all relevant like Prolog, LISP and a handful of assemblers). C# shouldn't be a big jump, but it's always good to see everything set out so as not to miss important features or libraries.

I guess I'll start with the freebie online tutorials (anyone know of a particularly good one for someone with a decent programming background?) and VC# Studio Express, but it would be nice to know if there are any worthwhile books out there so I could have something to read when away from the computer as well...
 

sefskillz

shitting in the alley outside your window
If you know Java it should be a pretty easy jump for you syntax wise, most of what you'll want to learn is what MS offers with their libraries and little search action, msdn and intellisense should cover you there.

Is this sudden interest to learn C# related to XNA and MS's latest announcement by any chance? :)
 

iapetus

Scary Euro Man
sefskillz said:
Is this sudden interest to learn C# related to XNA and MS's latest announcement by any chance? :)
It's possible that there's a vague connection there. :D

I've been meaning to learn C# for my own nefarious purposes for a while, though (hey, it looks good on a CV, if nothing else).
 

sefskillz

shitting in the alley outside your window
Well if you are looking forward to doing some XNA development, I'd recommend going ahead and doing a little research into Managed DirectX. My understanding is that the XNA framework actually replaced the next release of the managed directx framework (xna is kinda like managed directx 2.0, i think they're targetting directx 10 with is as well). But maybe I'm just jumbling it all together.

http://www.amazon.com/gp/product/0672325969/?tag=neogaf0e-20

That's the only managed directx book I have and it's decent enough, but there are a few others out there.
 

thorns

Banned
Well I have 2+ years experience coding in C# and it's my favorite programming language so maybe I can offer you some advice..

I would recommend that you sign up at http://www.safaribooksonline.com/ for a free trial, there are some excellent c# books there to get you started. Books offer much better organized knowledge than web tutorials. If you are a good Java developer you shouldn't have much problem, most things are very similar. Look at c# specific keywords on MSDN, and read up on changes that come with .NET 2.0 as well. Somethings about C# you should read are multithreading in C# (it's rather different than in Java), delegates and events.

Also get VS 2005 Express as others stated, or VS 2005 Professional if you have access to it. I also recommend the book "Effective C#: 50 specific ways to improve your C#" for some really good advice.

Absolutely use VS 2005, it's extremely well integrated with C# and .NET in general and don't bother with command-line compilers etc, it will save you TONS of time.
 

Ghost

Chili Con Carnage!
Hmm, thanks for the tips guys, i was going to ask more questions but my background is virtually identical to iapetus' so he's covered my bases pretty well.
 

Oldschoolgamer

The physical form of blasphemy
I was about to make this same thread. Thanks for the info.

Quick question though. I have no background in coding with specific languages (the logical parts I can do), so....should I start with something else, or go ahead and read up on C#?
 

Odysseus

Banned
Oldschoolgamer said:
I was about to make this same thread. Thanks for the info.

Quick question though. I have no background in coding with specific languages (the logical parts I can do), so....should I start with something else, or go ahead and read up on C#?

I think it's a good enough place to start. It is similar to many languages, so once you learn it, it would be easier to transition to C++ or Java. VB is also a great starter language, and with .NET it has adopted many of the same structural syntax as the aforementioned languages. And, yes, I recommend the Visual Studio Express editions.
 

sprsk

force push the doodoo rock
Yeah, what's a good place to start for a newb with little experience in C++ but hasnt programmed in 6 years? I have no access to books or things one would have to pay for, so free sites would be a big help.
 

LakeEarth

Member
sp0rsk said:
Yeah, what's a good place to start for a newb with little experience in C++ but hasnt programmed in 6 years? I have no access to books or things one would have to pay for, so free sites would be a big help.
I'm exactly the same way. I haven't made a game/programmed in 5 years but this announcement definetly peaked my interest in it again. Not that I have the time to invest/waste like I did in highschool, though.
 

LakeEarth

Member
That's one of the best parts. Even if your friend doesn't have the XNA $99 subscription, or a 360 at all, no problem, just send it to him on his PC and he can play it from there.
 

volmer

Member
iapetus said:
Apologies if this has been done before, but 'C#' isn't very NeoGAF-search-friendly.

I do not own a C# compiler of any sort. I want to get legally started on C# coding with as low an initial outlay as possible (which probably means Mono and some form of freeware dev environment rather than Visual Studio). Can anyone recommend software and reading material (books or online tutorials) to get me started?

I can recommend using the online framework reference at MSDN as well as the microsoft.* usenet news groups. I've used the latter extensively for problem solving as not all Microsoft API's are entirely obvious. ;)

You'll want a good IDE. If you are studying in university, chances are they will be part of Microsoft's "Academic Alliance" program which basically, upon you giving your signature, grants you a student license to their development tools. Try getting Visual Studio 2005 that way. Otherwise I guess you have to go for either Mono or the Express edition (although I'm not familiar with the usefulness of that one)...

Good luck!
 

Odysseus

Banned
volmer said:
Try getting Visual Studio 2005 that way. Otherwise I guess you have to go for either Mono or the Express edition (although I'm not familiar with the usefulness of that one)...

VS Express editions are surprisingly more robust than you would think for freeware. Granted, they do not support everything that retail copies support, but a beginner would be good for a long while. You can compile applications into exectubables and distribute them, and you can even use the Express editions commercially if you so choose. It's really not a bad place to start.
 
Just to chime in:

As a CS major and having written code in multiple languages, I'd have to say that C# is my favorite general purpose programming language. Having written Java for 4+ years as well, I have to comment that the jump from Java to C# is relatively easy and fairly natural as C# basically took Java as a starting point and improved upon it in many ways. As for C/C++ developers, generally speaking, C# can do anything that C++ can do via unsafe code blocks that allow direct access to memory regions (typically protected by the managed .Net runtime) in addition to directly interfacing with Windows APIs via PInvoke. The language is far more like Java than C++.

To begin with, the development environment has been made "stupid-friendly" so that even programming newbies can jump in and start writing code and testing in a matter of minutes. Now you can debate whether this is good or bad (many, including myself argue that this is a bane as it means that there are an excess of sub-par "developers", but regardless, it's a well designed development environment that still has all of the advanced features used by more seasoned developers available).

In addition to this, C#, as a language, particularly in 2.0 and in the specifications for 3.0, will allow for programming constructs that are simply not possible in many other general purpose programming languages. As C# has evolved, it has started to bring in many features of functional languages (such as functions as first class objects in 3.0 spec) and dynamic languages (such as runtime type inference, also in the 3.0 spec). In fact, if you look at the C# 3.0 spec, you'll start to get the feeling that it's starting to become quite like JavaScript (a dynamically typed, functional language and my personal favorite). C# (and the .Net Framework in general) has been designed first and foremost, in my opinion, for ease of use and expediency for rapid prototyping and RAD-style development (and of course, Java elitists will knock this, but realize that it is also capable of more advanced development styles that most .Net developers simply don't utilize since they stick to what's available out of the box).

The Express products from Microsoft are top notch. Considering that they are free, they are pretty ****ing sweet (I myself don't use them day to day as I use the full retail versions, but I've tried all of the Express products and they are basically castrated versions of the full blown product with some usage and licensing limitations).

For learning C#, in my opinion, the absolute best book to start with is Pro C# 2005 and the .NET 2.0 Platform, Third Edition. This book covers many aspects of the .Net Framework that every .Net platform developer should be aware of. It leads by simple *running examples* with full source code and contains a wealth of information on advanced topics that are not touched upon by many lesser books. I've found, after reading this book, that every "advanced" .Net platform question that I've been asked on interviews in the last 2-3 years is covered by this book. Fear not, though, the information and examples are well written and well thought out so that it's easy to follow and not only for "Pros" as the title would suggest.

As for how to start with .Net development, as I mentioned, C# and .Net are "stupid-friendly". This means that generally, for beginners, command line compiling is a thing of the past; you simply download Visual C# Express (it will install C# compilers and tools for you), create an appropriate project type (Console application is a good place to start), fill in some code, and hit Ctrl+F5 to run your code. It's literally that simple to get started. Visual Web Developer Express versions should also include a built in web server that it uses by default when running web code so setup is trivially easy if you're interested in that.

As a reference, it's a good idea to pick up the .Net Framework SDK as it contains documentaion and additional tools that are userful for all developers: http://www.microsoft.com/downloads/...FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC

sp0rsk said:
Yeah, what's a good place to start for a newb with little experience in C++ but hasnt programmed in 6 years? I have no access to books or things one would have to pay for, so free sites would be a big help.

Microsoft also has a subsite dedicated to kind of teaching beginners how to write code with more interesting examples (articles on the 'Net and in books typically cover console applications to demo language features and use business application examples otherwise as most users are are professional developers), including game code: http://msdn.microsoft.com/coding4fun/. So Coding4Fun is a good place to start with more interesting code examples in .Net.

There's a link off of the Coding4Fun main page to a series of webcasts on video game development in C# and a two part series on how to write Soduku in C#, WPF (next generation presentation API for .Net), and XAML.

In the past, I've also taken a look at .Net games development. One of the engines I was looking at was the Axiom engine (which seems to be inactive). You can find other engines via Google.

Ah yes, and the other engine that I had looked at was formerly known as RealmForge and currently known as Visual3D.Net, which used to be completly free (but now has a few different tiers). Of course, you won't need these once XNA comes out, but in the mean time, if you have interest in trying to write games on the .Net platform, these are good places to get a head start.
 

bluemax

Banned
iapetus said:
Looks interesting. Will grab a copy as soon as I get home.

As for other languages, I'm a damn fine Java programmer and have dabbled in C and a little C++ in the past (along with a host of other languages that probably aren't at all relevant like Prolog, LISP and a handful of assemblers). C# shouldn't be a big jump, but it's always good to see everything set out so as not to miss important features or libraries.

I guess I'll start with the freebie online tutorials (anyone know of a particularly good one for someone with a decent programming background?) and VC# Studio Express, but it would be nice to know if there are any worthwhile books out there so I could have something to read when away from the computer as well...

I just wanted to say that in my brief exposure to Prolog I really really did not like it.

But I blame that on the professor.
 

jgkspsx

Member
iapetus said:
it would be nice to know if there are any worthwhile books out there so I could have something to read when away from the computer as well...
Effective C# by Bill Wagner is a really great book about best practices (admittedly with a slant towards business apps). Since you're an experienced programmer in another language, it should be perfect for you.

Also,
CharlieDigital said:
As a CS major and having written code in multiple languages, I'd have to say that C# is my favorite general purpose programming language. Having written Java for 4+ years as well, I have to comment that the jump from Java to C# is relatively easy and fairly natural as C# basically took Java as a starting point and improved upon it in many ways. As for C/C++ developers, generally speaking, C# can do anything that C++ can do via unsafe code blocks that allow direct access to memory regions (typically protected by the managed .Net runtime) in addition to directly interfacing with Windows APIs via PInvoke. The language is far more like Java than C++.
IAWTP. C# is an exciting and efficient language to program in -- easy to learn and capable enough for almost anything.

OTOH, it might make things a little too easy... I feel better off for having learned on lower-level and assembly languages, myself.
 

Phoenix

Member
C# is a cool language that can be fairly easily mastered if you've got any experience in computer science, have taken a programming languages course, or have looked at Java in the past.

Its got a fairly robust library for building most types of applications, deals with memory management itself (which is what kills many newbie-average C/C++ developers), has decent tooling via Visual Studio, and is a good language to learn overall.


Its always good to know more than one language - keeps your eyes open to different ways of doing things as no one language is perfectly suited to everything (though you may be able to build anything with any language).
 
and dynamic languages (such as runtime type inference, also in the 3.0 spec).

As far as I know, what is in the 3.0 spec is (a limited form of) compile-time type inference, which is a feature that originated in statically typed functional languages like ML and Haskell; it's not a "dynamic language" feature.
 

sefskillz

shitting in the alley outside your window
Bizarro Sun Yat-sen said:
As far as I know, what is in the 3.0 spec is (a limited form of) compile-time type inference, which is a feature that originated in statically typed functional languages like ML and Haskell; it's not a "dynamic language" feature.
LINQ?
 

Yeah. The principal designer of LINQ, Eric Meijer, did a lot of work in and on Haskell. He wrote an amusing paper -- "Confessions of a Used Programming Language Salesman" --- narrating the road that led him to LINQ. In it he says something like "I had to sell my soul to the most popular company (Microsoft), the most popular language (VB), and the most popular paradigm (objects) to save the common programmer"
 

iapetus

Scary Euro Man
Finally got my arse in gear and signed up for the XNA Creators Club. And after an afternoon's worth of intermittent work, I'm driving a little tank around the screen (with the traditional tank-style push-both-sticks-forward-to-go-forward controls, naturally) spewing bullets all over the place. It's actually kind of fun, even without any actual gameplay. I guess the next step is to add some enemies and some collision detection, but that's a job for another day.
 
quick question. I come for a VB 6 and VB.net background, and for the things I want to do in my programing, I feel really limited. I want to make games and while thats entirely possible to do on VB its just I feel like I'm bending over backwards to do them, so my question is, I want to move onto a C language, which one should I start with C, C++, or C#? I'm firmillar with .net so I was leaning towards C#? Also I've learnt a little bit on Direct X for vb.net will anything carry over to which ever C language I go with?
 

empanada

Member
Father_Mike said:
quick question. I come for a VB 6 and VB.net background, and for the things I want to do in my programing, I feel really limited. I want to make games and while thats entirely possible to do on VB its just I feel like I'm bending over backwards to do them, so my question is, I want to move onto a C language, which one should I start with C, C++, or C#? I'm firmillar with .net so I was leaning towards C#? Also I've learnt a little bit on Direct X for vb.net will anything carry over to which ever C language I go with?
Yeah, go with C#. Your transition will be a lot easier. And it comes with all the benefits of OOP languages.

C/C++ is probably be more suited to game programming because there's more code tweaking/hacking opportunities available and every little bit of performance boost / memory management helps in games.
 
Status
Not open for further replies.
Top Bottom