How to handle the Specification and Implementation files to be used in C++?

  • C/C++
  • Thread starter yungman
  • Start date
  • Tags
    files
In summary: Rectangle r = Rectangle:: Rectangle(); cout << r.getW() << endl;cout << r.getL() << endl;cout << r.getA() << endl;
  • #1
yungman
5,718
241
I am learning how to create Classes. I already created the Specification file(Rectangle.h) and Implementation file(member function Rectangle.cpp) separately. In the book the CD that came with it supposed to have ways to do it, BUT of cause I bought used and don't have the CD!

I already know how to #include Rectangle.h into the Implementation file. It's simple, just #include ""C:\\Users\\alanr\\Desktop\\C++ exercise\\Gaddis\\inout files\\Rectangle.h" for my directory in the laptop.....BUT it's so clumsy!

In a complete program that use this Class, I have to pull in the Specification file( header file) and Implementation file to use in the program, There must be an easier and cleaner way to do it like we just #include<iostream>, none of the C:\\... stuffs. You guys have a standard way of doing this easier?

Do you create a folder to store all the header files and implementation file and use a special way to call them without having to writhe all the "C:\\..." stuffs?

EDIT: I forgot to say, I know you can physically copy the .h and .cpp file into the program using it. To me, that's even worst than writing "C:\\..." because you actually go and copy and paste every time you write a program that use the Class Object. There got the be a better way.

Thanks
 
Last edited:
Technology news on Phys.org
  • #2
There are a number of different ways to organise files, some of which depend on settings in Visual Studio. For now you should just include all the files for a project in a single folder and then you can just #include "Rectangle.h".
 
  • #3
pbuk said:
There are a number of different ways to organise files, some of which depend on settings in Visual Studio. For now you should just include all the files for a project in a single folder and then you can just #include "Rectangle.h".
Thanks

But I still have to have both files in the same place. So I have no choice but to copy those from the specification program and the implementation program into the new project that uses it. TWhat if I need to change the .h file, I have to do it over again?

Or just don't worry about it, just do it this way and wait for later when I learn other ways?

Thanks
 
  • #4
This has nothing to do with C++. You can have everything in one big .cpp file if you wish. Many find this to be a less than ideal organization, but it's perfectly legal.

It has more to do with Visual Studio.
 
  • #5
What operating system are you working on and what are you using to compile? Are you using MS Visual Studio? Whatever tools you are using, there are always ways to put the header files in one directory and keep the implementation code someplace else. That is the only way that a large group of programmers can formally agree on the interfaces before the implementation code is completed.
 
  • #6
This is question about VS, I am running on Windows 10. I have no issue understanding what this whole thing trying to do and the code. I just don't know how to put them together.

I am trying to integrate the Specification, implementation file to work together with the program that uses it. I have no idea how to integrate them together. The book just skip this all together and act as if it's supposed to just work! I typed in the Rectangle.h file and Rectangle.cpp file. There is no instruction in running the compiler on these two files. I have no idea what to do. I already put the rectangle.h into the calling project in the same folder as the source.cpp of the project. But there is no instruction what to do with the implementation file Rectangle.cpp. I copy the Rectangle.h, Rectangle.cpp and the source.cpp here. Can anyone help me? I don't have the CD from the book.

This is the Rectangle.h that define the Rectangle Class Object.
C++:
//Specification file for Rectangle
#ifndef Rectangle_H
#define Rectangle_H
//Rectangle class declaration
class Rectangle
{
private:
    double width;
    double length;
public:
    void setW(double);
    void setL(double);
    double getW() const;
    double getL() const;
    double getA() const;
};
#endif //#pragma once
This is the Rectangle.cpp That has all the member functions.
C++:
//Rectangle implementation file
#include "C:\\Users\\alanr\\Desktop\\C++ exercise\\Gaddis\\inout files\\Rectangle.h"
#include <iostream>
#include <cstdlib>
using namespace std;

