whynot write code in stdafx.cpp?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Egbert Nierop \(MVP for IIS\)

    #1

    whynot write code in stdafx.cpp?

    Thanks in advance for answering this question.
  • Nishant Sivakumar

    #2
    Re: whynot write code in stdafx.cpp?

    With what purpose?

    --
    Regards,
    Nish [VC++ MVP]
    Nish’s thoughts on technology leadership, cloud architecture, and APIs, among other things




    "Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalid> wrote in
    message news:%23ACXjZCl FHA.3828@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > Thanks in advance for answering this question.[/color]


    Comment

    • Carl Daniel [VC++ MVP]

      #3
      Re: whynot write code in stdafx.cpp?

      Egbert Nierop (MVP for IIS) wrote:[color=blue]
      > Thanks in advance for answering this question.[/color]

      Convention, pure and simple. There's really no reason to have a
      stdafx.cpp - if there's a central source file that contains code that will
      rarely change, there's nothing wrong with using that as the PCH builder.

      The reason for the convention is just that - PCH building is expensive, and
      typically you should only put things in your "stdafx.h" that rarely or never
      change. Using a non-empty source file as the PCH builder means that you'll
      rebuild the PCH file unnecessarily every time the code in that file changes
      even if none of your #includes changed.

      -cd


      Comment

      • HOTDOG

        #4
        Re: whynot write code in stdafx.cpp?



        "Carl Daniel [VC++ MVP]" wrote:
        [color=blue]
        > Egbert Nierop (MVP for IIS) wrote:[color=green]
        > > Thanks in advance for answering this question.[/color]
        >
        > Convention, pure and simple. There's really no reason to have a
        > stdafx.cpp - if there's a central source file that contains code that will
        > rarely change, there's nothing wrong with using that as the PCH builder.
        >
        > The reason for the convention is just that - PCH building is expensive, and
        > typically you should only put things in your "stdafx.h" that rarely or never
        > change. Using a non-empty source file as the PCH builder means that you'll
        > rebuild the PCH file unnecessarily every time the code in that file changes
        > even if none of your #includes changed.
        >
        > -cd
        >
        >
        >[/color]

        Comment

        Working...