Diff: [root] @ b61cdbe1236 | faq | css

Learning python

File: hellnet/protocols/HTTP [Diff]

diff --git a/hellnet/protocols/HTTP b/hellnet/protocols/HTTP
index c756d8c..cae7fee 100644
-- a/hellnet/protocols/HTTP
++ b/hellnet/protocols/HTTP
@@ -4,5 +4,5 @@ Peers are passing queries via HTTP queries (like GET /chunks/0a/04588fab48f or P

h2. Query types

\ No newline at end of file
|_. Query |_. Path |_. Static/dynamic |_. Description |
| GET | /chunks/([0-9a-f]+) | static | Chunk with hash $1 |
\ No newline at end of file
\ No newline at end of file

File: nopython [Diff]

diff --git a/nopython b/nopython
index 5ac3c9c..e73b9c6 100644
-- a/nopython
++ b/nopython
@@ -12,6 +12,21 @@ Lastmp, for example, crashes "wherever it encounters broken Unicode":http://bitc

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 14:54:01 +0400 Powered by bitcheese wiki engine