# [FAQ] A Beginners Guide to Programming, C#.



## Licht

*Part 4 : Data Type Conversion, Explicit and Implicit*

Often you have the need to have 1 type of data be another type. For example you need to display an integer in a string. To do this you would use an explicit data type conversion. In this example you will see a message box displaying the value of an integer using explicit data type conversion.

Code:



Code:


int myint = 75;
MessageBox.Show("myint = " + Convert.ToString(myint));

Simple enough, even simpler is implicit data type conversion. This doesn't really need conversion at all, you just enter the values into the code as if they were the same data type. This can rarely be used, unless you are dealing with a 32bit and 64bit integers you will need to use explicit conversion instead.

I'm sure you are wondering why you need to do this. To make it simple, the data is stored in the RAM in different formats. Just like jpg images and gif images are saved in different formats. You can't open a gif image in a program that doesn't support it, same as you can't reference a string as a number.

*Part 5 : Arrays, Matrices, and More*

This is where it gets interesting, an array is basically a list. Using coordinates you can find what data is located in a position on that list. For example lets imagine the array as a series of dots. Each dot contains a value. It would look something like this.










Dot 1 is equal to 10. Dot 2 is equal to 12. And so on. This can be unimaginably useful. For example we have the user tell us a series of muffins 0-8 and each muffin he inputs a string telling us what kind it is. Then in code we enter it into out application. It would look like this.

Code:



Code:


string[] myarray = new string[6];
myarray[0] = "blueberry";
myarray[1] = "plain";
myarray[2] = "raspberry";
myarray[3] = "chocolate";
myarray[4] = "mixed berry";
myarray[5] = "all berries";

string[] specifies we are initializing an array. String declares it will be an array full of strings and [] tells us it is one dimension (this will be explained later.) Then we use an = sign followed by new, new is a keyword that must be used here. Then we declare its size in string[6]. The [6] means it will have 6 coordinates, 0 - 5.

Ok next we will cover Matrices. A matrix is a 2 dimensional array. We have all seen those tables where you have the answer to multiplication questions. You know 1 horizontal coordinate and a vertical one. Using these two coordinates you could find the value of one number times another. This is exactly what a matrix is. For example i will use this diagram, with coordinates marked.










To initialize and use a matrix we code like this :

Code:



Code:


int32[,] mymatrix = new int32[2,2];
mymatrix[0,0] = 0;
mymatrix[0,1] = 0;
mymatrix[0,2] = 0;
mymatrix[0,0] = 0;
mymatrix[1,0] = 0; //Note i didn't set all the coordinates to show you don't have to.

To mark that an array is a matrix we use a coma in the braces. For every coma you add you are adding a dimension. If you used 2 comas for example you could form a 3 dimensional array. Using a matrix you could for example label muffins, and also tell where they were on the cookie sheet by assigning each 2 coordinates based on their number in vertical and horizontal columns of the cookie sheet.

*Part 6 : Loops*

A loop is a section of code that is repeated until a given value is met. There are a few times of loops out there but we will focus on 2 specifically. For and while. Loops are one of the most useful aspects of programming. They can be used for anything from searching for prime numbers to checking how many friends you have on a list. Lets begin with the while statement. Lets say you want to repeat some code until a value reaches a certain point, and keep track of how many times it took. One way to do this is to use a while statement.

Code:



Code:


int Fnumber = 0;
int Snumber = 2;
while (Snumber < 10)
{
Fnumber += 1;
Snumber += 1;
}
MessageBox.Show("Finished, it took " + Convert.ToString(Fnumber) + "repetitions to make the second number equal to 10.");

Now lets look at the for statement with the same task.

Code:



Code:


for(int i = 0; Snumber < 10; i++)
{
Snumber += 1;
}
MessageBox.Show("Task complete, it took" + Convert.ToString(i) + "repetitions to complete.");

