Codes are ubiquitous in our society. We see fast paced action films trying to defuse a bomb or hack into a computer system before some catastrophic event occurs. We see error pages on our web browsers filled with random sequences of letters and numbers. It's a different language. My first week consisted of "learning to program." Now, I put this in quotations because people devote their lives to doing this. One week is certainly not enough time to fully comprehend the ins and outs of programming. My first week was attempting to learning the basics of C programming.
I started off with explanations of how to read code. The above
#include function has directions telling the compiler, which converts code into something that the computer can understand, to put code from the header
<stdio.h> into our program before continuing. In this case, the compiler changes the code into a program. The next line says that the function
main returns an integer. After understanding the basic written code, the next step was to introduce inputs and outputs. In the case above, the
printf is what the user will see, and the
scanf reads the input.
%d tells the
scanf to read the input as an integer. This is what the program will look like executed:
At this point, my learning has consisted of the above simple codes, if statements, loops, switch case and pointers. I've used several different sources, but
Cprogramming.com has been my most helpful resource.
Teaching myself how to program, with the help of Mr. B answering some frantic emails, has been a fulfilling task. There were several times when I thought I understood something and then realized I had no idea what I was try to write. The fulfillment and excitement comes when even the simplest of programs works. I am certainly not at the point where I can be fully confident in what I am doing, but I know that I am on the right track.
This seems really cool Helena! :) How have you been teaching yourself to program?
ReplyDeleteMy most helpful resource as been Cprogramming.com. It brings you through concept by concept, but you have to practice actually writing the code. For that, I used downloaded Code Blocks. Even if it was just me copying what the website said, it was still helpful because, more often than not, I made a mistake writing and had to go and find out what it was. That, in itself, is learning.
Delete