When to stop?

This is a discussion on When to stop? within the General Discussions forums, part of the Community Boards category; So, while learning C++ from the stroustrup's book i often wandered this. At some point of the book, "inline" keyword ...

  1. #1
    Registered User
    Join Date
    Jul 2009
    Location
    Croatia
    Posts
    272

    When to stop?

    So, while learning C++ from the stroustrup's book i often wandered this.

    At some point of the book, "inline" keyword is introduced in the book, it is described a little with no examples.

    So, should i just read the text about inline from the book, understand the text and stop there?

    Or should i for example try and google "inline" keyword to see what more information can i find out about the topic? When exactly should i stop learning about the "inline" keyword in this case?

    Is it best to just remember the basic idea of inline, and when in the future you need something like that, you just dig out documentation and read it then? The point is to know that something exists, and the details aren't that important?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,936
    I don't think that there is any absolute correct answer to this question. It really depends on your learning style and what strikes you at the moment. Do what works best for you; mix and match if you will.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,668
    In simplest terms, inline functions are meant to replace #defines.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    I stopped using inline b/c there is no guarantee the compiler will or will not inline your code. The process to go through to figure out if the compiler will or will not inline your code is complex and varies from compiler to compiler. And on a modern processor the benefit between inline and non-inline may not be worth the hassle.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,510
    Quote Originally Posted by Bubba View Post
    I stopped using inline b/c there is no guarantee the compiler will or will not inline your code.
    Hehe, my workmate uses the inline keyword on member function definitions to separate private from public member functions. Without looking back at class body, he can tell which member functions are private or public (his private functions get the inline keyword). That's how much he regards the inline keyword.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fscanf %s or %d integer input space char stop question...
    By transgalactic2 in forum C Programming
    Replies: 5
    Last Post: 04-14-2009, 10:44 AM
  2. Error stop Http Listener
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 06-04-2008, 02:14 AM
  3. Message box as thread to stop main thread
    By Yasir_Malik in forum Windows Programming
    Replies: 8
    Last Post: 04-11-2006, 11:07 AM
  4. when a while loop will stop ?
    By blue_gene in forum C Programming
    Replies: 13
    Last Post: 04-20-2004, 03:45 PM
  5. Telling other applications to stop
    By nickname_changed in forum Windows Programming
    Replies: 11
    Last Post: 09-25-2003, 12:47 AM

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