Talow
Sorceror
While most programmers will understand the subject some will not so we'll start the tutorial with what Hello World means. To put it simply this is the first code you typically write in a programming language. The desired effect is simple, to output the text "Hello World". Now we see the subject line reads Before Hello World, what this means is I'm going to go over some basics of programming, not how to code anything.
The first thing I'd like to explain is the concept of a "white space" This is a space, tab, enter(return) ext. that is not actual text. Now that we know what it is lets try to understand it a bit more. Most white spaces are not read by the compiler, and have no actual value to the code. What this means to us as coders/programmers/scripters is that we can format the code to make it easier for us to read as humans. (Yes Vorspire is the inspiration for this part.) So I'm going to write a small segment of code the way we would, and then I'll display the same code the way the compiler would read it, to show the difference.
Note: this code is only to show what we are talking about not to actually do anything.
We read like this:
Compiler reads like this:
Now tell me which one would you like to read? Yeah me thought so too. So we now know the white spaces are mainly for us to be able to format and read the code. So why am I posting this? Really I'd like for Vorspire to post a reply to answer that, I think he's gone over it enough times to give all the right answers and then some on that topic, however I will put one simple answer to this. I don't want to read the compiler's verson of code. I want to be able to look at your code and understand it, not have to format it to be able to read it.
Vorspire has told people on a few differe topics, that there are easy ways to format the code, and just so I do not step on his toes, (I think he likes doing this part, I really do.) I'll let him tell you what that is.
This is only a start on this topic, but I'm at work and so will add more later.
The first thing I'd like to explain is the concept of a "white space" This is a space, tab, enter(return) ext. that is not actual text. Now that we know what it is lets try to understand it a bit more. Most white spaces are not read by the compiler, and have no actual value to the code. What this means to us as coders/programmers/scripters is that we can format the code to make it easier for us to read as humans. (Yes Vorspire is the inspiration for this part.) So I'm going to write a small segment of code the way we would, and then I'll display the same code the way the compiler would read it, to show the difference.
Note: this code is only to show what we are talking about not to actually do anything.
We read like this:
Code:
if ( somevar == true )
{
if ( othervar > 1 )
{
for ( i = 0; i < othervar; i++)
{
somemethod(i);
}
}
}
Compiler reads like this:
Code:
if(somevar==true){if(othervar>1){for(i=0;i<othervar;i++){somemethod(i);}}}
Now tell me which one would you like to read? Yeah me thought so too. So we now know the white spaces are mainly for us to be able to format and read the code. So why am I posting this? Really I'd like for Vorspire to post a reply to answer that, I think he's gone over it enough times to give all the right answers and then some on that topic, however I will put one simple answer to this. I don't want to read the compiler's verson of code. I want to be able to look at your code and understand it, not have to format it to be able to read it.
Vorspire has told people on a few differe topics, that there are easy ways to format the code, and just so I do not step on his toes, (I think he likes doing this part, I really do.) I'll let him tell you what that is.
This is only a start on this topic, but I'm at work and so will add more later.