CamelCase versus wide_names (Prothon)

M

Mike

Mark Hahn said:
Of course in the Python world you alread have wide_names as your standard,
but could you for the moment pretend you were picking your standard from
scratch (as we are doing in the Prothon world) and give your vote for which
you'd prefer?

Since Python has removed the need for the ';' character, how about
using that as a word separator? It's very easy to type, as it is right
next to the 'L' key on a qwerty keyboard.

Here;is;a;test;paragraph.;What;do;you;think?;Is;it;the;greatest;programming;language;invention;since;the
;curly;brace?

- Mike
 
E

Erik Max Francis

Mike said:
Since Python has removed the need for the ';' character, how about
using that as a word separator? It's very easy to type, as it is right
next to the 'L' key on a qwerty keyboard.

Here;is;a;test;paragraph.;What;do;you;think?;Is;it;the;greatest;programming;language;invention;since;the
;curly;brace?

This is a really stellar example of why designing a language by
committee doesn't work very well ...
 
R

Roy Smith

Erik Max Francis said:
This is a really stellar example of why designing a language by
committee doesn't work very well ...

Well, we could always try something like...

<variable>
<name>
<component>long</component>
<component>variable</component>
<component>name</component>
<name>
</variable>
 
M

Mark Hahn

Well, we could always try something like...

<variable>
<name>
<component>long</component>
<component>variable</component>
<component>name</component>
<name>
</variable>

That's it! We'll do the whole Prothon language in XML! (The one idea that
hasn't been proposed over in Prothon lists yet :)
 
G

Greg Ewing

Mark said:
When I first started I thought everyone's opnion mattered and that I had the
job of merging eveyone's ideas into a grand scheme that made everyone happy
<hearty laugh>.

That's the kind of process that gave us COBOL, Algol68 and Ada...
 
S

Sergei Organov

Dave Benjamin said:
Hey, as long as Perl is adding French quotes to the language, why don't we
dig around in Unicode for some lower case numerals? I bet you could find
some if you looked hard enough, in between the Klingon alphabet and
Dingbats 47 perhaps... =)

Or we can use underscore in this case: 'usb201_Driver', where underscore
means "camelize previous number" :)
 
A

Antoon Pardon

Op 2004-04-22 said:
That's it! We'll do the whole Prothon language in XML! (The one idea that
hasn't been proposed over in Prothon lists yet :)

How about this idea, which is about something different but may be
related. Allow your argument list to be divided among the identifier.

If you would define a component as something like an identifier but
without an underscore and then define an identifier as a number
of components attached to each other with underscores you then could
allow a function to have part of its arguments between components.

Something like:

copy_to(a,b)

could then also be written as:

copy(a)to(b)
 
M

Mark Hahn

copy(a)to(b)

That's cool looking but I'm pretty sure impossible to parse the way you want
:)

Although, out angle brackets are free in Prothon right now. We could
reserve them for that:

copy<a>to<b>.

Interesting. That would drive newbies to the language crazy :) It sure is
readable. It kind of lets you design you own syntax inside the symbols.

I must hand it to you. That's one of the most creative crazy ideas I've
seen lately. It is refreshing to see fun creative feedback instead of the
"your language is just Perl" type of feedback.

Maybe you could hang out on Prothon-user ?
 
J

Jeff Epler

Do you have a use picked out for '@', '!' or '?'? A new use for ``?
I think those are all either meaningless in Python, or tagged for
eventual deprecation in Python 3.0 in the case of ``.

Python already allows comments and strings to be in unicode or other
encodings, and may allow unicode names in the future. Unicode defines a
lot of mathematical symbols. Perhaps both languages should reserve the
special __uNNNN__ and __ruNNNN__ (where NNNN is the unicode character
value in hex), with __u0043__ being an alias for __add__ (etc) during a
transitional period. I think that __u2261__ will be particularly useful
to those who wanted to express "is substitutable for", without breaking
the meaning of "==" or "is" operators to do it. (if you recall that
recent thread)