I think this deserves a bit of an explanation. Unlike the while statement for is a bit hard to just up and read without an explanation. The first argument in for is often used to declare a variable used in the loop. This variable is often named i, its kind of like tradition. This code here is ran before the loop, then never again. The next argument (separated by a semicolon) is the requirement for the loop to run, as long as this requirement is met the loop will keep going. If it is not met the loop will cease. The next argument is executed each time the loop runs. This is often used to increase the value of i. This is because unlike what we used here i is often used to set the number of times the loop runs. To demonstrate the more common use heres an example.

Code:



Code:


for(int i = 0; i < 10; i++)
{
MessageBox.Show("Every iteration (cycle, repetition) i is increased by 1 (this is done by ++ which effectively means += 1) until it reaches 10. Since we started at 0 it takes exactly 10 cycles to get there.")
//The above message box is shown 10 times before the loop ends.
}

*Part 7 : Threading (Explanation Only)*

I want to start out by saying i'm only covering the basics of threading. This is a difficult topic for most people and honestly doesn't belong in a beginner's guide but it is a crucial part of programming i think no one should do without learning for any reason. A thread, to the CPU, is a sequence of code to be executed. Each application by default has a single thread and windows divides up how much time each thread gets on the CPU based on its priority level and how active the CPU is verses the needs of the application. For example if you use two threads, this effectively allows you to split the workload between them and make your program work on 2 cores at once, or 4 threads can use quad cores. Note that it takes up CPU cycles to control threading, so if your not talking about major CPU tasks it may actually sacrifice performance to use multiple threads regardless of how many cores are on the machine. Note i won't be providing how to multi-thread, or manage the main thread. None of that belongs in a beginners guide, probably shouldn't have even mentioned it. At a later time i may write an independent FAQ concerning threads. Until that time this is all i will provide.


----------



## Licht

*Part 8 : Knowledge Application*

Now that we've covered most of it all, its time to look at an application and use it to further your understanding of the previously studied concepts. We will cover a few basic assignments with full explanation.

The first is how to return the remainder of 2 numbers when divided. The second is use of data type conversions for reasons more then just converting the data type. The third is adding 2 matrices.

Code:



Code:


int 1int = 5;
int 2int = 9;
int 3int;
3int = 2int % 1int;

This returns the remainder of 9 / 5 (4) to the integer 3int. The % operator returns the remainder of the first number divided by the second.

Code:



Code:


Double mydouble = 1.337;
int myinteger = 3;
while (true) //The while statement with the value true as an argument signals an infinite loop, broken only by the break statement.
{
    if (mydouble == myinteger / 3)
    {
        break;
    }
    else
    {
        mydouble = Convert.ToDouble(Convert.ToInt32(mydouble));
    }
}

In this code we removed the decimal places from a floating point by converting to an integer.

Code:



Code:


int position = 0;
int[,] 1matrix = new matrix[2,2];
int[,] 2matrix = new matrix[2,2];
for(int i = 0; i < 3; i++)
{
    for(int o = 0; o < 3; o++)
    {
        1matrix[(i - 1),(o - 1)] += 2matrix[(i - 1),(o - 1)];
    }
}

Pay careful attention to this code, do not proceed until you understand it. I will let you figure it out on your own, i feel it is a crucial part of the learning process.

*Part 9 : Optimization*

Optimization is a crucial part of programming, especially with loops. Optimization is all about minimizing CPU cycles. For example division is said to take many CPU cycles, this is because as we do the CPU tests each number to see if it can divide a number over and over until it finds the answer. This consumes much power. So 6 / 2 is 3 (3 CPU cycles) times slower approximately then 6 * 0.5 (about 1 cycle.) Division is one of the floating point operations. All floating point operations are very slow and hence you want to avoid them. As i said before floating points themselves are the single, double, and decimal data types. The fastest data type is an integer, so you are going to want to use them whenever possible instead of floating points.

Another point i want to make here is AMD's K8 architecture is heavily geared towards floating points over Intel's architectures. Just an interesting bit of info.

*Part 10 : Finishing Touches*

