Wednesday, September 19, 2007

Programming what$%?!

I'll be posting a short introduction about computer programming. I have chosen this topic because I have spent about 6 years of my life learning about this stuff.

I know some of you are not that technically inclined. But don't worry, I'll try to make this entertaining. As I will be using some metaphor to make complicated things simple.

So how important is programming anyway?
Like many professions in the Philippines (call center agents, nurses etc.), programming (software development, as it's usually called) has made many Filipinos very successful. Just visit Singapore and you'll see what I'm telling you.

* Many companies are also encouraging schools to invest more in computer science. So I think, in the future, more and more programming careers will be created.

But all their success starts with these two words: "Hello, World!". "Hello, World!" is usually the first program every programmer makes.

What does "Hello, World!" look like?
A "Hello, World!" program has many forms. As an example, the program below was created using language called "Visual Basic for Applications". The program prints "Hello World" when you run Microsoft Word.
Visual Basic what$%'#!?
As with any communication, you need a language (Filipino, Nihongo, English) to be able to tell what you want. For me, programming is just another form of communication. So please remember this: "Programming is just telling your computer what you want it to do". And in communicating with your computer, there are tremendously many languages available.

For example (In Japanese, TATOEBA[例えば]):
- If you want to talk with with your Internet browser: use HTML (and many others CSS/Javascript etc.)
- If you want to talk with your computer screen, you could use Java, Visual Basic etc..
- If you want to talk with your low level hardware (e.g., video cards, network cards), you could use assembly language, C/C++, etc..

Why too many languages? Which one should I choose?
Although this is a personal preference, for start ups, I should say C/C++. As with my example above, each language has it's own strengths and weaknesses. C/C++, although known before as very hard to learn, is now staple because of the many information available on the Internet.

What are the requirements?
To be able to create a program, you must first have a COMPUTER!

I already have a computer, you #$%?!
You must have 3 software development (programming) tools.
1. Text Editor - (where you create your program)
2. Compiler - (creates an object file from your program)
3. Linker - (links all your needed resources)

But don't worry. Most of the programming tools you'll be using has all of these three.

So how does it go?
Basically, programming goes like this.

1. You write a code based on the language you've chosen:
An example using Tagalog-C (Hypothetical language based on C language):

---------------------------------------------
#iinclude mga_kailangan_kong_code;

start_ng_program_ko() {

mag_print_sa_monitor_ng("Hello World");

}
---------------------------------------------

2. Run your compiler.
- The compiler is a program that converts your code into a language that your COMPUTER understands.
- After compiling your program becomes a binary file. Meaning, "you can't read it! It is intended for your COMPUTER!".
Example the program above after compiling is shown below in binary format:

0100010101001010101010101010010100101111110010101001010101001
10101010101111010010101010101101011010111110101010010101001010

* Can you read it? I'll give you a ¥100,000 if you could read it. :)

3. Run your Linker.
- Actually, Compiler/Linker are usually done in tandem. They are never separated. When you run your compiler, the linker automatically runs next.
- We need the linker because we usually use codes that other people had already created.
- Linker, links other source codes (mga_kailangan_kong_code) and the binary file you have created.

And then?
There you have it. You now have your "Hello, World!" (hello.exe) program. You just have to double click it like any other application (word, excel, dota, YM etc..) and it will display "Hello, World!" in your screen.

* Just remember, in order to communicate with your computer, you must create a program from any computer language (Java, C/C++, Perl, etc..) and convert it to the language your computer understands (MACHINE LANGUAGE, 101001001001 ). 'Til next time...

1 comment:

Lantaw said...

always a techie eh? nice to see you here doms