Long names are doom ?
Rainy
sill at optonline.net
Sat May 26 11:52:12 EDT 2001
On Sat, 26 May 2001 08:35:38 -0700, Glen Starchman <glen at enabledventures.com> wrote:
> Rainy wrote:
>>
>> On Sat, 26 May 2001 00:51:42 -0600, Andrew Dalke <dalke at acm.org> wrote:
>> > Nick Perkins wrote:
>> >>what if you wanted to name, say, a function
>> >>with a string so that you could include spaces?
>> > ...
>> >>...just a silly idea.
>> >>ok, i'll go to bed now.
>> >
>> > Something like that came up last year, with
>> > the proposed syntax of
>> >
>> > obj."attribute with spaces in the name"
>> >
>> > As I recall, people thought it interesting, but that's
>> > as far as it went. I don't think there were any
>> > definite implementation reasons against it. But no one
>> > could get a solid reason to have it, and for those
>> > few cases where that functionality was needed
>> >
>> > getattr(obj, "attribute with spaces in the name")
>> >
>> > works.
>> >
>> > BTW, in your proposal,
>> > fn['my special function']()
>> >
>> > the [] syntax could be confused with list/dict lookup.
>> >
>> > Andrew
>> > dalke at acm.org
>>
>> What's the big problem with implementing this:
>>
>> my varibable = 2
>>
>> my result = my variable * 3
>>
>> def my function(some variable):
>> return some variable / 8
>>
>> ?
>>
>> I know there is something seriously wrong with this, because otherwise
>> it'd be done already in some language (and afaik it isn't). So what
>> exactly is wrong? I'm asking because typing up a name with underscores
>> feels_awkward and separatingByCapitalLettersLooksAwkward. I can't remember
>> any situation where a space is needed to separate one variable from another,
>> and syntax characters aren't allowed in variable names..
>
> Not with Python, but in most shell variants:
>
> for x in $var1 $var2 $var3...
>
> is valid.
Yeah, I can easily see why in most shells it'd be a bad idea.. but in
python?
>
> Besides, whitespace in variable names? C'mon! That's the opposite
> extreme of Fortran (older versions) with no whitespace.
The only golden rule I know says that there are no golden rules, not that
all extremes are bad :-)
>
> If you want to prefix a variable name with 'my ', just use Perl. ;-)
Well, that was just to demonstrate that a space is in there. I don't think
naming a variable my_var or myVar or my var is a good idea.
>
>
> What am I missing
>> here? :-)
>>
>> >
>> >
>> >
>>
>> --
>> Lucifer Sam Siam cat
>> Always sitting by your side
>> Always by your side
>> That cat's something I can't explain
>> - Syd
--
True sailing is dead
- Jim
More information about the Python-list
mailing list