473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

whynot write code in stdafx.cpp?

Thanks in advance for answering this question.
Nov 17 '05 #1
3 3033
With what purpose?

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalid> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks in advance for answering this question.

Nov 17 '05 #2
Egbert Nierop (MVP for IIS) wrote:
Thanks in advance for answering this question.


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
Nov 17 '05 #3


"Carl Daniel [VC++ MVP]" wrote:
Egbert Nierop (MVP for IIS) wrote:
Thanks in advance for answering this question.


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

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Sune | last post by:
Hi! Pre-requisites: ------------------- 1) Consider I'm about to write a quite large program. Say 500 K lines. 2) Part of this code will consist of 50 structs with, say, no more than at most...
1
by: Jignesh Desai | last post by:
There are essentially two ways that you can write code for an ASP.NET application. Inline code Style --------------------------------------------------------------- <html> <script...
88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
7
by: vinthan | last post by:
hi, I am new to python. I have to write test cases in python. An application is open in the desk top ( application writen in .Net) I have to write code to get focuse the application and click on...
8
by: mohammaditraders | last post by:
#include <iostream.h> #include <stdlib.h> #include <conio.h> #include <string.h> class Matrix { private : int numRows, numCols ; int elements ;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.