Superficial Syntax thread: Your favorite keywords/class names etc.

This is a discussion on Superficial Syntax thread: Your favorite keywords/class names etc. within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally Posted by Mario F. It's been always my thought that Method and Property usage seem to focus more on ...

  1. #31
    HelpingYouHelpUsHelpUsAll
    Join Date
    Dec 2007
    Location
    In your nightmares
    Posts
    223
    Quote Originally Posted by Mario F. View Post
    It's been always my thought that Method and Property usage seem to focus more on the object instance since this is where those nouns make more sense, I think. Whereas member function and member variable make more sense when describing a class... particularly in C++ where the terms pointer to method or friend method don't make much sense at all.
    I heard in a python lecture that a method is a function that operates on an object and a function takes an object or a series of objects. E.g. (I will make up an example):
    Code:
    :WNDCLASS.hCursor.LoadCursor(NULL, IDC_ARROW); //method, if this existed
    DialogBox(hinst, MAKEINTRESOURCE(DLG_0100), NULL, (DLGPROC) DialogFunc); //Function
    string.split(' ') random python example of a method (not C)
    There are probably better examples of methods in C++, but I haven't learnt it yet. Helps distinguish the difference though. As for a property, this is an example:
    Code:
    WNDCLASS.lpszClassName
    long time no C; //seige
    You miss 100% of the people you don't C;
    Code:
    if (language != LANG_C && language != LANG_CPP)
        drown(language);

  2. #32
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    I'd say objects have methods (hence when dealing with OOP I call them methods) otherwise it's a function.

    But I don't like the terms, "accessor" & "mutator".

  3. #33
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,249
    I've always liked the term "brittle." In other words, code that may work, but doesn't easily support arbitrary changes either to itself or to the structure of code around it. It's ready to snap in half like a granola bar left to dry in the desert sun.

    As far as the function/method debate, I don't think it's really that important. The term "function" is already far removed from the mathematical definition of a function as a mapping from values to values. Many C and C++ "functions" serve no purpose except for their side-effects, a decidedly non-functional role.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. PlaySound
    By cangel in forum C++ Programming
    Replies: 16
    Last Post: 10-08-2009, 05:29 PM
  2. Simple thread object model (my first post)
    By Codeplug in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2004, 10:34 PM
  3. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  4. Closing thread handles from within
    By Sang-drax in forum Windows Programming
    Replies: 6
    Last Post: 09-26-2003, 12:18 PM
  5. How to make a thread sleep or std::recv timeout?
    By BrianK in forum Linux Programming
    Replies: 3
    Last Post: 02-26-2003, 09:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21