void Rectangle::setW(double w)
{
    if (w >= 0)    width = w;
    else { cout << "Invalid width.\n\n"; exit(EXIT_FAILURE); }
}
void Rectangle::setL(double len)
{
    if (len >= 0) length = len;
    else { cout << "Invalid length.\n\n"; exit(EXIT_FAILURE);
    }
}
double Rectangle::getW() const
{    return width;}
double Rectangle::getL() const
{    return length;}
double Rectangle::getA() const
{    return width * length;}
This is the source.cpp of the program that call the Rectangle class.
C++:
// 13.4 using Rectangle Object .h and .cpp
#include <iostream>
#include "Rectangle.h" //Needed for Rectangle Class
using namespace std;int main()
{
    Rectangle box; //define an instance of Rectangle Class
    double rectW;//Local variable
    double rectL;

    cout << " this program will calculate the area of rectangle.\n\n";
    cout << " Enter width = "; cin >> rectW;
    cout << " Enter Length = "; cin >> rectL;
    cout << endl;
    //Store width and length into Box Object
    box.setW(rectW); box.setL(rectL);

    //Display the rectangle data.
    cout << " Width of rectangle is = " << box.getW() << endl;//function return width
    cout << " Length of rectangle is = " << box.getL() << endl;//function return length
    cout << " Area of rectangle is = " << box.getA() << "\n\n";//return area.
    return 0;
}

These are very simple codes, I already ran it with them all in the Same .cpp ( not separate into .h and all, everything contain in one program). Now is just how to separate them and run to get the same result.

Thanks
 
  • #8
Jarvis323 said:
I guess the place you add your include directories should be here: Tools / Options / Projects and Solutions / VC++ Directories / Include files
https://stackoverflow.com/questions/2676417/how-do-include-paths-work-in-visual-studio
https://docs.microsoft.com/en-us/cpp/build/reference/vcpp-directories-property-page?view=vs-2019
Thanks for the reply
I followed your direction, it's not the same. I read the first link, it was about VS in 2008 that has the same path as yours, mine is VS2019, this is where it's different:
Compile error Listing 7.2.jpg


There is no VC++Directories.

I am still searching on the web also. I don't know how relevant is this:
http://www.math.uaa.alaska.edu/~afkjm/csce211/handouts/SeparateCompilation.pdf

Thanks
 
  • #9
Jarvis323 said:
I guess the place you add your include directories should be here: Tools / Options / Projects and Solutions / VC++ Directories / Include files
No, that's where the VS include files go. You shouldn't clutter up the VS system files with programs you're working on..

Organizing a project with multiple source files and one or more header files is pretty straightforward.
SolnExplorer.png

When you start a new project, the Header Files folder will be empty, and the Source Files Folder will be empty. If you want to add a header file (.h), right-cick Header Files, and Add --> New item will cause a dialog box to open. In it, select Header file, and enter a name for it, then click Add.

To add a source code file, right-click Source Files, and Add --> New item will cause the same dialog box to open. Select Header file, enter a name for the file, then click Add. There's another option to add a Class, but I don't use that option.

Once you have added the source code file(s) and header file(s), you can type your programs in, or paste the text in.

You showed Rectangle.h, Rectangle.cpp, and source.cpp for the project you're working on. Rectangle.h has the class declaration in it, Rectangle.cpp has the definitions of the member functions, and source.cpp has main().
Rectangle.h would go in the Header Files folder as shown in the screen shot above, and Rectangle.cpp and source.cpp would both go in the Source File folder. As long as there is only one main() function, you can build the project just as you have been doing.

yungman said:
I don't think it's at all relevant to what you're trying to do.
 
  • Like
Likes yungman and FactChecker
  • #10
Mark44 said:
No, that's where the VS include files go. You shouldn't clutter up the VS system files with programs you're working on..

Organizing a project with multiple source files and one or more header files is pretty straightforward.
View attachment 270303
When you start a new project, the Header Files folder will be empty, and the Source Files Folder will be empty. If you want to add a header file (.h), right-cick Header Files, and Add --> New item will cause a dialog box to open. In it, select Header file, and enter a name for it, then click Add.

