variable declaration

  • Thread starter Alexander Zatvornitskiy
  • Start date
N

Nick Coghlan

Antoon said:
I don't think that would be a big issue. Python uses '=' also
differently from a number of languages. My preference would
currently be for ':=' because I have the impression that if
you don't leave spaces the period in '.=' tends to be obscured.

x.=42 vs x:=42

seems a clear win for the second IMO.

I'm forced to agree. So I'll use the latter syntax if I end up writing anything
further about rebinding :)

Cheers,
Nick.
 
S

Serge Orlov

Alexander said:
Hello All!

I'am novice in python, and I find one very bad thing (from my point
of view) in language. There is no keyword or syntax to declare
variable, like 'var' in > Pascal, or special syntax in C. It can
cause very ugly errors,like this:

epsilon=0
S=0
while epsilon<10:
S=S+epsilon
epselon=epsilon+1
print S

It will print zero, and it is not easy to find such a bug!

I'm late to the party, but I found an interesting text by the Guinness
book
record-holder in typing. He claims that the python way of dealing with
typos is right. He doesn't write about python directly but the main
idea is to punish heavily for every typo. He also has "nice" words for
software industry and the backspace key. Read it here:
http://www.supremelearning.com/bookexcerpts.html

By the way if my reading of poor quality scan of his record certificate
http://www.supremelearning.com/image_certificate.html is correct, his
typing speed was 614 characters/minute. Impressive! There is also his
book in Russian language:
http://www.supremelearning.com/russianslbookpart1.html

As for me, typos have never been a big problem. They happen rarely.
As the Guinness book record-holder suggests: don't make typos!

Serge.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top