[Tutor PyCZ] Zachytavani udalosti v cyklu

Martin Petr martin261 na gmail.com
Neděle Duben 2 23:10:02 CEST 2006


geon napsal(a):
> Za sebe snad jen toto:
> 1. začátečník není ten, kdo je tu poprvé ;-) podle mne tento dotaz patří 
> do začátečníků snad jen tím, že je to o hře, ale rozhodně ne provedením 
> nebo dotazem (thready)...
> 2. Já osobně bych v tomto případě thready neřešil, mě to jede slušně i tak
>
> Upozornil bych na následující maličkosti:
> 3. dokument je utf-8 a není deklarováno - asi bych si toho nevšiml, ale 
> PSPad mručel
> 4. máš použity jak tabulátory tak mezery - to se nedělá ;-)
> 5. doporučoval bych velikost tabu 4 mezery, jinak se velmi rychle a 
> hluboko noříš
> 6. některé if -elfi-elif (hlavně asi ř.112-120)... by se dalo nahradit 
> slovníkem
> 7. dolu/nahoru had běhá dvakrát rychleji - chtělo by vyřešit
>
> Jinak je to z mého hlediska hezké, moc hezké
>
>   
1. Je fakt, ze jsem nechtel vypadat moc troufale a nevedel jsem taky, na 
jaky
urovni to je naprogramovany.

2. Jasne, mozna by to mohlo vypadat jako brani kanonu na vrabce, ale jen tak
me to zajimalo...navic pri velky rychlosti by se to myslim hodilo - hada 
jsem
se za cely svuj zivot nahral neskutecne hodne ve spouste verzi a vim, jak je
takova 180° otocka uzitecna ;o)

3. Hmmmm to je divny...nerekl bych, ze by Vim mel defaultne nastaveny utf...

4. Kruci, ja zapomnel pustit ":retab"...sorry, vim ze je to ostuda ;o)

5. Jo tak co se tohohle tyce, jsem prosel urcitym vyvojem, ale rozhodlo u me
tohle (sice jeste za dob myho Ceckareni, ale zustalo mi to doted):
"Chapter 1: Indentation

Tabs are 8 characters, and thus indentations are also 8 characters. 
There are heretic movements that try to make indentations 4 (or even 2!) 
characters deep, and that is akin to trying to define the value of PI to 
be 3.

Rationale: The whole idea behind indentation is to clearly define where 
a block of control starts and ends. Especially when you've been looking 
at your screen for 20 straight hours, you'll find it a lot easier to see 
how the indentation works if you have large indentations.

Now, some people will claim that having 8-character indentations makes 
the code move too far to the right, and makes it hard to read on a 
80-character terminal screen. The answer to that is that if you need 
more than 3 levels of indentation, you're screwed anyway, and should fix 
your program.

In short, 8-char indents make things easier to read, and have the added 
benefit of warning you when you're nesting your functions too deep. Heed 
that warning." -- Linus Torvalds, Linux Kernel Coding Style
Prislo mi to celkem vtipne napsany, navic i ze zivota :o)

6. Slovnikem? Tomu trochu nerozumim...
Napadlo me ale tohle:

if keyEvent:
        self.direction = keyEvent.keysym.lower()

7. Dik za napad, chtelo by to opravit, to je fakt. Uz si na to i segra 
stezovala :o)

Diky za pripominky a diky za pochvalu

Martin

-- 
To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.



Další informace o konferenci Tutor