Intro to Programming
If you know nothing about programming, this is where you start! If you can use a calculator, you can code, I promise!
Which Language do I learn?
The first step is to decide on a programming langauge. The good news here is IT DOESN'T MATTER. Once you learn the concepts in one, you'll pick up another language very quickly. I learned using a Lego robots programming language called "RobotC" which was a simplified version of C. Then I took Intro to Programming in Matlab in college because thats what my racecar team used for calculations. I had to run some python scripts in my heat transfer class, and then I got very good at R because my stats and environmental/energy classes used that.
For the un-initiated, start with Python. However, I'd recommend learning the language you have the most support in, or a direct application for. If you have a hardware class where everything is done in C, learn C; if your best buddy is an expert in Java, consider learning that. Nothing is worst than running into a wall and not getting the help you need because you don't know anyone proficient in that language. Once you know the basic concepts, its much easier to get online support for learning other languages. Also try to pick an open-source or freely available language. You don't want to learn matlab in school just to work in a job that won't pay thousands a year for that and then you don't get keep practicing those skills. Since R is free, I've always been able to use it at all my jobs and not get too rusty, my fingers just remember it!
How does Programming Work?
The biggest "ah-ha!" moment to me in programming was my TA explaining how computers do exactly what you tell them to do (I was 16!), and most importantly, they go LINE BY LINE. So the program looks at line 1, then line 2. And it wont "remember" anything until it executed that line.
2+2
variable1 = 7
variable3 = variable1+ 5
variable1 = 3
variable3 = 4
So I typed some random code above. The first line uses the programming terminal like a calculator. You type in 2+2, its going to spit out "4". You can also save "names" (we call them variables) and that will save a number to a name. The 2nd line makes the name "variable1" and when you type in "variable1" in the future, it will spit out "7". Then we create "variable3" by adding 5 to variable1. So 5+7 will equal 12. Variable3 will equal 12.
Finally, we overwrite variable3 and give it the value 4. Because this is on line 5, it is the last thing to be executed. Line 3 cannot see that Line 5 made variable3 = 4, so the result of line 3 is that varia
No Comments