Sunday, 11 May 2014

Programming in C

This course is written for all those poor fools out there trying to learn a C type language, or any other object oriented language for that matter. This includes, but is not restricted to C, C++, C#, Java, and many other languages. I'm not gonna ice this over. C is HARD! It takes hard work to learn well. I don't intend to make you a C language expert, just to teach you enough of it for you to survive in a C based world.

C was the mother of all these languages, and should be presented as a first knowledge basis. Keep in mind that C++, C#, Java, and several other languages of late are children of C, and as such, are very similar, with the main differences being syntax, and not style. Once you understand the programming style, changing from C to C++ or JAVA is simply a matter of where to dot your T's and cross your eyes.

First and formost, let me make these two important statements:


I am NOT a programmer by trade.

Programmers write computer programs for a living. I fix broadcast television equipment, which often includes the REPAIR of some sloppy programmer's code. As such, I learned the fundamentals of the language, and can find syntax errors, missing links, and other such "dumb" flaws which frequently creep in when a software "upgrade" happens. In short, I do to programs the same thing I do to other electronic equipment - I FIX them or in a pinch RE-DESIGN them in order to come up with a working solution to a particular problem.

This does not make me a programmer by trade, as I have never needed to write over 2000 lines of consecutive code. However, the basics I present in this course should come in handy to those who wish to follow similar lines.


There are 2 kinds of Programming Languages


Those which require an interpreter - like BASIC or PERL.Programs like BASIC must be run inside a "mother" program called an interpreter. These programs are usually easier to write, but run at least twice as slow as the same program written in a language that does not require interpretation.

The source code for an interpreted language can be looked at in a normal text editor ( like notepad or vi ), and can be run exactly as it is written.


Those which must be COMPILED.

Compiled languages are languages whos output are EXE or executable files, which run directly under the operating system, sometimes using windows, sometimes not, and require no interpretation. ASSEMBLY/MACHINE LANGUAGE is probably the most powerful of all compiled languages, but is VERY tedious to write. C is a compiled language which COMPILES the program into direct binary (1's and 0's) data that the computer understands.

While the computer may be able to understand these 1's and 0's, we as human beings ordinarily can not. ( I do know one individual who can read the 1's and 0's directly, but he is a "supergeek" and isn't exactly what most folks would think of as normal) complied programs ( programs that end with a ".exe", can not be read in a text editor.Compiled languages require the use of a COMPILER. I prefer to use Borland, but there are freeware and shareware compilers that can be obtained. Here's a good one came across called Open Watcom . It was written by Sybase, and best of all, is freeware! which means, "Sybase hereby grants You....a world-wide, royalty-free, non-exclusive license.....to do the following:

You may use, reproduce, display, perform, modify and distribute Original Code, with or without Modifications, solely for Your internal research and development and/or Personal Use".

Furthermore, it is cross-application and cross platform. Huh? That means not only does it work for "C", but also for C++, Fortran, and other compiled languages. In addition, it's output can be read/seen by multiple platforms, to include windows, linux, and mac based computer systems.

THIS IS THE COMPILER WE WILL USE IN THIS COURSE It is highly suggested that you download and install it.If you happen to be using Linux or another Unix based platform, they usually come equipped with standard c compilation tools, such as gcc.

No comments:

Post a Comment