Thanks for reading the guide, hope it helps allot of people who want to learn how to program. I spent my entire day on this (







?) and i think i did a decent job, any suggestions for additions or questions post or PM me pending your judgment on which it deserves. Programming is a truly great field to partake in. It is allot of fun and challenging mentally to boot (and sometimes physically, oh the longs nights spent over a hot mouse... then you pass out during the 37th debug run.) Heres some helpful links i use often, enjoy.

http://msdn.microsoft.com/en-us/library/default.aspx

http://www.wikipedia.org/

http://forums.microsoft.com/msdn/default.aspx?siteid=1

http://www.microsoft.com/express/

http://msdn.microsoft.com/en-us/vcsharp/default.aspx


----------



## XxSilent22xX

Awesome man







I cant wait untill it is done


----------



## x2s3w4

Hey Licht, Thank you Thank you Thank you Thank you Thank you Thank you
Rep+
I just started looking for something just like THIS!
Now FINISH IT!!


----------



## Licht

All finished, enjoy.


----------



## afzsom

+


----------



## RedFox911

Great job licht!


----------



## -iceblade^

Sweet, man... i've been wanting to learn how to program for ages, and this will help loads, esp since i can get the stuff off of Dreamspark...


----------



## DuDeInThEmOoN42

Awesome!


----------



## blade007

bookmarking this


----------



## version2

I don't like your thinking of arrays at all. You should be using a topological approach to support the understanding of multi-dimensional arrays. I'll start by asking you about: how do you think of 4 dimensional arrays?

And you don't have an answer because you can't... except by thinking of this: variable[2][8][3][7];
Which doesn't help.

So, I highly recommend for new programmers to think of arrays as a tree diagram. Every new dimension is a new split in a tree. Try drawing it out and you'll see you'll be able to draw as many dimensions beyond 3... Sweet. (Now you can go to some bar and bet people there that you can draw something with 10 dimensions...)


----------



## jinja_ninja

Very nicely done.

I don't have the "knack" for coding at all. Tried it many times at college...

I will stick to HTML and Hardware


----------



## Licht

Quote:


Originally Posted by *version2* 
I don't like your thinking of arrays at all. You should be using a topological approach to support the understanding of multi-dimensional arrays. I'll start by asking you about: how do you think of 4 dimensional arrays?

And you don't have an answer because you can't... except by thinking of this: variable[2][8][3][7];
Which doesn't help.

So, I highly recommend for new programmers to think of arrays as a tree diagram. Every new dimension is a new split in a tree. Try drawing it out and you'll see you'll be able to draw as many dimensions beyond 3... Sweet. (Now you can go to some bar and bet people there that you can draw something with 10 dimensions...)

My thinking of arrays is to help the user understand the way they can use coordinates. Using a tree for a 2 dimensional array wouldn't totally encompass the understanding of these uses. For example your listing numbers in rows of ten. Every y x's value is increased by 10 because of this (x being horizontal coordinate y being vertical.) On a tree that could look confusing, but imagining it how it is (a plain) will yield instant "ok i understand that, simple" responses.


----------



## rabidgnome229

Quote:



Originally Posted by *version2*


I don't like your thinking of arrays at all. You should be using a topological approach to support the understanding of multi-dimensional arrays. I'll start by asking you about: how do you think of 4 dimensional arrays?

And you don't have an answer because you can't... except by thinking of this: variable[2][8][3][7];
Which doesn't help.

So, I highly recommend for new programmers to think of arrays as a tree diagram. Every new dimension is a new split in a tree. Try drawing it out and you'll see you'll be able to draw as many dimensions beyond 3... Sweet. (Now you can go to some bar and bet people there that you can draw something with 10 dimensions...)


His way is a good method of beginning to understand multidimensional arrays. It is unfeasible with higher numbers of dimensions, but if you really need to think critically about multidimensional arrays its best to think about how they are layed out in memory (linearly) rather than trying to wade through trees. If you try to do it with trees you run into a different problem - a 10x10x10 array already has 1000 leaves and would be way too dense to actually be a useful visual.


