The point of omitting parentheses

So it's really a question of cost vs. benefits. I think the cost is quite high. Then again, I'm new to Ruby.

i'm going on 7 years of full time ruby and it's bitten less than 5 times.

Good to know. I don't really see it as a major problem. I was just trying to get a handle on the reasoning behind the design choice.

stick with it a while, if you hate it you have the option of putting parens
together with each and every method call - ruby won't stop you! :wink:

I tend to stick with coding conventions, so if everyone else starts doing it, I will as well :slight_smile: I'm not convinced that Ruby will be the OOP language to rule all OOP languages, but it is full of interesting ideas, many of which I haven't seen before, so just learning about it helps me to become a better programmer, even though I might never use it professionally. I don't find it trivial to grasp, though. There is a lot of things going on implicitly, which is both good and bad, mostly good I think.

Anyway, thanks for the explanations everyone. I got a lot out of it :slight_smile:

Best Regards,
   Henrik Schmidt

···

ara.t.howard@noaa.gov wrote:

On Thu, 21 Sep 2006, Henrik Schmidt wrote:

One thing, at least with RoR, is if the first param is a hash then
parens are necessary. e.g.

form_tag({:action=>:update, :id=>1})

I can't remember what error gets thrown if there aren't parens.

Myself, I like not having to type parens. RoR's coding style for patches
specifies using parens though (which is probably best, to avoid
ambiguities or errors).

Joe

···

--
Posted via http://www.ruby-forum.com/.

Phrogz wrote:

Henrik Schmidt wrote:

Wow, public, private and protected are actually method call. I wonder
how they implemented that. Now I HAVE to get the source code. :slight_smile:

See if the following helps: code in classes isn't compiled, it is
executed. Defining a function is a discrete step that runs (and returns
nil), and that you can listen for.

Got it. That's pretty cool. Thanks for the help.

Best Regards,
    Henrik Schmidt

Thomas Adam писал(а):

Like everyone else who has replied to this thread -- they're either
explicitly stated or alluded to the fact that it's purely a matter of
choice.

My this year point is as follows:
To use or not to use -- is a matter of taste.
To have a rule for doing either -- is a matter of clear writing.
To use an appropriate rule -- is a matter of productivity.
Constantly improve the rules -- is a metter of progress.

Best respects,
S.Z.

I feel like such a n00b -- I don't think I've ever created a DSL and
don't expect to in the near future.

Joe

···

--
Posted via http://www.ruby-forum.com/.

You do, you have, and you will: a library with a well-designed API is
essentially a DSL.

···

On Fri, Sep 22, 2006 at 04:46:29AM +0900, Joe Ruby MUDCRAP-CE wrote:

I feel like such a n00b -- I don't think I've ever created a DSL and
don't expect to in the near future.

--
Keith Gaughan -- kmgaughan@eircom.net -- http://talideon.com/
One thousand years ago we wouldn't have known the news outside our village.
I wish things were like that now.

Keith Gaughan wrote:

···

On Fri, Sep 22, 2006 at 04:46:29AM +0900, Joe Ruby MUDCRAP-CE wrote:

I feel like such a n00b -- I don't think I've ever created a DSL and
don't expect to in the near future.

You do, you have, and you will: a library with a well-designed API is
essentially a DSL.

Phew! It's good to know I've been buzzword-compliant all these years. :stuck_out_tongue_winking_eye:

Joe

--
Posted via http://www.ruby-forum.com/\.