# Some syntax suggestions

**URL:** <https://www.ruby-forum.com/t/some-syntax-suggestions/194319>\
**Category:** Ruby\
**Created:** [September 2, 2010, 12:33pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319 "2010-09-02T12:33:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 12:33pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/1 "2010-09-02T12:33:45Z")

</div>

Hello,

Is there any plan to remove the enforcing, that declare class names with  
capital letter as frist, and that variable names start with lower case  
letters? these enforing may conflicts with a person or company’s naming  
conventions.

And by the way, there will be so many ‘end’ keywords if nested  
conditions or declarations are used, it’s hard to differentiate which  
‘end’ belongs to which keyword, like ‘class’, ‘def’, etc. An alternative  
will be using ‘endclass’, ‘enddef’ instead, this may be more readable.

Thank you,  
Brian

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 12:39pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/2 "2010-09-02T12:39:01Z")

</div>

Hi –

On Thu, 2 Sep 2010, Brian X. wrote:

> Hello,
> 
> Is there any plan to remove the enforcing, that declare class names  
> with capital letter as frist, and that variable names start with lower  
> case letters? these enforing may conflicts with a person or company’s  
> naming conventions.

It’s not class names specifically that start with capital letters, but  
constants in general. Constants are scoped and resolved very differently  
from local variables, and the parser has to have some way to tell which  
is which. (And no, Ruby is not going to introduce variable and constant  
declarations 🙂

> And by the way, there will be so many ‘end’ keywords if nested  
> conditions or declarations are used, it’s hard to differentiate which  
> ‘end’ belongs to which keyword, like ‘class’, ‘def’, etc. An  
> alternative will be using ‘endclass’, ‘enddef’ instead, this may be  
> more readable.

Some people write “end#class” and such. I don’t – I find that it looks  
kind of cluttered, to my eye, and I figure that if the nesting is so  
deep, and the sections so long, that I can’t tell where they begin and  
end, maybe that’s a style issue.

David

–  
David A. Black, Senior Developer, Cyrus Innovation Inc.

The Ruby training with Black/Brown/McAnally  
Compleat Philadelphia, PA, October 1-2, 2010  
Rubyist [http://www.compleatrubyist.com](http://www.compleatrubyist.com)

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 1:07pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/3 "2010-09-02T13:07:43Z")

</div>

2010/9/2 Brian X. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Is there any plan to remove the enforcing, that declare class names with capital letter as frist, and that variable names start with lower case letters? these enforing may conflicts with a person or company’s naming conventions.

Sorry to sound a bit rude here but this is the syntax of the language  
we are talking about here not a personal preference or company policy.  
It is not the same as using tabs or spaces for indenting. If a company  
creates a naming convention that is actually contrary to the syntax of  
the language then the company is run by complete idiots, the same for  
a person who tries the same.

> And by the way, there will be so many ‘end’ keywords if nested conditions or declarations are used, it’s hard to differentiate which ‘end’ belongs to which keyword, like ‘class’, ‘def’, etc. An alternative will be using ‘endclass’, ‘enddef’ instead, this may be more readable.

Perhaps Ruby is not for you, in fact I suspect that programming is not  
for you.

From now on can you do all your posts in urdu, it would be much more  
readable for me even if it is completely unreadable for 99.999% of  
this list because as we all know it’s all about ME ME ME!!!

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 1:11pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/4 "2010-09-02T13:11:49Z")

</div>

2010/9/2 Brian X. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Is there any plan to remove the enforcing, that declare class names with capital letter as frist, and that variable names start with lower case letters?

You can have lowercase class names:

13:04:10 JavaProducts\_oslee\_ngcp\_dev\_R3.1\_be4rb$ ruby19 -e ‘x =  
Class.new do def foo; 123 end end;p x.new.foo’  
123

But keep in mind that here the class is referenced through a local  
variable only which has some implications wrt lookups as David pointed  
out.

> these enforing may conflicts with a person or company’s naming conventions.

All organizations I have worked for had naming (and other) conventions  
_per programming language_. IMHO this is the only reasonable way to  
go about it.

> And by the way, there will be so many ‘end’ keywords if nested conditions or declarations are used, it’s hard to differentiate which ‘end’ belongs to which keyword, like ‘class’, ‘def’, etc. An alternative will be using ‘endclass’, ‘enddef’ instead, this may be more readable.

That topic came up a few weeks and only got moderate support. I’m  
with David here - I don’t like it and I also think that you have an  
issue if your nesting is so deep that you can’t find through it any  
more. Apart from that there are automated tools that will fix broken  
indentation which helps a lot.

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/5 "2010-09-02T15:03:04Z")

</div>

Thank you very much, David and Robert.

I’m just a beginner trying to learn and use ruby, in the past I use  
C++/Perl’s symmetrical syntax style, so just some programming inertia.

Kindly Regards,

Brian

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 3, 2010, 3:43am UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/6 "2010-09-03T03:43:37Z")

</div>

On Sep 2, 2010, at 04:03 , Peter H. wrote:

> Perhaps Ruby is not for you, in fact I suspect that programming is not for you.

Don’t be an ass. We have enough here as it is.

---

<div class="post-metadata">

**Author:** ![xcoredev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/76d3ee/32.png) [@xcoredev](https://www.ruby-forum.com/u/xcoredev)\
**Post date:** [September 2, 2010, 4:12pm UTC](https://www.ruby-forum.com/t/some-syntax-suggestions/194319/7 "2010-09-02T16:12:10Z")

</div>

Hang on! Both Perl and C use { and } for almost everything. If you  
could cope with that then where is the problem with ‘end’?

Ok, syntax highlighting in editors can make seeing where the pairs of  
{ and } match up easier.

To be honest I was thinking you were an ex Pascal or Basic programmer  
(or perhaps Glow?)
