From: Brian Xue Date: 2010-09-02T22:02:06+09:00 Subject: Re: some syntax suggestions --_2df8f406-4a7a-4408-a863-ff6216e2b208_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit 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 > Date: Thu, 2 Sep 2010 20:10:45 +0900 > From: shortcutter@googlemail.com > Subject: Re: some syntax suggestions > To: ruby-talk@ruby-lang.org > > 2010/9/2 Brian Xue : > > > > 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 > > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > --_2df8f406-4a7a-4408-a863-ff6216e2b208_--