Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7367805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:35:03+00:00 2026-05-29T03:35:03+00:00

What do the vast majority of Rails shops do? Since Ruby allows for either

  • 0

What do the vast majority of Rails shops do? Since Ruby allows for either I’m sure there is a set standard I should probably fixate on making a habit since I’m just starting out with Rails.

According to Pragmatic Agile Web Development With Rails (4th Edition):

In Rails applications, you’ll find that most method calls involved in
larger expressions will have parenthe- ses, while those that look more
like commands or declarations tend not to have them.

So which is it? Or is it the wild west out there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:35:03+00:00Added an answer on May 29, 2026 at 3:35 am

    The Rails contributing style guide seems to favor

    my_method(my_param)
    

    over

    my_method my_param
    

    But most of the code I’ve seen seems to buck that trend. I would definitely say that you shouldn’t use open parentheses for a method call without parameters. The one guiding principle I’ve noticed is to emphasize code human readability. That leads me to the following conclusions:

    Don’t use the parentheses if
    Your method call has no arguments

    my_object.my_method
    

    Your method call is the only thing on the line

    my_object.my_method my_params
    form.submit "Create"
    

    Do use the parentheses if
    Your method call is on the same line as a number of method calls

    my_object.parse(my_arguments).join(", ").chomp
    

    However, there are different conventions for different situations that you’ll probably only see by looking at a lot of code. For example, methods that execute within a class definition mostly don’t use parentheses, and have each argument on a different, indented line:

    validates     :first_name,
                  :presence => true,
                  :format => { :with => /\S./ }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Regarding MySql, is there a character set to support all or the vast majority
Since the vast majority of monitors are 16-bit color or more, including mobile devices
Apparently the vast majority of errors in code are null reference exceptions. Are there
I'm pretty sure I can page cache the vast majority of my site but
The vast majority of applications does not handle disk full scenarios properly. Example: an
I've been looking at Boost and various other C++ libraries. The vast majority of
I'm working on an ASP.NET project in which the vast majority of the forms
I'm working on on a site built using struts2. The vast majority of our
I am currently picking up Grails and Roo. The vast majority of training materials
Background I am using the UTF8-CPP class. The vast majority of my strings are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.