To add a source code file, right-click Source Files, and Add --> New item will cause the same dialog box to open. Select Header file, enter a name for the file, then click Add. There's another option to add a Class, but I don't use that option.

Once you have added the source code file(s) and header file(s), you can type your programs in, or paste the text in.

You showed Rectangle.h, Rectangle.cpp, and source.cpp for the project you're working on. Rectangle.h has the class declaration in it, Rectangle.cpp has the definitions of the member functions, and source.cpp has main().
Rectangle.h would go in the Header Files folder as shown in the screen shot above, and Rectangle.cpp and source.cpp would both go in the Source File folder. As long as there is only one main() function, you can build the project just as you have been doing.

I don't think it's at all relevant to what you're trying to do.
Thanks a million! If I can, thanks TEN Millions!

You make my day! It's just THAT easy! I was so worry! Now I can go watch some tv!

Thanks
 
  • #11
Mark44 said:
No, that's where the VS include files go. You shouldn't clutter up the VS system files with programs you're working on..
I don't use VS. But usually you have some header files that you use across different programs, or some third party libraries you are using. You have to tell the compiler where they are. In g++ you use -I. There must be some way to do this with VS?
 
  • #12
Jarvis323 said:
I don't use VS. But usually you have some header files that you use across different programs, or some third party libraries you are using. You have to tell the compiler where they are. In g++ you use -I. There must be some way to do this with VS?
I saw that g++ in this:
http://www.math.uaa.alaska.edu/~afkjm/csce211/handouts/SeparateCompilation.pdf
I got in the command file and ran it, it didn't work. It doesn't recognize g++.

You never use VS? I don't know any other ones, the debugger works really good. I had to re-install VS, it seems to work better now. One thing, the projects VS creates are huge...I mean huge! Don't know why it's so big, takes a long time to do backup.
 
Last edited:
  • #13
I am starting to study new material, in the book it said you can compile the implementation file first. The main program can take in the Rectangle.h and the object file of implementation file. How do you compile the implementation file Rectangle.cpp in post #6?

I tried, it flag error because it's missing int main(). All I have to do is add in

int main()
{
return 0;
}
into the Rectengle.cpp, it will compile, but that's not going to work. How do you compile just the Rectangle.cpp?Also, I am reading the inline member functions. If I can put some of the inline function into the Specification file(Rectangle.h), why can't I put all the member functions into the Specification file and save the trouble of having a separate Implementation file?

thanks
 
  • #14
yungman said:
I am starting to study new material, in the book it said you can compile the implementation file first.
...
How do you compile just the Rectangle.cpp?
I am not sure if you are reading this right, in any case as you are using Visual Studio Code then it has its own ways of working for things like this. I suggest you ignore any parts of the book that address the mechanics of compilation and build tools like 'make' and move on.

yungman said:
Also, I am reading the inline member functions. If I can put some of the inline function into the Specification file(Rectangle.h), why can't I put all the member functions into the Specification file and save the trouble of having a separate Implementation file?
You can, but as things get more complicated it becomes easier to manage if you split them so it is a good idea to learn how to do this now.

I have never seen the term 'Specification file', we usually call this a 'header file'.
 
  • Like
Likes yungman
  • #15
pbuk said:
I am not sure if you are reading this right, in any case as you are using Visual Studio Code then it has its own ways of working for things like this. I suggest you ignore any parts of the book that address the mechanics of compilation and build tools like 'make' and move on.You can, but as things get more complicated it becomes easier to manage if you split them so it is a good idea to learn how to do this now.

I have never seen the term 'Specification file', we usually call this a 'header file'.
Must be just my book that call Specification file.
Compile error Listing 7.2.jpg

It also use header file.
 
  • #16
yungman said:
I saw that g++ in this:
http://www.math.uaa.alaska.edu/~afkjm/csce211/handouts/SeparateCompilation.pdf
I got in the command file and ran it, it didn't work. It doesn't recognize g++.

