Friday, January 27, 2012

The Way of the Programmer: A Warning. Also, numbers

Happy Pirate Hat Friday, everyone:

The Way of the Programmer can be dangerous for those who are impatient. A program doesn't program itself; you have to program EVERYTHING in the program. You need to be extremely patient with your program. Multiple versions must be made for even a simple little thing. However, once you finish your program, it would be like you slew a giant octopus with a toothbrush, like me.
I'm serious, you can't think it will be easy. That is not the way of the programmer! Stop doing it! If you think it will be easy, you will easily fall to the long process of programming. Just saying.

Now, today's lesson will be on integers.Yeah, that's right. Numbers.

Integers: A WHOLE new experience
Alright, integers are whole numbers. No decimals, no fractions, just positive and negative whole numbers. Now, you can make a decimal like an integer, but we will get into that. Now, integers only goes through the interval of (-2 billion, 2 billion), just about. Generally, this will be what you need for the job.

How do I declare an Integer?
Code that like this will get the job done:D
int myInt;
For initializing, do this
myInt = 42;
No quotation marks or anything, unless you are setting it to another variable.

Double: Double the fun, twice the work
A double is like an integer, but it includes a decimal, fraction, and other fun stuff

A prime example of a double is money. You can have 35 dollars, yes, but it's better to have 73.35 dollars. Doubles go farther in bounds than integers.

How do I declare a double? I don't understand! I'm literally tearing my hair out! Now I'm bald! What is going on???
Hahaha, silly new programmer. The way you declare a double is like an integer.
double myDouble;
Initializing just has a similar way, as well.
myDouble = 42.424242
Next time, we will talk more specifically on math.

-The Rich Man known as Thursday (Who isn't really rich, but pretends to be)

No comments:

Post a Comment