[IronPython] more pythonic than python ( continuation)

fernando moreira fclm1000 at msn.com
Tue Jun 20 20:42:40 CEST 2006



Thanks for your kind replies.

As newbie, i forgot to use 'self' inside the constructor :P . Of course, i 
can't argue beside your expertises about the internal mechanics of the 
language.

But since i am newbie and sice python intends to be easy to learn, compact, 
clean, friendly, intuitive, execelent first language etc... I can express 
the following:


I type

>>>str = "abc"; str[0] = "z"

Then the interpreter thinks "Oh no! Here comes another newbie that does not 
know that strings are imutable or else all sorts of nasty consequences would 
happens. Can't he read the manual more carefully ? Why can´t he type      
str = 'z' + str [1:]       or   maybe write some class to deal with it ? Let 
me send him my traditional error message."

But what i would expect from a really pythonic interpreter is "He he he... 
Another newbie that does not know strings are imutable. I am a very friendly 
interpreter of a very intuitive language; ).  So, behind the scenes i will 
send the present string to trash after i create another one with the same 
variable´s name. Thus the newbies will keep smiling and saying that python 
rocks !"


Ok. I can begin to learn to use __slots__ and/or "several tricks with 
``__setattr__``, metaclasses, and ``__slots__`` that can all be used to 
achieve what i want". But i don´t FEEL it is the lovely PYTHONIC way.

Let me abuse of your time and tell a little history. Around 25 years ago,  i 
passed happy hours using trs-80 basic ( if my memory is not failing). That 
hobby had no continuation . About 15 months  i decided to program again. I 
searched the internet for which language i should use. C# was not an option 
because i thouhgt i had to buy it. I started with C++. Being self-taught  in 
C++ and coming from a background of the old procedural, clean-sintaxed and 
compact Basic was like a stand in a torture chamber. Then i tryed Java, wich 
promissed to throw in the garbage can the complication of C++ and was a 
plataform too. I mean it had(s) functions(classes) to deal with mouse and 
image on screen, etc... Still i coud not believe that as computers and 
applications turned so  amazing powerfull along decades, the computer 
languages had dismissed the good old Basic
and adopted some really complicated sutff. After experimenting other 
languages  in internet, i met Python. Wooow, love at first sight ;). Python 
seemed to be what i dreamed a computer language should be. I shout to my  
son: "Come here quickly cause your daddy will teach you computer 
programmimg.!". But my honeymoon with Python had some problems. I wanted to 
program 2D games and there was no good GUI to do  it.

Then Ironpython shined in my life. Till then i had no idea of what .NET 
meant. I thought it was only a marketing performance of MS, weak in content. 
Well, i had difficoulties self-taughting me Python and .NET trhough the 
IronPython iterpreter and the complex ( for beginners)  C# examples MSDN 
show. I had to translate them to IronPython -  i got no idea i already  had 
a C# compiler in my computer :P.  Ahh.. and i was self-teaching GUI 
programming and OOP at the same time ( though i have to admit that my 
experiments with Java and C++ helpded a bit).

For not be longer, i can tell that i felt in love with MSIL ( only wish it 
was more compact ), had sad deceptions with Python and ( you can laugh at 
will, i am newbie and probably don´t have a clue about what i am talking ), 
though i hate to use semi-colons all the time, the ugly brackets and the 
verbosity, i feel myself much more confortabe, pleased and safe writing in 
C# than in Python. I feel C# is more pythonic than Python after i had some 
introduction to the language.

In Python my first program can be :
print "this is my first program"

Nothig can be simpler.
But when i have to deal with classes. in C# i can use the intuitive, easy, 
friendly, etc... code like this...

public class Verbs {

	string bother;
	string annoy;

	public Verbs() {
		this.annoy = "argh";
            this.bother = "bargh"; } }

and everything works fine.

Well gentlemen, i am not here for complain about your job nor about 
IronPython. Indeed i am very glad of what you have done. I am  bit sad 
because now i know that make Python perfect ( as i dreamed it should be) is 
not one of  your goals. I understand that it is not your responsability.

Thank you for your kind attention.

_________________________________________________________________
MSN Messenger: instale grátis e converse com seus amigos. 
http://messenger.msn.com.br




More information about the Ironpython-users mailing list