Another try at Python's selfishness

T

Terry Hancock

Yes, I 100% agree to that point!
But the point is, the current situation is not
newbie-friendly (I can tell, I am a newbie): I declare a
method with 3 parameters but when I call it I only pass
2 parameters. That's confusing. If I declare a member
variable, I write: "self.x = ValueForX", why can't I be
equally explicit for declaring member functions?

For someone new to OO in general it might as well be
something good, so he realises that there actually
really is a hidden parameter. After all, there is
something to understand with "self", and this discrapency
between the number of arguments and parameters puts
newbies to it.[/QUOTE]

Yes. I have to say that I learned OOP at the same time as
Python (I made attempts with C++ that were moderately
successful, but beyond implementing new math objects, I
couldn't really see the benefit OOP then. I didn't "get"
it until I started using Python).

So, the idea of "the object itself is the first argument to
the function" made it implicitly clear to me what the heck
was this whole business about "methods".

I found the Python approach is very enlightening.

By contrast, Javascript seems positively obtuse. First, the
equivalent to "self" is a magically-appearing variable
called "this". But to make matters worse, this behavior is
repeated in many places -- you have to know when and where
magical variables like "this" and "prototype" appear, and
it's not at all obvious when reading other people's code.

(I suppose a formal introduction to Javascript would
explain these things -- but I note that many online "how to"
type documents skip them, partly because OOP is not very
popular with most casual Javascripters).

I tend to think of Javascript as "almost Python, but
stupidly designed", because of stuff like this.

My apologies to Javascript fans, I acknowledge that my
opinion is subjective. ;-)

Cheers,
Terry
 
F

Frithiof Andreas Jensen

Having read previous discussions on python-dev I think I'm not the only
Python programmer who doesn't particularly like python's "self"
parameter:

Ok, there might be five programmers and one imam. The imam does not like
anything more recent than 700 A.D ...
What do you think?

Troll!
 
B

Ben Wilson

"But the point is, the current situation is not newbie-friendly (I can
tell, I am a newbie)"

I will agree to that, as I consider myself still new. _But_, it's a
stumbling stone only briefly. Get enough nagging error messages, and
you learn and move on. I agree with the grandparent poster that it is a
perfect self-documenting thing, as the use of 'self' is pretty obvious.
For a language that one can learn in a short time, this is a tempest in
a teacup.

I'm just trying to disown my several years of Perl. I like PHP too much
and have no experience with Python in a CGI environment. So, I'm a
little bit confused linguistically. ;-)
 
C

Charles Krug

"But the point is, the current situation is not newbie-friendly (I can
tell, I am a newbie)"

I will agree to that, as I consider myself still new. _But_, it's a
stumbling stone only briefly. Get enough nagging error messages, and
you learn and move on. I agree with the grandparent poster that it is a
perfect self-documenting thing, as the use of 'self' is pretty obvious.
For a language that one can learn in a short time, this is a tempest in
a teacup.

This old C hound finds it much more sensible than C++ or Java, where the
"self" parameter (called "this") is implicit rather than explicit and
you just sorta kinda hafta "know" it's there and the correct syntax to
use to reference it.

Then there's all the places where you need a Secret Decoder Ring--in
Java you have to define the equivalents of stdout and stdin as they
aren't provided. In c++ you can't overload the << operator in your
class, you have to use a "friend" function and you have to return an
ostream--the "Rule of Three" for constructors, and just generally lots
of small knotty issues to bite beginners.

9 times out of 10, Python "Just Works" the first time and things do what
your mind says they "should" without having to learn a seventeen special
cases to everything.

IMO, YMMV, Not Valid in Vermont, Happy Fun Ball may accellerate to
dangerous speeds. Do NOT taunt Happy Fun Ball.
 
F

Frithiof Andreas Jensen

DH said:
You Danes and your Muslim jokes :)

;-)

A culture thing, that: They are now accepted as part of society, so we treat
them equally to the people from Århus, Copenhagen, West-Jutland,
Sout-Jutland, Bornholm and Mols (a tiny area 30 km from Århus). If we did
not care for them, we would not poke fun at them occasionally.

So far, I think the "integration" has really improved a lot because this
affair has clearly shown that the Danish muslims are pretty much like
everyone else here. The ethnic kiosks still sell Jyllands Posten, the Danish
still buy groceries in ethnic shops e.t.c. Like Normal. No riots, looting
and threats from hooded cowards and bullies.


What we instead have learned are that the Imams - some of which have been
given asylum - are blatantly lying and falsifying evidence in order to
slander the country that pay their social security when the very first
opportunity arises. Maybe those people should not be here in the first
place.

We have also learned that there is no point in getting involved in dialogue,
export grants (i.e. bribes) and foreign aid money (more bribes) with
dictatorships and defunct states. The effort should be directed elsewhere,
where it is actually any use.

Finally we can take comfort in knowing that the "lunatic segment" in the
population is clearly less than 1500 out of 5,000,000 people - although the
loonies do get 80% of the media coverage (like f.ex. the 300 "autonomen"
that just *had* to be the only violent segment in a media-hyped
"confrontational" demo with 30(!) neo-nazis, 200 muslims and about half the
Danish police force present in riot gear - Great Plan Einstein; ). The
TeeVee news should be relabeled "Fools Hour" - their mantra seems to be that
"if you want the opinion of any large group, go seek out the village idiot
and ask him".

The conclusion is that the *real* threat to democracy does *not* come from
the lunatic segment but from connected people with nice suits and vested
interests such as the Danish Industri Association that are clearly willing
to take in a used Sharia as part of a trade. They worked for Hitler too and
has clearly learned nothing!!


PS:

If one was trying to detect fanatics of any creed, a certain indicator would
be that they have absolutely no sense of humour - they suffer from a
yet-to-be-described variant of autism I.M.O.
 
C

Christos Georgiou

If one was trying to detect fanatics of any creed, a certain indicator would
be that they have absolutely no sense of humour - they suffer from a
yet-to-be-described variant of autism I.M.O.

Although I generally agree, I've seen images of fanatics laughing madly when
they employ their fanatism; so they might have some sense of humour, even if
a perverted one (perverted relative to your or my sense of humour, obviously
:) They tend to lack self-sarcasm, though.

Anyway, someone wiser than me (probably so much wiser that I subconsciously
forgot their name!) said: "The difference between a saint and a fanatic is
that the saint fights the evil inside him/herself..."
 

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

Forum statistics

Threads
474,284
Messages
2,571,411
Members
48,104
Latest member
Hellmary01

Latest Threads

Top