----------



## DjQurt

argh i cant get past the first step! when i open toolbox nothing is in there and i can find buttons to drag! help me licht!


----------



## Licht

Quote:



Originally Posted by *DjQurt*


argh i cant get past the first step! when i open toolbox nothing is in there and i can find buttons to drag! help me licht!


Have you created a new Windows Forms project?


----------



## alawadhi3000

Awesome, REP+

from what I see is that C# is a combination of C++ and VB codes right?


----------



## Licht

Quote:



Originally Posted by *alawadhi3000*


Awesome, REP+

from what I see is that C# is a combination of C++ and VB codes right?


No C# is a combination of C++ and Java. Nothing like VB in the slightest if you get into either more then just the up front images.


----------



## alawadhi3000

Quote:


Originally Posted by *Licht* 
No C# is a combination of C++ and Java. Nothing like VB in the slightest if you get into either more then just the up front images.

I saw the messagebox is same as VB and got confused

I didn't try C# yet as the college requires c++, VB and JAVA only


----------



## Licht

Quote:


Originally Posted by *alawadhi3000* 
I saw the messagebox is same as VB and got confused

I didn't try C# yet as the college requires c++, VB and JAVA only

That's because there both .Net languages.

Weird college, most i have heard of have C# classes.


----------



## rabidgnome229

Quote:



Originally Posted by *Licht*


That's because there both .Net languages.

Weird college, most i have heard of have C# classes.


Really? What school? My classes are all cross-platform languages and most are taught in non-windows classrooms. unix for programming ftw


----------



## Licht

Quote:



Originally Posted by *rabidgnome229*


Really? What school. My classes are all cross-platform languages and most are taught in non-windows classrooms. unix for programming ftw


I haven't seen the colleges but i talk to people and they'll tell me they took a C# class in college or thought about it.


----------



## FearMeansControl

engineering school = C++ for the first two semesters or you go for liberal arts somewhere else =)


----------



## Licht

Quote:



Originally Posted by *FearMeansControl*


engineering school = C++ for the first two semesters or you go for liberal arts somewhere else =)


What does that have to do with anything?


----------



## Krunk_Kracker

Any thoughts on plagiarism; please bring them to the attention of the oc.net staff so that we can handle this in the correct manner.


----------



## wierdo124

Sweet licht, unfortunately i still am hopeless doing this stuff.







rep+!


----------



## Licht

Quote:



Originally Posted by *wierdo124*


Sweet licht, unfortunately i still am hopeless doing this stuff.







rep+!


Uh.... what rep?


----------



## fraudbrand

I am horrible at math should I give up my coding dreams ?


----------



## rabidgnome229

Quote:



Originally Posted by *fraudbrand*


I am horrible at math should I give up my coding dreams ?


Give programming a shot - you can always give up on your dreams later








There is a lot of math in computer science, but it's mostly large quantities of very easy math. The vast majority of the "math" is adding or subtracting integers from one another - any competent second grader has the skill set needed for most logic-driven programing. Except for gaming, scientific simulation, and a few other types of problems there isn't anything more complicated mathematically than some algebra. User apps will never touch trig or calc or anything like that


----------



## wierdo124

Whoops, now rep+


----------



## kdbolt70

Licht, I liked your guide, and appreciate you writing it up for everyone interested in programming. I'm still kind of undecided on whether or not C# is a good first language to learn, because it is very high level and hides much of what goes on behind the scenes. I started with C++, which I think might be more beneficial for people to initially become familiar with. It scares me a little that people could jump into C# and code without ever having the concept of pointers introduced to them.

One thing I wanted to point out about your guide is its essential lack of objected oriented programming. You mention some base datatypes, and kind of show how they behave, but you have no reference to classes, objects, structures, inheritance, etc. This is essentially the essence of modern programming; the ability to define your own object types. It definitely should be discussed before a new programmer even hears the word threading







