coding style

Discussion in 'Ruby' started by baklarz, Oct 6, 2005.

  1. baklarz

    baklarz Guest

    Hey,
    Does ruby programmers preffer java style "def myMethod" or "def my_method" ?
    Does exist any standrds ?
    --
    Tomasz Drobiszewski
     
    baklarz, Oct 6, 2005
    #1
    1. Advertising

  2. baklarz

    wannes Guest

    On 06/10/05, baklarz <> wrote:
    > Hey,
    > Does ruby programmers preffer java style "def myMethod" or "def my_metho=

    d" ?
    > Does exist any standrds ?


    When coding ruby, the uncerscore way of writing methods is prefered;
    for classes CamelCase is preferred.
    A good startingpoint for this is:
    <http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=3Dview;name=3DRubyCodingC=
    onvention>

    grtz,
    wannes
     
    wannes, Oct 6, 2005
    #2
    1. Advertising

  3. I do believe 'def my_method' is preferred.



    On 10/6/05, baklarz <> wrote:
    > Hey,
    > Does ruby programmers preffer java style "def myMethod" or "def my_metho=

    d" ?
    > Does exist any standrds ?
    > --
    > Tomasz Drobiszewski
    >
    >
     
    Farrel Lifson, Oct 6, 2005
    #3
  4. baklarz

    zimba Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    baklarz a =E9crit :

    > Hey, Does ruby programmers preffer java style "def myMethod" or
    > "def my_method" ? Does exist any standrds ?



    Hi baklarz,

    Welcome to ruby :)

    Ruby preffers underscore_methods.

    For more informations, RubyGarden[1] is a good ressource. Here[2] is
    an article that explains the different styles.


    Cheers,
    zimba

    [1] http://www.rubygarden.org
    [2] http://www.rubygarden.org/ruby?RubyStyleGuide
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)
    Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

    iD8DBQFDROnSBPd9MK2EeAsRAmL5AJ0Xnwu+dYkhbDl9Cp3RZhAmnj3uRACffz26
    7q0TBGGbEZwUcnZJ3EoFeO8=3D
    =3D7ijL
    -----END PGP SIGNATURE-----
     
    zimba, Oct 6, 2005
    #4
  5. On Oct 6, 2005, at 3:10 AM, zimba wrote:
    > For more informations, RubyGarden[1] is a good ressource. Here[2] is
    > an article that explains the different styles.
    > [1] http://www.rubygarden.org
    > [2] http://www.rubygarden.org/ruby?RubyStyleGuide


    FYI, I just cleaned that page up a bunch. I welcome corrections if I
    have mis-stated the community consensus on any topics.
     
    Gavin Kistner, Oct 6, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Baxter

    style for coding latches

    Paul Baxter, Aug 10, 2003, in forum: VHDL
    Replies:
    7
    Views:
    1,145
    Mike Treseler
    Aug 15, 2003
  2. Willem Oosthuizen

    Coding style to prioritize certain inputs

    Willem Oosthuizen, Sep 2, 2003, in forum: VHDL
    Replies:
    5
    Views:
    500
    Mike Treseler
    Sep 4, 2003
  3. Analog Guy

    Coding style for CPLD vs FPGA

    Analog Guy, Mar 11, 2005, in forum: VHDL
    Replies:
    3
    Views:
    5,453
    Klaus Falser
    Mar 14, 2005
  4. calmar
    Replies:
    11
    Views:
    896
    calmar
    Feb 21, 2006
  5. Ken Varn
    Replies:
    0
    Views:
    470
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page