Python

(Disclaimer: this is me selling Python to you)

Python is a programming language that is really easy to learn, both if you can program and if you can’t.

The main points for and against it are as follows:

Whitespace Sensitive Programming

This is mainly why people don’t like Python. Instead of this:

if x < 3 {
	print('Hello, World!');
} else {
	print('x >= 3');
}

You do this:

if x < 3:
	# Necessary tabulation
	print('Hello World!')
else:
	print('x >= 3')

So people hate this. They hate it because it isn’t normal. People like brackets, they like code that can be compressed to one line, even if it isn’t useful for anything except ultracompressed obfuscated code. (By the way, if you do use Python and want compressed and obfuscated code, you can compile to bytecode using the py_compile module)

The reason for the absence of brackets is that the creator of Python (god bless his soul) realised that people tabulate code anyway, just to make it look nice; he just removed all the unnecessary brackets.

Dynamic Typing

This means that instead of this:

int num = 1

You can do this:

num = 1

And Python checks what the value is and makes n an int.

This is just personal preference; both work. The only problem in Python is that you have to know your datatypes. It saves a bit of code and makes it easier for beginners.

This is the core philosophy behind it:

  • Beautiful is better than ugly
  • Explicit is better than implicit
  • Simple is better than complex
  • Complex is better than complicated
  • Readability counts

So yeah. Python’s great.


EDIT: I didn’t realize that wordpress’s ‘pre’ tag didn’t make the code monospaced. Sorry.


EDIT EDIT: I found the ‘text’ tab and the <code> element. Had to put a load of &nbsp;s everywhere to make the tabulation.


EDIT EDIT EDIT: Syntax Highlighting!

Advertisements