You never use VS? I don't know any other ones, the debugger works really good. I had to re-install VS, it seems to work better now. One thing, the projects VS creates are huge...I mean huge! Don't know why it's so big, takes a long time to do backup.
VS is a nice IDE, but I mainly use a linux operating system and I don't usually use an IDE at all, except Qt creator when I am making a Qt based GUI application.
 
Last edited:
  • #17
Jarvis323 said:
I don't use VS. But usually you have some header files that you use across different programs, or some third party libraries you are using. You have to tell the compiler where they are. In g++ you use -I. There must be some way to do this with VS?
I've written several hundred C++ programs, most of them quite small. None of them share header files, as they are mostly intended for use in the classes I teach, so are examples that focus on a small number of C++ aspects.

If one does write programs in VS that need to share header files, the header files can be placed in a common directory. There is a project property in VS that one can set so that VS knows where to look for header files that aren't in the "usual" place. The same -I switch that you mentioned can also be used in VS if you want to compile the code from the command line.
However, as I said before, IMO it's not a good idea to clutter up the compiler's header file directory with additional header files.
 
  • #18
Mark44 said:
IMO it's not a good idea to clutter up the compiler's header file directory with additional header files.
I used to work on some large projects where I often needed to modify the VS files to change where the header files for different versions were stored. I agree that it is a very bad idea to put your application header files in the directories of the standard libraries.
 
  • #19
It works if you just specify like #include "C:\\...\\Rectangle.h" in both the Rectangle.cpp and source.cpp, I even deleted the Rectangle.cpp in the main program and ADD-->Existing and do "C:\\...\\Rectangle.cpp", then you can put both anywhere you like. It work like a champ. I just changed the source.cpp this way.
C++:
// 13.4 using Rectangle Object .h and .cpp
#include <iostream>
#include "C:\\Users\\alanr\\Desktop\\C++ exercise\\Gaddis\\inout files\\Rectangle.h" //Needed for Rectangle Class
using namespace std;int main()
{
    Rectangle box; //define an instance of Rectangle Class
    double rectW;//Local variable
    double rectL;

    cout << " this program will calculate the area of rectangle.\n\n";
    cout << " Enter width = "; cin >> rectW;
    cout << " Enter Length = "; cin >> rectL;
    cout << endl;
    //Store width and length into Box Object
    box.setW(rectW); box.setL(rectL);

    //Display the rectangle data.
    cout << " Width of rectangle is = " << box.getW() << endl;//function return width
    cout << " Length of rectangle is = " << box.getL() << endl;//function return length
    cout << " Area of rectangle is = " << box.getA() << "\n\n";//return area.
    return 0;
}
 
  • #20
That certainly works. Eventually, you will want to start putting less detailed and specific paths in your include statements. You don't want your code to depend on the exact location of everything. The compiler can search in a list of relative-path directories. That allows you to move your code without needing to change all your include statements.

I would recommend that you have a directory for headers at a high level in that exercise directory and put the relative path in the include like:
#include "..\\..\\includes\\Rectangle.h";
 
  • #21
This is not a good idea, why do you insist on doing things your own way? Doing it your way makes it impossible for anyone else to help you, do it the way everybody else does.

Just in case you are in any doubt: never put absolute paths in source code files.
 
  • #22
pbuk said:
This is not a good idea, why do you insist on doing things your own way? Doing it your way makes it impossible for anyone else to help you, do it the way everybody else does.

Just in case you are in any doubt: never put absolute paths in source code files.
I just keep experimenting until I learn a better way. One gain knowledge by keep experimenting.
 
  • #23
I am 40 pages into Chapter 13, sounds like all the Classes of ADT are very much like function that is EXTERNAL to the main program, that the program call them when there's a need.

The normal functions are still inside the program, just take it outside main() so it does not have to be repeated used over and over at different places, and also make it simpler for people to understand. The Classes take it to another level that you don't even put the code in the main program and just do it by linking. All is just to make the code more modular and break up the big program so different people can work on it at the same time. All they need is to specify the interface and what parameters are being passed.

