CrafterEric
Member
I'm just starting to learn C# specifically and only for the purpose of working on my own personal shard that runs locally. I got the ServUO Repack running with several addons such as runecrafting and tameable wyrms, and I understand enough to do basic editing, like making runecrafting super easy to do, but I really need to learn the language to be able to use it properly. I thought about several different avenues but finally stumbled on a youtube video that teaches the entire language in one course. It covers the entire language in 1.5 hours. I watch like 2 minutes, then practice it. I figure I'll watch Microsoft's Academy after this, and any further help I need I'll get reading. That should get me pretty well started, but I've run into a basic C# coding question. I realize that I'm going to have future questions, but since I'm *only* learning C# so that I can code ServUO, is it appropriate to ask basic coding questions here? Here's the type of thing I'm running into:
At around 7:50 in the video, he's describing how basic math works, and uses this code:
int i = 0;
Console.WriteLine("i++ = " + (i++));
Console.WriteLine("++i = " + (++i));
That produces the following output:
i++ = 0
++i = 2
He says that when you write the operator to the right of the variable, like i++, it shows the variable *then adds* to it, but when writing the operator to the left of the variable, like ++i. that performs the operation *and then* prints it to the screen. My question is just this:
uh, what?
Is this just the quickest way to declare a variable, then use it *and* perform a function on it all on the same line?
So a very simple question on something anyone could answer, but is this the best place to look for basic help learning C# since the only reason I'm learning is to work on ServUO? I'm happy to go somewhere else for basic info like this, but I figured since this is the only project I'll ever be working on, maybe I should just take it straight to you.
Thoughts?
At around 7:50 in the video, he's describing how basic math works, and uses this code:
int i = 0;
Console.WriteLine("i++ = " + (i++));
Console.WriteLine("++i = " + (++i));
That produces the following output:
i++ = 0
++i = 2
He says that when you write the operator to the right of the variable, like i++, it shows the variable *then adds* to it, but when writing the operator to the left of the variable, like ++i. that performs the operation *and then* prints it to the screen. My question is just this:
uh, what?
Is this just the quickest way to declare a variable, then use it *and* perform a function on it all on the same line?
So a very simple question on something anyone could answer, but is this the best place to look for basic help learning C# since the only reason I'm learning is to work on ServUO? I'm happy to go somewhere else for basic info like this, but I figured since this is the only project I'll ever be working on, maybe I should just take it straight to you.
Thoughts?