Thread: When to stop?

  1. #1
    Registered User
    Join Date
    Jul 2009

    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
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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
    In simplest terms, inline functions are meant to replace #defines.
    I just want to use my computer in a productive manner, not learn how to use it. Elysia
    A year spent in artificial intelligence is enough to make one believe in God. Alan Jay Perlis

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    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
    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.
    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