Friday, March 1, 2013

Cycle 2

Welcome to Cycle 2!

What have I been doing? Well, I've been learning a new language: Not that type of language, a computer language! I have launched myself over the past week into the world of Java, the programming language that runs in our computers, cell phones, and MP3 players. It makes up the code behind the scenes on all the apps you download or install on your devices. This cycle, I've been looking at the basics of the language: You know, learning a programming language is a lot like learning a new human language, since you have to learn the fundamentals before delving into the actual sentences. In Java, the sentences are the programs. We'll explore a very simple Java program later, but let's first look at the very building blocks of the language.

Java is an object oriented programming language (OOP). This means that the code does NOT tell the computer to "do this, do that" first. Rather, it organizes all the data going into the program before telling the computer to "do this, do that." These types of OOP languages are great at letting a programmer build on what they already have, instead of deleting the code and starting all over again. OOP also lets someone refer to other parts of a program for information on different variables present in the code. All of these things are possible because these languages organize data into classes and objects. In the code, you can describe a class, which is a group of objects that go together. The computer makes the objects that go into that class. This is how the language is so good at organizing data.

Now before I could start writing code and running it and watching the magic happen right before my eyes, I needed a couple of things. One: I needed a computer. In this age, that first task was pretty much completed. Two: I needed a compiler. This is a software that converts the Java code I write into code that the computer can read. In other words, binary code, the sequence of zeroes and ones that you see in the background of this page. (Take a good look at it. Computers running this and doing so many things? It's amazing!) Three: I needed an integrated development environment, or IDE. This is a program that lets me manage my code and provides many ways to write and run my programs. Four: I needed a Java virtual machine, or JVM. This si a program that lets me run my code on my computer. Once I got these things, I was ready to jump in to the code and start writing.

During this week, I learned many things about the fundamentals of Java. One thing that really surprised me was that I could create names for my own classes, called identifiers. I also learned about the classes that go into every program and the fact that the Java language is cASE SenSItivE. Let me explain some more fundamentals in this simple program:

class displayer { //This line of code states the class of the program.
/*The next line, called a method, tells the computer the instructions for how to execute the action.*/
public static void main(String args[]) {
System.out.println("This will be displayed!"); //This line is the action that tells the computer what to display.
}
}

Inside the code, I've hidden some sentences that are in plain English. These are called comments, and are embedded into code by surrounding the lines with special symbols, like /*Words*/ and //Words. These can be left inside the code itself and the computer will ignore what's inside. These are great for explaining what the program does without messing up the code.
The other thing to note is that I have put curly braces around several parts of the program. These are used to enclose important lines of code, and to show the outline format of  the program. The indents are also used for showing outline format.

In case you were wondering, the above program just ends up displaying the text "This will be displayed!" in the IDE window. As you can see, much of the program is devoted to organizing the data before giving the "do this, do that" statement. All of this, though, is helpful for programmers to write code efficiently.

Well, I'm finished my enthusiastic speech on the fundamentals of Java. Next week, I'll be taking the information I learned this week and putting it into basic, data manipulation programs.

Remember to stay interested! There's new, exciting stuff coming next week, so be on the look out for that! See you then!


1 comment:

  1. Hi Himavath, i like this topic. i am currently in the class intro to computer programming, we are learning in C++, I have so much fun in that class so, when i saw your topic on moodle i had to take a look. i will be interested in seeing how you progress in this project, hopefully i will be able to learn something from what you post. good luck.

    ReplyDelete