Diff: [root] @ b61cdbe1236 | faq | css

Learning python

File: hellnet/protocols/HTTP [Diff]

-- a/hellnet/protocols/HTTP++ b/hellnet/protocols/HTTP
@@ -4,6 +4,6 @@

h2. Query types

|_. Query |_. Path |_. Static/dynamic |_. Description |
| GET | /chunks/([0-9a-f]+) | static | Chunk with hash $1 |

File: nopython [Diff]

-- a/nopython++ b/nopython
@@ -12,6 +12,21 @@

h2. Python brokenness from developer's point of view.

h3. Learning Python

Ok, let's start with tutorial, the 'official' one. It says:

bq. The interpreter acts as a simple calculator: you can type an expression at it and it will write the value

That's wrong; @python@ can't be used as a simple calculator. Let's prove it:

bc. >>> 2.3 - 3.4
-1.1000000000000001

-1.1000000000000001 ?! It's just -1.1, the others are FPU intimate problems and shouldn't trouble the user. Imagine you come to shop and seller, whose cash machine's software is in python, gives you .00000000001 cent as change. That's not a simple calculator.

You can work around the problem by using @print 2.3 - 3.4@ instead. But that's definetely not simple.

h3. Indentation

Indenting code properly is good. But why make it part of syntax? To understand codemonkeys' code? They can write in one line anyway, and while you can convert this to proper indentation, you cannot do that vice-versa if indentation is wrong, and compiler wouldn't even complain.

By Voker57 on 2009-06-01 10:54:01 +0000