... hab' ich mitzuteilen - L's blog

... with a touch of python - Didaktik der Informatik, Informatische Bildung, ...
Sun, 02 Sep 2007
Sat, 01 Sep 2007
Python 3.0a1 Release [ 10:39 Uhr ] [ 145 Worte ]

Vorsicht: Python 3k ist inkompatibel mit den 2.x Versionen

Python 3.0a1 Release ['Python 3000 (a.k.a. 'Py3k', and released as Python 3.0) is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. This is an ongoing project; the cleanup isn't expected to be complete until 2008. In particular there are plans to reorganize the standard library namespace.']
Fri, 31 Aug 2007 16:53:00 -0000
[ rss20 Feed ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.pythonware.com/daily/#entry627302368634438632 [ Verweis - Eintrag ]

Fri, 31 Aug 2007
Thu, 16 Aug 2007
Fri, 10 Aug 2007
The Asterisks And The Arrows [ 23:37 Uhr ] [ 636 Worte ]

While learning a new language it is important to identify what to reuse and what to unlearn. I experienced some funny moments while learning languages and interacting with others. Here are a some of them.

One of my friends, who has been a C follower, is learning Python and we keep discussing what he has discovered and how I had handled some things when I had started learning it. Like many, he started programming alongside reading and probably skipped some parts unintentionally. One fine day he called me and felt very satisfied when he said, “Man, Python supports pointers!” I was surprised and confused until he told me the line of code he came across.

 def my_func(*params): 

He digs pointers in C and has felt handicapped when he has tried to learn languages without them. Out of wishful thinking and habit, the first thing that came to his mind was that it is a pointer that he could use for manipulation. Only on some discussion did he come back on earth to realize that it was more about variable length parameter list for positional parameters. To make it worse for him Python also had **params, which meant a dictionary. Of course he hated Python and me for a couple of hours after that, and then was back on the track.

This example made me realize how important it is to leave something behind while taking in something new. And it is critical to realize what to leave behind, which unfortunately does not have a generic formula. Only out of experience can you truly know what to apply and what to not.

To think of, asterisks mean so many things in so many languages:

  • * is used as the multiplication operator in many languages
  • * is used as Kleene star, used in regular expressions
  • ** is used for exponentiation in Fortran
  • ** is used for list subtraction in Haskell
  • (* ... *) is used for comments in Pascal and Prolog
  • /* ... */ is used for comments in C, C++ and Java

It is important to consciously think of * as an asterisk not as a pointer when you start learning something new, even if you have been programming in C for your whole life. The same symbol gets used for something else across languages and this can cause a nighmare if the syntax is not learnt with a fresh mind. I had such a experience because Python uses { ... } for dictionaries and Erlang uses it for tuples. Whereas Python uses ( ... ) for tuple.

Arrow (->) is another symbol that gets various meanings in different languages. It was difficult for a colleague of mine to accept that it was a block separator in Erlang, and again, not a way of accessing member data or methods. Just like asterisks they get different meanings. Haskell uses -> in type signatures. Similarly | has also surprised me many times. Ethymology of symbols is a good place to look at how various symbols get used.

I am sure we can go on and on about this. But importantly this tells me that unless I learn the new syntax afresh, it is going to cause problems. It is necessary to rollback to asterisks and brackets and arrows before we start learning a new programming language.


[ Datum/Zeit: ] Fri, 10 Aug 2007 08:41:22 +0000

[ Quelle: ]
Abhijit Nadgouda
[ rss10 Feed ] http://feeds.feedburner.com/ifacethoughts/entries [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://feeds.feedburner.com/~r/Ifacethoughts/entries/~3/142668142/ [ Verweis - Eintrag ]

Wed, 08 Aug 2007
Python anti-pitfalls [ 20:38 Uhr ] [ 96 Worte ]

Richard Jones: Python anti-pitfalls ['The following are a quick (random, off the top of various heads) list of things that I think are anti-pitfalls in Python. That is, because the language has these features, it is harder to make programming mistakes. ']
Mon, 06 Aug 2007 10:38:00 -0000
[ rss20 Feed ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.pythonware.com/daily/#entry295004860539836950 [ Verweis - Eintrag ]

Malen nach Zahlen [ 00:32 Uhr ] [ 108 Worte ]

Schöner Titel ;-)
Mein Dank' geht an Jörg.

Jehiah Czebotar: Creating Images with Numpy: »Suppose you need to create images pixel by pixel, and they are large images, and you want to do it quickly... How do you do it? with PIL putpixel()? with wxImage SetRGB()? No, they are to slow, you need to use Numpy.« [Daily Python-URL! (from the Secret Labs)]

[ rss10 Feed ] http://www.schockwellenreiter.de/xml/rss.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.schockwellenreiter.de/2007/08/07.html#malenNachZahlen [ Verweis - Eintrag ]

Sun, 05 Aug 2007
Code Like a Pythonista: Idiomatic Python [ 21:48 Uhr ] [ 81 Worte ]

David Goodger: Code Like a Pythonista: Idiomatic Python ['In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt.']
Sun, 29 Jul 2007 11:35:00 -0000
[ xhtml ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Eintrag ]

[ xhtml ] http://www.pythonware.com/daily/#entry7065112551653266417 [ Verweis - Eintrag ]

<<  0 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35  >>


Inhalte unterliegen dem Copyright von L. Humbert.
Creative Commons License
Die Inhalte stehen unter einer Creative Commons License.