Ha ha, I found myself talk a little Russian now, all the Object, instance, header, scope resolution operator, dot operator...I am so bad in remembering names, I used to be able to remember people's phone number and forgot their names! It was so hard for me at the beginning here, here you guys trying to explain things to me, I just could not come right out and say you are not helping because your explanations are usually worst than my questions! Reading online were even worst. It takes time to get into this, now that I am on chapter 13, all of a sudden, it's like the fog starts to lift a little. Knock on wood, 40 pages into Chapter 13, I really don't have serious question, only question so far is how to put all the files together and now I got it. Hopefully it remains the same for the rest of the chapter. I am studying Constructors, next is Destructors, then array of Classes. That's the end of the chapter.
 
  • #24
I run into VS problem. You can see below
Compile error Listing 7.2.jpg


On the left top, you see a red wiggle line under #include. It said cannot open RectConstr.h.
With exception of adding the constructor, both the RectConstr.h and RectConstr.cpp are the EXACT same as Rectangle.h and Rectangle.cpp used before.

In the RectConstr.h
C++:
//Specification file for Rectangle with Constructor
#ifndef Rectangle_H
#define Rectangle_H
//Rectangle class declaration
class Rectangle
{
private:
    double width;
    double length;
public:
    Rectangle();//Constructor
    void setW(double);
    void setL(double);
    double getW() const;
    double getL() const;
    double getA() const;
};
#endif //

and RectConstr.cpp
C++:
//Rectangle implementation file with Constructor
#include "C:\Users\alanr\Desktop\C++ exercise\Gaddis\inout files\Rectangle.h"
#include <iostream>
#include <cstdlib>
using namespace std;

Rectangle::Rectangle()
    {width = 0.0; length = 0.0;}
void Rectangle::setW(double w)
{
    if (w >= 0)    width = w;
    else { cout << "Invalid width.\n\n"; exit(EXIT_FAILURE); }
}
void Rectangle::setL(double len)
{
    if (len >= 0) length = len;
    else { cout << "Invalid length.\n\n"; exit(EXIT_FAILURE);}
}
double Rectangle::getW() const
    {return width;}
double Rectangle::getL() const
    {return length;}
double Rectangle::getA() const

You can see I only added line11 Rectangle() in the RectConstr.h and line 7 to 8 in RectConstr.cpp.
The files are all there, I can click the files on the left of the image above and actually show the codes of both the .h and .cpp codes. They are in the program.

Only major change is the name of the files, I use RectConstr instead of Rectangle to distinguish them that they have Constructor in them.

What is the problem here?

thanksEDIT: I have been reading more, the Gaddis book starts to refer to the stuffs in the CD that came with the book. Of cause I don't have the CD. I ended up have to buy another same book that comes with the CD, the same edition. It said it comes with the CD, I hope it's true. Luckily it's cheap, it's only $11 total. I just hate to buy another book with only 2 more chapters to go, but what else can I do?
 
Last edited:
  • #25
yungman said:
One gain knowledge by keep experimenting.

One also gains knowledge by listening to the answers to the questions one asks.
 
  • #26
Vanadium 50 said:
One also gains knowledge by listening to the answers to the questions one asks.
When you actually answer my questions, I'll listen.
 
Last edited:
  • #27
yungman said:
When you actually answer my questions, I'll listen.
I looked into it a little. There should be a place to add "additional include directories" in the project properties settings. You can probably find it by just looking around in the settings available for your VS project. When you find that, you add your directories to the list. Note this is normally used in VS for external files, that your project uses but you aren't working on within the project.
 
  • Like
Likes yungman
  • #28
yungman said:
When you actually answer my questions, I'll listen.

You know, I'd show a little more gratitude and a little less attitude towards the people who are graciously donating their time to help you.
 
  • Like
Likes phinds
  • #29
