Thursday, November 20, 2014

COMPUTER

KNIGHT IN PROGRAMMING : JOURNEY TO PROGRAMMING

COMPUTER

This blog is about my journey to programming, in various language cultures and platform environments. Here we go!

January 2013. I saw my first Java program, in a public library book. It was one of those high school programming book. It was titled "Be Prepared for the AP Computer Science Exam in Java."

I thought the book was for me since it's written for high school students. I read every pages, starting from the softbound cover until I got to a program solving for a Fibonacci series using recursion, some 200 pages later.

There were two function calls of the same recursive function in the return statement. I couldn't figure out why the output is such after doing several walk-through of the resulting output.* The two calls to the recursive function was throwing me out of the loop. So back to square one! Start from scratch!

I then started to read books that actually teaches Java to a beginner. The AP book was actually not a book for learning Java. It was a book for reviewing what you know of Java, by reminding you of what you need to know before doing its exams at the end of each sections and chapters, all of which were to write the output of a code segment or to test your programming concept.

Why do I have to learn Java? I was planning to enroll in the VRAP program available to U.S. Armed Forces veterans. And I have always been interested with computers. So I planned to major in Computer Programming. It was either that or Culinary Arts, but I wasn't interested in making a career of cooking. I'd rather cook codes than cook cookies! ;-)

Using the beginner books, I learned how to code the traditional first program for programmers, Hello World!, in Java.

Python is actually the easiest first programming language for a beginner because it only takes one line of code to program Hello World. This:

print(“Hello World!”)

Save that single statement from IDLE IDE, name the file, and every time you run the program from IDLE, the Python interactive mode responds with >>>Hello World!

Anyway, I think learning about binary code, is actually the first thing one should learn if one is to be a professional computer programmer.  So here is a binary code instruction that a specific computer architecture is able to execute:

10001100011010000000000001000100

Binary code is very much computer architecture dependent. You need to design your computer to accept your machine language in order for your computer to execute your code. This particular code is specific to MIPS computer architecture using 32 bits long instructions. This particular instruction tells the computer to load a value into register 8 by referencing the address stored in register 3.

This sounds like a lot of technical stuff. It is! But learning to be a good computer programmer takes a lot of learning. It takes at least 10,000 hours of coding and learning before you can consider yourself an expert. It’ll probably be much easier to earn your wings in the Air Force than to be an expert computer programmer. ;-)

But always starting from the beginning helps! Knowing your PC, CPU, ALU, CU, I/O storage devices, RAM, ROM, bits, bytes, and words before learning your programming syntaxes and semantics will go a long way into understanding computers.

Happy computing!

John Sindayen

*After learning from the beginning books, I was able to reproduce the same output as the correct answer in my walk-through of the output.

References:
http://en.wikipedia.org/wiki/Machine_code
http://www.amazon.com/Prepared-Computer-Science-Exam-Java/dp/0965485358
http://crunchify.com/write-java-program-to-print-fibonacci-series-upto-n-number/

No comments:

Post a Comment