Monday, September 5, 2011

hello.py

#hello.py
# Hello World! Welcome to the first post of my new progblog! Now, you are probably asking "what the heck is
# a progblog?!" Good question. A progblog is my term for a blog that is written in the comments of a program
# so that each post can be compiled and executed as a program! Now you are probably asking yourself
# "Why the hell would you want to do that?!" Also a good question! The idea came to me when I was trying
# to think of some modernized way to teach programming students online that would be easy, interactive,
# instructive, and software independent! So... a progblog it is!

# For those of you who are familiar with programming and programming languages, this particular progblog is
# written to be executed by a python interpreter. You can tell from the little hash symbols that I am using
# at the beginning of each line of text. These lines that start with the hash symbol are called "comments".

# Comments are used to explain code. Without comments, it can be impossible for someone else or even for
# yourself to make heads or tails of what a program is meant to do. As a teacher I had in undergraduate
# used to say, "You can't have too many comments!" Well, I am trying to take that a little overboard here.
# Anyhow, the hash mark tells the compiler to ignore anything that follows on the line after it (in python that is,
# different programming languages have different symbols that mean "comment").

# Anyhow, without further delay... here it is. Hello World! Python style in all its glory!

print "Hello World!"

# ... and that's it. Yeah... it's not much of a program, but the "Hello World!" program is the traditional
# exercise for new programming students to start out with as it gives the student a simple task to carry out
# that will help them get the very basic idea of the syntax of the language. Even seasoned programmers
# will often begin a new programming language by writing a "Hello World!" program. It is also often used
# as a test output for debugging purposes... etc. Probably, it is the first thing that our computer overlords
# will have learned... before revolting and enslaving humanity (personally, I think that the governator's first
# line in T1 should have been "Hello World!". Of course, this is not nearly as menacing as I think the
# producers would have liked... so, whatever.

# Anyhow, I am sure that I will revisit the topic of "Hello World!" numerous times in my blog in the future.
# For now, try copying this entire post into http://www.codepad.org, select "python" on the left hand side, and
# press "submit". See what happens! I'll bet you can guess!