.

I know there's so much to cover that its hard to even attempt to build an all-encompasing guide, but new programmers are going to have to learn it one way or another. A friend of mine is just starting college as a CS student, and they are starting him off in Java. He's totally lost because the prof is jumping all over the place with different vocabulary without really putting the pieces together. That foundation is vital for becoming a proficient programmer in the future. It also turns 90% of people off to programming, which is also scary.

Perhaps if I have time I'll work on an addendum to your guide, if people are interested.


----------



## Licht

Quote:



Originally Posted by *kdbolt70*


Licht, I liked your guide, and appreciate you writing it up for everyone interested in programming. I'm still kind of undecided on whether or not C# is a good first language to learn, because it is very high level and hides much of what goes on behind the scenes. I started with C++, which I think might be more beneficial for people to initially become familiar with. It scares me a little that people could jump into C# and code without ever having the concept of pointers introduced to them.

One thing I wanted to point out about your guide is its essential lack of objected oriented programming. You mention some base datatypes, and kind of show how they behave, but you have no reference to classes, objects, structures, inheritance, etc. This is essentially the essence of modern programming; the ability to define your own object types. It definitely should be discussed before a new programmer even hears the word threading







.

I know there's so much to cover that its hard to even attempt to build an all-encompasing guide, but new programmers are going to have to learn it one way or another. A friend of mine is just starting college as a CS student, and they are starting him off in Java. He's totally lost because the prof is jumping all over the place with different vocabulary without really putting the pieces together. That foundation is vital for becoming a proficient programmer in the future. It also turns 90% of people off to programming, which is also scary.

Perhaps if I have time I'll work on an addendum to your guide, if people are interested.


A cooperative project would be very interesting. Between the two of us we could get much more written down and properly explained.


----------



## Licht

I am very sorry i seem to have removed the images used in this guide. I will replace them as soon as i have the time (currently doing some repair and organization.) Sorry for the inconvenience to the member who PMed me and to anyone else troubled.


----------



## Licht

Fixed, sorry once more for the interruptions.


----------



## komsinica




----------



## komsinica

Licht, this was very good for starters. I have a clue now. I still don't understand some of the stuff you talked about, but I am sure I will figure it out as I continue to learn.

I tried the first example you showed. When I compiled, a text message with "hello world" and "oK" button shows right away, and not my original form. So, when I click "ok", then my original form shows up. When I click the button on the original form, nothing happens. I am a bit confused. I thought it was supposed to work differently.


----------



## komsinica

Quote:



Originally Posted by *komsinica*











Licht, this was very good for starters. I have a clue now. I still don't understand some of the stuff you talked about, but I am sure I will figure it out as I continue to learn.

I tried the first example you showed. When I compiled, a text message with "hello world" and "oK" button shows right away, and not my original form. So, when I click "ok", then my original form shows up. When I click the button on the original form, nothing happens. I am a bit confused. I thought it was supposed to work differently.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
MessageBox.Show("hello world");

}

private void button1_Click(object sender, EventArgs e)
{

}
}
}

Thi sis the way the code looked. I just put the line in the middle, all the rest was already there when Iopened the button code.


----------



## Licht

I'll get to you in the morning. It is very late here and i just want to tell you, yes i know you asked a question.


----------



## komsinica

Quote:



Originally Posted by *Licht*


I'll get to you in the morning. It is very late here and i just want to tell you, yes i know you asked a question.



I am new here, and I found the site by looking for C# guide for begginers. Then I joined. I am amazed by how many posts you have here. Where do you get the time? Well, doesn't really matter, thank you anyway.

Do you know a good book for a bran new object oriented programmer? I have programming experience, but no OO, and it has been a while since I programmed anyway, I am a bit rusty on the terminology.

And just a few questions from your guide's data types:
What are Unicode Charatcters?