One possible problem with this approach is that you have to know at
parse time whether an operator is a unary prefix operator (like
__u222b__) or a binary operator (like __u2261__). On the other hand,
this is already solved for + and -, so it must be OK.

Is it possible for Prothon to innovate here?

Unfortunately I'll have little internet access for the next two weeks,
but it'll be interesting to see how prothon evolves over this time.

Jeff
 
G

Glenn Andreas

If you would define a component as something like an identifier but
without an underscore and then define an identifier as a number
of components attached to each other with underscores you then could
allow a function to have part of its arguments between components.

Something like:

copy_to(a,b)

could then also be written as:

copy(a)to(b)

Or make it like Objective-C or Smalltalk:

copy: a to: b

(which is odd for either language since there is no reciever for the
copy:to: message)

Probably wouldn't parse well with an if statement, though:

if copy:a to: b:
print "it copied"

That makes my eyes hurt just looking at it...

(I once made a simple scripting language that was built entirely from
that syntax, but every "word:" after the first was actually used as a
parameter name which could be in any order - it all worked suprisingly
well since I could do stuff like:

copy: a to: b

or

copy: a symbolicLink: false to: b

or
copy: a to: b symbolicLink: false

)
 
P

Paramjit Oberoi

The problem comes down to the fact that variable names consist of
multiple words, and there is no standard way of combining multiple
words into one name. But, what if the language was aware of this
fact?

If the language 'knew' that identifiers potentially consisted of
multiple words, maybe it could detect a few different kinds of
styles and automatically do the right thing?

Or maybe programmers could declare their own personal word-combiner,
sort of like a metaclass?

I'm not sure of this is a really good idea or a really bad one...

-param
 
?

=?iso-8859-1?Q?Fran=E7ois?= Pinard

[Paramjit Oberoi]
If the language 'knew' that identifiers potentially consisted of
multiple words [...]

There are not many places in Python syntax where we may have many
identifiers in a row. One of the places is for allowing `as' within the
`import' statement without making `as' a reserved word.

However, this approach would allow an arbitrary amount and kind of white
space between the successive words of a single identifier. Who knows,
it might be good nevertheless?
 
G

Greg Ewing

Paramjit said:
If the language 'knew' that identifiers potentially consisted of
multiple words, maybe it could detect a few different kinds of
styles and automatically do the right thing?

That could be achieved by making it case-insensitive and
underscore-ignoring.
 
P

Paramjit Oberoi

If the language 'knew' that identifiers potentially consisted of
That could be achieved by making it case-insensitive and
underscore-ignoring.

That would cause aliasing if the two words that form the
identifier also form a third word when put together.
For example:

if sys.platform = 'Windows CE':
win_ce = True

if feeling_pain:
wince()
 
A

Antoon Pardon

Op 2004-04-23 said:
That's cool looking but I'm pretty sure impossible to parse the way you want
:)

What is so hard to parse? It is just a sequence of components and
argumentlists. You just string the components together to form
an identifier and combine all the argumentlists into one.
Although, out angle brackets are free in Prothon right now. We could
reserve them for that:

copy<a>to<b>.

Interesting. That would drive newbies to the language crazy :) It sure is
readable. It kind of lets you design you own syntax inside the symbols.

I must hand it to you. That's one of the most creative crazy ideas I've
seen lately. It is refreshing to see fun creative feedback instead of the
"your language is just Perl" type of feedback.

Maybe you could hang out on Prothon-user ?

Where do I subscribe?
 
M

Martin Maney

That's the kind of process that gave us COBOL, Algol68 and Ada...

Sounds like there's something to be said for it, then. One that's
still the underpinning for a scary portion of the heavy lifting behind
large corporations, one that died while leaving its influence all over
the next generation, and one that... well, two out of three is still
'way above average.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top