1st Week Recap(1st March 2013)
Although I’m not very proud of my lack of ability to remember things very well, I do remember that I’ve been taught about many things regarding computer programming. The first week of this course is full of learning about new terms, definitions as well of the applications of computer programming in real life as per the introduction of this course. I’ve also made a few simple programs albeit most of them fail to run properly. However, as a novice for C++ programming, for now, I can use that excuse as to explain why I fail to create a successful simple programs.
Now, getting back onto the introductory phase of C++ programming (even though it is still technically the introductory phase in the 2nd week due to most of us are new to computer programming). We learnt that computer programming is a language that people use to communicate with computers. As with the real world where we have so many different languages to talk to other people, the computer programming also have a variety of language. Amongst the common ones are Java, Foltran, BASIC and C. Turns out that C programming is the predecessor of C++ so we would actually have to study C programming before C++. Yet, I don’t think we have much time to learn about both programs in detail in just a few weeks. (Yes, 14 weeks is few to me and I know that ‘no time’ is the lamest excuse to be uttered in the whole universe). And then, we learnt what computer programming actually is. There are two other terms of ‘computer programming’ that are more or less carry the same meaning, namely, “Procedural Programming’ and ‘Structured Programming’. A program is defined as a sequence of instructions for computer(s) while ‘programming’ is the technique to create a program.
Additionally, we learnt of important terms that have their many, many subsections like keywords that important in C/C++ programming and data inputs. Next, we have ‘syntax’ which is analogous to the grammar of a language or the sequence for the code in C/C++ programming. Most errors in creating a program is usually by ‘syntax error’ that may mean you, as the programmer, messed up the sequence or the symbols used. Then, the term ‘semantic’ is the meaning of the C/C++ code used in the program. A tip from the lecturer in charge is that a code which carries two or more meanings can end up in an ambiguous and unpredictable result. So, since I’m the extra nooby kind of novice, I should always expect the unexpected when executing a program (assuming the program is successfully compiled in the first place.) Also, the gist of computer programming is that the programming is that the programmer will input a set of instructions and the data will be displayed in an output medium which may include the monitor screen and printer.
After that, we move on to the special software that is essential in creating a computer program in either C or C++ named Dev C++ provided by the website “Bloodshed”. This is a free software that is surprisingly easy to find and download and does not take up much memory of my significantly tiny laptop. From here on out, I shall shamelessly translate everything that is relevant to this software from a PowerPoint Presentation created by our lecturer, Md Yazid B. Mohd Saman;
Dev C++ is an Integrated Development Environment (IDE) which provides the necessary facilities for typing, creating, compiling and running our program. Also, we need to have a C++ compiler in order to create and run a C++ program. [C++ is a high-level language that programmers use for their own comprehension and it will be converted into machine language or binary code via the compiler]. Hence, the use of the IDE Dev C++ in C++ programming. Furthermore, there are other similar softwares that can be used for C++ programming like MS Visual C++, NetBean and Eclipse.
Besides, how do we actually create a C++ program? The answer is simplified into five steps;
1) Create a Project.
2) Type a program.
3) Compile the program.
4) Run the program.
5) Debug the program if there is any error. (2013, February 17)
Admittedly, before I’ve written this recap, I’ve never used step 5; Debugging the program. Well, at least now I know which icon to click if I encounter any error (in which case it is very likely to happen). Other than that, we have even delved a little bit in the format for the C/C++ programming. For instance, ‘main () function’ acts as the first instruction for the computer to follow. ‘User function’ is a function created by the users that is always accompanied by ‘void’. Then, ‘<< endl;’ and ‘\n’ have the same purpose which is to create a new line so there will be more than one line of sentences displayed in the output medium. Moreover, the ‘return’ key phrase will cause the main program to return to integer(int) and if the user uses ‘void’, then this ‘return’ key phrase is unnecessary. Lastly, at the end of the program, there will be this certain key phrase ‘system(”PAUSE”)’. The string in the brackets is interchangeable using the proper words such as “cls”. “PAUSE” will result in the display of, “Press any key continue…”. As it says on the tin, once the program has been executed successfully, the program will pause and ask the user to click anything on t he keyboard to close it. Meanwhile, ‘cls’ will result in a screen ‘wipeout’ once the program has finished running.