Doubles: -5.0X10-324 to 1.7X10308 (I have no idea what this means). Is this negative 5 times 10 to the power of negative 324, and 1.7 times 10 to the power of positive 308?

Same question with decimals?

Floats: same question.

I also don't get the difference between these 3 types. Integers I get, they are simply whole numbers within the limits ou defined, right?

Boolean, in the code do you use 1 and zero, or "true" and "false", or both.

thank you so much.


----------



## Licht

Quote:



Originally Posted by *komsinica*


I am new here, and I found the site by looking for C# guide for begginers. Then I joined. I am amazed by how many posts you have here. Where do you get the time? Well, doesn't really matter, thank you anyway.


They aren't all in coding and programming buddy. But i'll see what i can do for you now that i am available.

Quote:



Code:


Code:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            MessageBox.Show("hello world");

        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}

Thi sis the way the code looked. I just put the line in the middle, all the rest was already there when Iopened the button code.


You've called the button click event but done nothing with it. For example if you wanted to make the button display a message box. You should do this.

Code:


Code:


private void button1_Click(object sender, EventArgs e)
         {
 messagebox.show("Message shown");
         }


----------



## Licht

Considering a guide overhaul and massive extension. Anyone want to support this thought?


----------



## afzsom

Talk to me on Xfire/MSN about it Licht.


----------



## bomfunk

Quote:


Originally Posted by *Licht* 
Considering a guide overhaul and massive extension. Anyone want to support this thought?

Yes please. Things you need to include/cover:

File input/output


Working with the "form objects" (get into basic things like how to add items to list boxes and so on to give a basic understanding of how to work with them)

...something else


----------



## Tech-Boy

Quote:



Originally Posted by *Licht*


Considering a guide overhaul and massive extension. Anyone want to support this thought?


Yes that would be extremely helpful!


----------



## Licht

Quote:



Originally Posted by *Tech-Boy*


Yes that would be extremely helpful!










Been working on it lightly (progress not posted in thread.) Will keep you guys updated when i have something to post. Hate using OCN's editor.


----------



## i_ame_killer_2

Quote:


Originally Posted by *Licht* 
Been working on it lightly (progress not posted in thread.) Will keep you guys updated when i have something to post. Hate using OCN's editor.

Looking forward to it


----------



## Dethredic

Nice.


----------



## Licht

Quote:


Originally Posted by *Dethredic* 
Could you also do something on objects, because I still fail to understand them fully.

I'll add it to the list of things to write about.


----------



## Cyberbot

This_is_AWESOME!


----------



## Licht

Quote:



Originally Posted by *Cyberbot*


This_is_AWESOME!


You misspelled two spaces. (Signature reference.)


----------



## chatch15117

Nice, but I would've started off with Console.writeln("Hello World!"); and then moved on to forms.


----------



## TheLastPriest

Dont mind me...just subbing it for future reading


----------



## void

Just gotta say this is an awesome guide/FAQ, thanks!


----------



## mykah89

In case anyone is looking for a book for self reading, i strongly recommend

Microsoft Visual c# step by step 2010 by John Sharp

Im almost done with it and it has been great.


----------



## Rebellion88

Nice one, this really has motivated me to get back into some programming might start with some VB.


----------



## gcampton

edited


----------



## pepejovi

Nice guide, it amazes me how much time it takes for teachers to teach this stuff at school, considering it took our class 2 courses to get to doing classes & constructors.

Each course is a couple months long with 8 hours per week in the first course and 4 in the second.


----------



## error10

Quote:



Originally Posted by *pepejovi*


Nice guide, it amazes me how much time it takes for teachers to teach this stuff at school, considering it took our class 2 courses to get to doing classes & constructors.

Each course is a couple months long with 8 hours per week in the first course and 4 in the second.


That's because the classes are designed for people who have no business being anywhere near a computer, let alone attempting to write programs, and these people need a lot of time to learn enough of the material to pass the exams.


----------



## Warhaven