Vanadium 50 said:
You know, I'd show a little more gratitude and a little less attitude towards the people who are graciously donating their time to help you.
I actually show a lot of gratitude to anyone that actually help me Like Mark, Jarvis, factchecker, pbuk, Sysprog, Phinds and others. I can't thank them enough to help me through this hard time in learning. I always thank them in every post they answered me.
 
Last edited:
  • #30
Jarvis323 said:
I looked into it a little. There should be a place to add "additional include directories" in the project properties settings. You can probably find it by just looking around in the settings available for your VS project. When you find that, you add your directories to the list. Note this is normally used in VS for external files, that your project uses but you aren't working on within the project.
Thanks for giving me a push to look into this more. Using Project-->Add Class works.
It will open a window like this. I just typed in RectConstr in the Class name. It will fill the name for you in .h and .cpp as shown. You then click OK.
Compile error Listing 7.2.jpg
It will open a blank project with empty file RectConstr.h and RectConstr.cpp on the right side as shown below:
Compile error Listing 7.3.jpg


I click RestConstr.h and paste the code of my RestConstr.h in, then do the same for RestConstr.cpp. It work one time through.
Don't ask me why Even what Mark44 suggested in POST#9 only partially work. I had to modified like this to make it work.
Compile error Listing 7.4.jpg

Notice I have to put line 3 to point to the external file to make it work. I put in the EXACT same file shown by the arrow on the left that it's there. But if I just put "Rectangle.h", it will NOT work.

Like I said, I don't know enough to say why, it just is.

Thanks for giving me a push to look deeper into VS to find another way to link the files. Not only that, my issue of Post #24 is resolved using this new method.

Thanks
 
  • #31
yungman said:
Don't ask me why Even what Mark44 suggested in POST#9 only partially work. I had to modified like this to make it work.
You must have made a mistake. I would go back and try again, try to see what strange thing you did to mess it up.
 
  • #32
Jarvis323 said:
You must have made a mistake. I would go back and try again, try to see what strange thing you did to mess it up.
Thanks for the reply.

I tried it many times. BUT, I have to tell you VS behaves better after I re-installed it 3 weeks ago, but it's still not the most consistent program.

I made sure I copied the EXACT Rectangle.h or RectConstr.h that I put the "C:\\...", it just didn't work. It was consistent also with both Rectangle.h and RectConstr.h ( they are different, one without and one with constructor).

I could have swear it worked the first time after Mark suggested, but I cannot repeat it.

And I do Rebuild Project, Clear Project to make sure it is working. I even exit the program. Only thing I did not do is restarting the laptop.

My way is NOT the best way as I have to copy and paste, I don't like that at all. I like Mark's way if I can make it work. Until I learn a better way, I just get on with life. Hopefully Mark can comment on this. I REALLY NOT the expert in VS to put it politely!
 
  • #33
Also, I experience quite a few times when I was working on binary files. The book use different exercise problems, one to create the file, one to read the file, AND then one to modify the file. So you would expect to create the file with data in the first one, I can read the file with the second one. BUT I kept failing. I can read back the file, BUT I cannot modify the file.

I think I even posted a program that I had the first part that I put it in comment AFTER I use it to write the file. The file had to be written in the SAME program, or else it won't work. All I did was copy the whole code of the first program that write the file from the other problem, no changes at all. It just didn't work if I just copy and paste the binary file over.

In my book, VS have issues. I might be new in programming, I use a lot, I mean a lot of programs like circuit simulations, microwave simulation, OrCad, PADS and other pcb layout programs. I never encounter so much inconsistent issues like VS. Even free programs like LTSpice and some pcb program free. Don't tell me VS is more sophisticate, Those microwave simulation and pcb layout programs are big, can do 3D simulations, 18+ layer pcb and simulate the signals. Some cost over $10K.

Don't ask me why, I did not even ask the question here. I think I asked too many questions here already.
 
Last edited:
  • #34
