Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: A question of aesthetics

  1. #1
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default A question of aesthetics

    In general conversation, like on these forums, when you write the name of a method that requires arguments without specifying the arguments, do you put parentheses after it? Because to me that looks like you're talking about a no-argument version of the method. On the other hand, leaving off the parenthesis obscures the fact that it's a method.

    I write it both ways, inconsistently.
    Get in the habit of using standard Java naming conventions!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,327
    Rep Power
    25

    Default

    I try to use () for generic kinds of words like method or update or print if they are methods and there might be confusion.
    No consideration on what args they can take.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default

    I use an ellipsis e.g. paintComponent(...)

    db
    kjkrum likes this.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by DarrylBurke View Post
    I use an ellipsis e.g. paintComponent(...)

    db
    Ditto here except when the method doesn't take parameters (in a feeble attempt to avoid confusion).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    I might refer to something as SomeThing, SomeThing(), something or something() - but I doubt if the intended distinction betwen the 5 forms is always recognised. If the arguments matter I say that explicity: "the SomeThing() constructor which takes a pair of String arguments" etc.

Similar Threads

  1. Question concerning question marks and colons
    By jim01 in forum New To Java
    Replies: 17
    Last Post: 01-14-2011, 12:05 AM
  2. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 08:49 AM
  3. Question about ++x and x++
    By makeawish in forum New To Java
    Replies: 2
    Last Post: 10-18-2010, 10:50 AM
  4. Question
    By vittoire in forum New To Java
    Replies: 3
    Last Post: 02-02-2010, 12:54 PM
  5. Need help on this question
    By Deon in forum New To Java
    Replies: 3
    Last Post: 01-27-2008, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •