Programming for Idiots (C#) - Take 2

12/19/2010 11:40 MoHdElX#46
I think this tutorial is not very good, use the openbooks, these are better.
12/19/2010 11:47 InfamousNoone#47
Quote:
Originally Posted by MoHdElX View Post
I think this tutorial is not very good, use the openbooks, these are better.
This is not very descriptive :rolleyes:. Can you explain why it's not well written, or why you would prefer using (what I assume is) books over this tutorial?

Edit:
Looking into what this "openbook" is -- he's refering to the following:
[Only registered and activated users can see links. Click Here To Register...]

The biggest problem with this is the vast majority of the CO2-Community does not speak Dutch (or German). I'd also argue that because my guides aren't written in a sound-professional manor, it makes it more user-friendly, and easier for people to understand. I'd put money of the fact the OpenBook guide doesn't cover pointer-usuage as well. I'm yet to see a tutorial aimed at C# that does.
12/19/2010 16:07 tanelipe#48
I might as well sticky this now since it's going to be stickied eventually. Do you want the other thread to remain stickied, merged with this or un-stickied?
12/19/2010 16:46 InfamousNoone#49
You can unsticky the older thread. Thanks a lot in advance.

Edit:
Added Lesson Six - Delegates and Lambda Expressions
Added Lesson Seven - Properties and Modifiers
12/21/2010 06:26 xScott#50
looking good, lambda expressions always confused me,
you going to briefly touch events?

keep up the good work men!
12/21/2010 07:12 InfamousNoone#51
Event's have practically been superseded by the Observable class in .NET 4.0. I don't see a real need for them any more. This class will be talked about in Unit 3.

Really, all you need to understand about lambda's is they're a short hand way of writing delegates. And essentially what is a delegate? A delegate is type used to represent a function.

So when someone writes:
Code:
(x) => x + 1;
What they're really saying is most likely:
Code:
int _method(int x) { return x + 1; }
12/21/2010 17:52 xScott#52
Quote:
Originally Posted by InfamousNoone View Post
Event's have practically been superseded by the Observable class in .NET 4.0. I don't see a real need for them any more. This class will be talked about in Unit 3.

Really, all you need to understand about lambda's is they're a short hand way of writing delegates. And essentially what is a delegate? A delegate is type used to represent a function.

So when someone writes:
Code:
(x) => return x + 1;
What they're really saying is most likely:
Code:
int _method(int x) { return x + 1; }
pretty cool, cheers for the info.
keep up the good work man!
12/21/2010 19:21 unknownone#53
Quote:
Originally Posted by InfamousNoone View Post
So when someone writes:
Code:
(x) => return x + 1;
That aint valid lambda syntax. The return keyword there is unnecessary and won't compile. You can say x => x+ 1, or x => { return x + 1; }. The braces are necessary in the case of multi-statement lambdas or those returning a unit.

Also, in your delegates lesson, you mention that they're "safe function pointers". You miss out the major differences, that a method also has an object instance associated with it. One might call the C++ equivalent a functor. Delegates also hold an invocation list and are capable of assigning many methods to a single instance (the MulticastDelegate), where a native function pointer is single-dispatch only.

You should probably mention the special delegates Func<> and Action<> too, since they play a major role in lambdas.
12/22/2010 02:44 InfamousNoone#54
Quote:
Originally Posted by unknownone View Post
That aint valid lambda syntax. The return keyword there is unnecessary and won't compile. You can say x => x+ 1, or x => { return x + 1; }. The braces are necessary in the case of multi-statement lambdas or those returning a unit.
Oh, damn, you're right. I'll get that fixed.

Quote:
Originally Posted by unknownone View Post
Also, in your delegates lesson, you mention that they're "safe function pointers". You miss out the major differences, that a method also has an object instance associated with it. One might call the C++ equivalent a functor. Delegates also hold an invocation list and are capable of assigning many methods to a single instance (the MulticastDelegate), where a native function pointer is single-dispatch only.
I think in that case it's worth getting a Delegates (II) done, which I'll do today. I didn't want to go too indepth with the C++-analysis/difference because it's bad to assume the reader has knowledge of C++, but I have an idea how I'll get that fixed.

Quote:
Originally Posted by unknownone View Post
You should probably mention the special delegates Func<> and Action<> too, since they play a major role in lambdas.
I can't mention either of those yet as generics haven't been covered.

Thank a lot for the support. Will get the changes done today.

Added:
Lesson Eight - Delegates(II)
Lesson Nine - Generics and Delegates(III) -- 12/26/10
12/31/2010 22:45 InfamousNoone#55
I'll continue with this starting tomorrow. Took a 5-day break to conduct some "research" (not particularly pertaining to events/topics contained in this thread). I'll try to see if I can get something up before I go out today but... I won't guarantee anything. However, come January (the 1st) I'll be starting again.
01/01/2011 19:47 MatthiasObran5594#56
I'm probably going to get flamed for this and shit, but can you program CO Private Servers using C#? I tried learning C++ but that's fuckin' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
01/01/2011 20:32 .Kinshi#57
Quote:
Originally Posted by MatthiasObran5594 View Post
I'm probably going to get flamed for this and shit, but can you program CO Private Servers using C#? I tried learning C++ but that's fuckin' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
Read these things and practice, once you get the basics down you can attempt a server.
There's also sources released all over here that you can look at and learn from.

You can also add me on msn: [Only registered and activated users can see links. Click Here To Register...]

When I'm free I help out a few people.
01/03/2011 03:55 pro4never#58
Quote:
Originally Posted by MatthiasObran5594 View Post
I'm probably going to get flamed for this and shit, but can you program CO Private Servers using C#? I tried learning C++ but that's fuckin' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
If you take a look at the private server sources you'll notice that for conquer anyways almost all of them are written in C#.

C# is perfectly capable of running a conquer pserver (as is java, C++ and a large number of other programming languages). As many more experienced programmers will tell you (translation: snobbish programmers) ANY programming languages has its ideal uses... it's debatable about if C# is truly ideal for a private server situation but the fact remains that using C# you will have a FAR greater set of example resources (both programmers and actual code examples). C# does sacrifice some performance but lets face it... unless your server is all of a sudden being pounded by like 1000 players on a single server you will NOT have a huge issue with C# (again... anyone can program something shitty in C#... or C++ and have it lag out and not be efficient. I'm talking about a PROPERLY written source here using all the language can offer)


So yes...

C# is fine and much simpler for most people to learn than C++. Sure, some people pick up C++ without any issue but lets face it... the average person will find C# a tad more forgiving and simple.
01/04/2011 04:29 ahsanahsan#59
@InfamousNoone
I got a suggestion:
Wouldn't it be great if you put all the files into one folder? I know they only take about 1-3 sec to download each lesson but instead of clicking each lesson you would just download one folder that would have all of the files inside for each Unit?
01/11/2011 18:19 tanelipe#60
Tutorials stopped?