Re[2]: Re: Re: Re[2]: Re: class proposal

Lenard Lindstrom <[email protected]> Wed, 14 Jul 2004 20:06:06 -0700 (Pacific Daylight Time)
Newsgroups gmane.comp.lang.prothon.user
Message-ID <Mahogany-0.66.0-4294685873-20040714-200924.00@pop3.norton.antivirus>
On Thu, 15 Jul 2004 02:31:15 +0200 Christian Tismer <[email protected]> wrote:

> Replying on an old topic, just by chance...
> 
> Lenard Lindstrom wrote:
> 
> ...
> 
> > What I dislike about Python:
> > 
> > 1) Case sensitive identifiers. This is a C holdover. Many high level languages
> >    - Pascal, Ada, PL/I - are case insensitive. Why not Prothon? Just rename
> >    Object to root to remove the conflict with the object statement.
> 
> This is not a trivial subject. I have my personal preferences,
> and I guess for 10 users, there are 15 preferences.
> 
> Ignoring my ALGOL86 roots, I come from the Pascal-style languages.
> I always loved that case sensitivity was no issue.
> At the same time, I really *hated* that these language allowed
> me to write rpograms with different case than for instance the
> author of a module intended.
> This is not only because it makes it harder to scan Pascal
> sources for certain identifiers, it is also that I dislike
> people writing "sloppy source", just ignoring what I wrote
> for them with care. So they either should use my way throughout
> their source, or they should explicitly change it, by an option
> for their source viewer, for instance.
> 
> What *I* would really like is this:
> - A language that dis-allows co-existance of the same identifier
>    with different case
> - even disallowing co-existance of similar identifiers, using
>    CamelCase and nocamel_case
> 
> I think this would remove a lot of hidden bugs in existing
> Python code, as well. Simple mis-spellings of CaSe.
> 
> And this in combination with an editor which
> - understands the different ways of variable markup
> - has an automated renaming of identifiers to the "original"
>    way to do it, or to "my way to do it" on module level.
> 
> So what I want is:
> 
> - Make it into a syntax error to use different style of the
>    same identifier as different variables/attributes
> - automagically replace different style with the original style
> - make the equivalence rules for identifiers into a user option
> - let the identifiers of a foreign module appear imported into
>    my module with my preference of casing style.
> - make this whole idea into a configurable option. The way a
>    program is represented should be directed by the taste of the
>    user, nothing else.
>
I checked out Visual Basic for Applications to see what it does. The editor in
Microsoft Word lets you type an identifier in any case and changes it to the
VB casing standard on the fly.

> > 3) The inequality operator != . Lets either adopt Pascal's <> for not equal and :=
> >    for assignment, or C's &&, ||, and !.
> 
> Not understood. "!=" is in C as "&&", "||" et al. are.
> What is the problem?
> 
It is fine since we are all C programmers. But forget that you know C for a moment.
The ! as "not" is not obvious. The fact is when I first started using Python and
saw "!=" I also expected "&&" and "||". Guess what? They were not there. Instead
there was "and" and "or", just like Pascal. In the context of Python "!=" is just
silly. And in Prothon the "!" or bang symbol has a meaning: change an object in
place and return it. Have you notices the append! for lists, etc.

But "!=" is not an issue worth getting worked up over. I accept what I am given.

Anyways, I was only half serious on any of these proposals. I don't consider them
real problems with Python. But since Prothon is starting over why not bring them
up just to see what is possible.

Lenard Lindstrom
<[email protected]>