Nicely done. My only quip is the break; used in the while-loop example. Using break outside of a switch() statement is considered bad form according to most programming guidelines (along with continue and goto). I feel this would be a better example and achieves the same goal:

Code:



Code:


Double mydouble = 1.337;
int myinteger = 3;
while (mydouble != myinteger / 3)
{
    mydouble = Convert.ToDouble(Convert.ToInt32(mydouble));
}


----------



## assaulth3ro911

Why isn't this stickied?


----------



## Licht

Quote:


> Originally Posted by *Warhaven*
> 
> Nicely done. My only quip is the break; used in the while-loop example. Using break outside of a switch() statement is considered bad form according to most programming guidelines (along with continue and goto). I feel this would be a better example and achieves the same goal:
> 
> Code:
> 
> 
> 
> Code:
> 
> 
> Double mydouble = 1.337;
> int myinteger = 3;
> while (mydouble != myinteger / 3)
> {
> mydouble = Convert.ToDouble(Convert.ToInt32(mydouble));
> }


I wrote this when I was like 15 so forgive me.








Quote:


> Originally Posted by *assaulth3ro911*
> 
> Why isn't this stickied?


It used to be stuck. I guess it got lost in the database migration.


----------



## {Unregistered}

Quote:


> Originally Posted by *Licht*
> 
> I wrote this when I was like 15 so forgive me.
> 
> 
> 
> 
> 
> 
> 
> 
> It used to be stuck. I guess it got lost in the database migration.


It's still in the sticky notes section. The format of stickies has been changed in the new platform and threads aren't stickied like they were in vBulletin.
Right now, there is just a link to this in the place above the threads in the Coding and Programming section.


----------



## Just a nickname

Will take a look


----------



## Xeio

One thing that might be worth noting. The decimal type should be used for calculations where precision is important and the limitations of double/float cause problems. Most often for currency calculations, where amounts such as 0.3 can't be properly stored stored in a float/double, and you will need an exact result.


----------



## Coma

Quote:


> I wouldn't recommend downloading the MSDN Library since its only a small section of information that is rarely used and adds a large amount of time to the setup.


You make your life so hard if you don't have MSDN and don't know how to search wisely. So much good reference there.


----------



## Nocturin

Subbed so I can come back to this later. This is awesome!


----------



## Tyrandis

Nice guide that you have there

REP+


----------



## Iraq

*for (int i = 0; i < 10; )
MessageBox.Show("Thank U");*


----------



## xquisit

Thanks for the guide, I know someone recommended a book to read on page 6.. but that was a couple years back.

I am looking into taking on C# as my first computer language, and was hoping someone experienced can chime in with a book (or two) I could pick up!

Thanks in advance.


----------



## Licht

Quote:


> Originally Posted by *xquisit*
> 
> Thanks for the guide, I know someone recommended a book to read on page 6.. but that was a couple years back.
> 
> I am looking into taking on C# as my first computer language, and was hoping someone experienced can chime in with a book (or two) I could pick up!
> 
> Thanks in advance.


http://msdn.microsoft.com/en-us/library/aa288436%28v=VS.71%29.aspx


----------



## 3930K

Quote:


> Originally Posted by *Warhaven*
> 
> Nicely done. My only quip is the break; used in the while-loop example. Using break outside of a switch() statement is considered bad form according to most programming guidelines (along with continue and goto). I feel this would be a better example and achieves the same goal:
> 
> Code:
> 
> 
> 
> Code:
> 
> 
> Double mydouble = 1.337;
> int myinteger = 3;
> while (mydouble != myinteger / 3)
> {
> mydouble = Convert.ToDouble(Convert.ToInt32(mydouble));
> }


If you can do it with the condition, fair enough. Also fair enough about goto. But, break and continue are fine, and if not a LOT of Framework methods would be considered bad.


----------



## xquisit

Quote:


> Originally Posted by *Licht*
> 
> http://msdn.microsoft.com/en-us/library/aa288436%28v=VS.71%29.aspx


Thanks for the response


----------

