Re: form's implementation should be in .cpp not .hpp file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi

Below is a fragment of my conversation with MS regarding this subject.
You can find it here
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=379708

Me

Why VS2008 doesn't create .cpp files when creating new form using
wizard? It only creates .hpp file. What's even worse implementation of
all methods goes in this header file! That just plain wrong. C++
Builder's gui designer creates one header and one source file for each
form in the application and then puts all implementation in the source
file not in the header file.

MS

As you may have seen in DevDiv VP - S. Somasegar's blog on the topic
(http://blogs.msdn.com/somasegar/archive/2006/05/18/601354.aspx) in
the next release of the .NET Framework (codenamed Rosario), we plan to
deliver service pack like compatibility for WindowsForms. We are
trying very hard to minimize the overall number of changes being done
in .Net 2.0/3.0/4.0 bits to help reduce churn and achieve very high
levels of compatibility.

As such we are not able to address this issue with a fix in the .NET
Framework in the Orcas timeframe. Many customers have found it useful
to discuss issues like this in the forums (http://forums.microsoft.com/
msdn/default.aspx?siteid=1) where Microsoft and other members of the
community can suggest workarounds.

Before we even begin work on the next release of the NET Framework
release where we can make changes like this one we will devote time to
addressing the top issues, suggestion (in terms of number of votes,
lack of workarounds, etc). So please do continue to vote for this item
if it is causing issues.

Me

The problem I raised has nothing to do with .NET versions and
compatibility. You didn't target my problem in your "answer" at all.
I'll try to explain once more what the problem is. C++ is not funny C#
nor stupid VB. This language has notion of header files which other
two don't have. In case all members of VS Team forgot what headers in C
++ are they can refresh their knowledge by reading this
http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/d0e41705815b661b/dfeb1e3a8dbb299e?hl=en&lnk=gst&q=no+header+files#dfeb1e3a8dbb299e

So please don't escape from answering my question by writing about
some .NET compatibility. Since the beginning of .NET support in VC
(2002) you had 6 years to learn C++ is neither C# nor VB. Still you
pretend there is no difference and gui designer puts all generated
code into header files. I'd like to hear true answer from someone
directly involved in creating VC not such PR nonsense I got.

I'm sorry if I'm too harsh but you can blame yourself. You had 6
years... Stop jumping saying "developers, developers, developers" and
start to listen, please.

MS

For the suggestion that you proposed, the backward compatibility
problem concerns us the most is about supporting tons of legacy
projects created in VS 2005/2008. As you may know, when open a legacy
project in new Visual Studio, it invovles a convertion and migration.
If the HPP/CPP implementation is changed in new VS, it results in a
huge efforts of parsing HPP files (could be thousands), abstract
custom code (sometimes hard to do so), generating new CPP files with
previously abstracted code, etc. It becomes even worse if the user has
source code management system (like TFS). The newly-modified HPP files
and newly-created CPP files will be his/her nightmare in terms of
source code management. Many companies have security/safety policy to
block developers from checking in non-approved source files. Image how
many extra efforts our hundreds of thousands of developers may need to
spend for just making the new files work while they are working today.

Taking all these into account, we decide not to redo what it is today.
While you could always separate your own CPP files to meet the CPP
community standard.

Having said so, it doesn't invalidate your suggestion at all. We
should have done that at the very beginning but it is just not time to
redo it simply because there are tons of legacy projects out there.

Me

Could you explain to me why would you have to change _anything_ in
existing code after introducing this new functionality? Only new code
would be created in a new way. Right now you don't do anything special
about headers, do you? Old code could be left in headers where it's
now and it would work in the same way it works now.
The problem I raised has nothing to do with compatibility.
.



Relevant Pages

  • Preprocessor, nested files etc.
    ... I expected one big file but instead got one preprocessor file for each ... of the cpp files in the project. ... when I #define macros and put them at the beginning of the header file ... then those macro definitions don't seem to stick. ...
    (comp.lang.cpp)
  • Re: header files
    ... >hi jeffc, sorry I wasn't being very clear. ... >It was never my intention to create one big file - lots separate files, ... >then this would ensure that the header file is added only the first time it ... If you cannot see the point of .cpp files I suspect you do not ...
    (alt.comp.lang.learn.c-cpp)
  • Re: header files
    ... It was never my intention to create one big file - lots separate files, ... This would lead to the problem of including the same header file in more ... then this would ensure that the header file is added only the first time it ... and I couldn't really see the point of .cpp files at ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [PATCH] Move various PCI IDs to header file
    ... controller PCI IDs to the main header file. ... * compatibility is untested as of yet ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)
  • Re: code in header file?
    ... Marko Zagar wrote: ... >> is it ok to add code in the header file? ... > Aside from longer compile and link times (if you include that header in ... > other cpp files, the same code will be compiled again), I see no problem. ...
    (alt.comp.lang.learn.c-cpp)