yungman said:
Also, I experience quite a few times when I was working on binary files. The book use different exercise problems, one to create the file, one to read the file, AND then one to modify the file. So you would expect to create the file with data in the first one, I can read the file with the second one. BUT I kept failing. I can read back the file, BUT I cannot modify the file.

I think I even posted a program that I had the first part that I put it in comment AFTER I use it to write the file. The file had to be written in the SAME program, or else it won't work. All I did was copy the whole code of the first program that write the file from the other problem, no changes at all. It just didn't work if I just copy and paste the binary file over.

In my book, VS have issues. I might be new in programming, I use a lot, I mean a lot of programs like circuit simulations, microwave simulation, OrCad, PADS and other pcb layout programs. I never encounter so much inconsistent issues like VS. Even free programs like LTSpice and some pcb program free. Don't tell me VS is more sophisticate, Those microwave simulation and pcb layout programs are big, can do 3D simulations, 18+ layer pcb and simulate the signals. Some cost over $10K.

Don't ask me why, I did not even ask the question here. I think I asked too many questions here already.
I feel I have to give some honest feedback. I mean no offense.

1) VS with vc, or any c++ compiler, is WAY more sophisticated than (likely) any simulation code in existence. Compiler engineers make upward of 400k a year because of the advanced knowledge and skill it requires. Those qualifications are very rare and hard to acquire and maintain. As an example, gcc (which is a free open source compiler) is more than 14 million lines of non-trivial code and would probably cost at least 200 million to 500 million dollars worth of labor (probably a lot more) to develop. And that's just the compiler, which is only one tool integrated into an IDE. It also doesn't include the work done by the standards committee, research done at universities that has been incorporated, and so forth. And the estimated cost to write those 14+ million lines also represent only the current gcc code, without consideration to code that has been replaced or updated over the years.

2) The largest and most sophisticated C++ programs tend to free and/or open source. Many costly programs tend to be smaller, niche programs with small user bases.

3) Every inconsistency or issue you have run into so far has been your own inconsistency or issue, NOT a problem with the software you're using. We warned you that Visual Studio is sort of complicated and that C++ is an extremely complicated language. It takes patients and humility (and working through lots of mistakes) to get comfortable with it.
 
Last edited:
  • #35
Jarvis323 said:
I feel I have to give some honest feedback. I mean no offense.

1) VS with vc, or any c++ compiler, is WAY more sophisticated than (likely) any simulation code in existence. Compiler engineers make upward of 400k a year because of the advanced knowledge and skill it requires. Those qualifications are very rare and hard to acquire and maintain. As an example, gcc (which is a free open source compiler) is more than 14 million lines of non-trivial code and would probably cost at least 200 million to 500 million dollars worth of labor (probably a lot more) to develop. And that's just the compiler, which is only one tool integrated into an IDE. It also doesn't include the work done by the standards committee, research done at universities that has been incorporated, and so forth. And the estimated cost to write those 14+ million lines also represent only the current g++ code, without consideration to code that has been replaced or updated over the years.

2) The largest and most sophisticated C++ programs tend to free and/or open source. Many costly programs tend to be smaller, niche programs with small user bases.

3) Every inconsistency or issue you have run into so far has been your own inconsistency or issue, NOT a problem with the software you're using. We warned you that Visual Studio is sort of complicated and that C++ is an extremely complicated language. It takes patients and humility (and working through lots of mistakes) to get comfortable with it.
You are most likely right. I don't know enough to say. I can only tell you my experience...which is not much. I will keep an open mind and observe. Thanks for your comment.

I am taking it a little easy the last two days, I know not to push too hard. So far, I am still ok with the Class in Chapter 13. I'll see. I hope things can get easier as I learn more.

I want to emphasize, I really appreciate you and the few others that take the time to help me.

Thanks
 

Similar threads

  • Programming and Computer Science
Replies
2
Views
683
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
2
Views
382
  • Programming and Computer Science
Replies
33
Views
2K
  • Programming and Computer Science
Replies
6
Views
924
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
2
Views
639
  • Programming and Computer Science
Replies
29
Views
2K
Back
Top