View Single Post
chiro is offline
Feb21-12, 01:55 AM
P: 4,570
Hey zoiberg137 and welcome to the forums.

For CS, one of the major components is programming which is what I used to do for money for a little while. You can learn it just like learning to drive a car for the first time or learning how to play a sport: it focuses on different things but the point is you can learn it.

Here is some advice for you to keep in the back of your mind when you are dealing with any kind of programming:

Be aware of two things: state and flow-control.

State just means every bit of data and information in memory that you use in some form and flow-control has to do with how data gets processed and in what way. Lets make these comments less confusing:

When you start programming you'll do simple programs like set an integer to a value, print a simple sentence on the screen amongst other things.

The most important thing that you will have to learn is how to track the state of your program. You will start with simple short pieces of code but it will get a lot larger and you will have to manage the states in your head using good coding techniques and all the stuff that you will taught in your CS courses.

You will learn a lot of different techniques and if you understand how to track the state of all these different things then it will be easier for you to really understand what is going on and also when you have to debug your code (which can be a nightmare). If you know whats going on with the state of each variable and the state of the overall runtime environment (for now just think inside your program), then it will make your job a breeze in comparison to if you did not.

Now comes flow-control.

With flow-control you will be no doubt introduced to procedural and quite possibly object-oriented paradigms like C or C++ if its OOP.

The flow-control is basically a way to say how data gets processed and how that gets done. For a procedural language its basically going to be from top to bottom inside some context.

A context is something like a loop or a function where once you've say called a function or you are inside a loop then you still go from top to bottom but its inside the loop or function until the loop ends or until you exit the function. Also with a loop if the condition isn't satisfied to end the loop you go back to the start of the loop and do the top to bottom thing again.

Again you will start off with simple examples and build them up to things that are more complicated developing your ability to organize everything in your head over time.

Flow-control and state have a very intertwined relationship: if you get a weird kind of error for a variable then knowing the flow-control will help you track the error down. For example you might be in a langauge like C++ and for some reason some hidden function gets called that doesn't do the right thing and you need to find this to fix your program.

Keeping these two things in mind will put everything in perspective when it comes to writing code of any sort, in any environment and on every platform. The state and flow-control might be different paradigms or include different things but the idea itself does not change.

I wish you all the best with your courses.