[Pyobjc-dev] Re: [Pythonmac-SIG] pyobjc / cocoa
tmk
tmk@mac.com
Thu, 17 Oct 2002 02:28:06 +0200
On Thursday, Oct 17, 2002, at 00:32 Europe/Brussels, Jack Jansen wrote:
>
> On woensdag, oktober 16, 2002, at 05:34 , bbum@mac.com wrote:
>> We have been down this path a number of times over the six year
>> history of the PyObjC module. In all cases, we have ended up back
>> with the naming conventions that we have now for a number of reasons.
>> Moving from double underbar to single underbar was definitely a win
>> -- made the code easier to read and write.
>
> I'm not convinced yet, but you're getting there:-)
>
> You're getting there because you have by far the most experience with
> this beast, so if you say the _ convention is A Good Thing and
> everything else leads to madness: okay, proof by authority:-) Also,
> the point of ObjC-Cocoa programmers moving to Python is a valid one.
Yes on both counts. That's exactly what encouraged to actually try and
write some code using the alternative syntax. And indeed, soon enough
it so happens that the "_" notation just "grew" on me and became quite
natural. I think it's because it "reads" effortlessly, whereas I needed
to pause and decipher the innercased notation.
> I'm not convinced yet, though, because I think it depends on the
> target audience. My first impression when I saw PyObjC code (about 18
> months ago) was "UGLY!! UGLY!! UGLY!!", and I immediately stayed away
> from it for a year. And
Funny. Same here. But that was the notation with the double underscore
(if memory serves I even de-lurked at that time just to say that I felt
the syntax looked really UGLY ;-). But with one underscore, as said
previously, it makes a lot of sense to me (much more than the
alternatives anyway).
One other thing, A paradox, I tend to dislike using underscores when I
write "regular" python code. I prefer using InnerCased (?) style. Funny
brain.
> I've heard of more people with this reaction. So, if we care about
> winning existing Python programmers over to Cocoa (which I think we
> should: even though Carbon is going to be around for a long time it'll
> only be interesting to existing Mac programmers, and Cocoa has the
> potential to win over unix and windows Python people) we should make
> sure it looks appealing.
> Let's try for a political solution. The official mapping is the _
> mapping. However, for convenience there are some method names that
> have an alias. This alias is translated early on (when looking up the
> method name from Python, or when creating the Python subclass of an
> ObjC class), and the official name is used from then on. Would this be
> workable?
Looks like a reasonable compromise. But I suspect (based on my humble
experience) that most people will eventually use the "_" naturally
(same as C programmers who first don't want to learn ObjC and then fall
in love with it ;-)
= tmk =
> --
> - Jack Jansen <Jack.Jansen@oratrix.com>
> http://www.cwi.nl/~jack -
> - If I can't dance I don't want to be part of your revolution -- Emma
> Goldman -
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: viaVerio will pay you up to
> $1,000 for every account that you consolidate with us.
> http://ad.doubleclick.net/clk;4749864;7604308;v?
> http://www.viaverio.com/consolidator/osdn.cfm
> _______________________________________________
> Pyobjc-dev mailing list
> Pyobjc-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>