Be the first to post for 'Intro to Visual Studio 2015 on PC'!

The explicit inclusion of namespace “std” in the reference std::cout works whether or not “using namespace std” has been declared earlier the program file.

The full-name approach has the advantage of providing an explicit dependency at the point of use. It also confines dependencies on other (library) material to those stated explicitly. It also avoids possible name conflicts with a name introduced in the program (or another used namespace) that is spelled the same. These are all anticipatory precautions and it is not expected that we would know about all of that as beginners.

The disadvantage is that it makes references into (undeclared) namespaces wordier and there is the risk of more typing mistakes that have to be fixed.

[begin soapbox]
I’m one of those fussy people who likes to keep dependencies explicit and visible in the code. I have the luxury, and the experience, of doing that. (I imagine there are tools that one could write or obtain to identify dependencies from inspection of the source code. That notion can become its own punishment.)

The trend is to have more and more automation behind the scenes (such as what that #include “stdafx.h” is all about). What we might keep our eye out for is the degree that has new developers miss being exposed to and in touch with what is actually going on. I worry that this impedes developing confidence around what is essential versus inessential over time. That also might lead one to become tied to a single toolcraft (e.g., using Visual Studio and not knowing how to function without it; being unequipped to enter a community that favors a different toolcraft).

To be clear, this is not an indictment of Visual Studio or the Microsoft approach to developer tools. I have seen these same difficulties on open-source projects where the heavy reliance on various (custom) tools makes the on-ramp for newcomers near-insurmountable.
[end soapbox]

1 Like

I recommend that those who are going to use Visual Studio 2015 Community also watch the Lecture 6 video on XCode. Although what is seen will be different, the navigation to what is essential about the exercise is similar.

There is a little more time describing the “Hello World” C++ code that might be helpful as well.

Only recently started to learn a little C++ before hand, this was never mentioned, and been using the namespace from there on.
Thanks for the explanation, although it might be a bit over my head. :slight_smile:

Thanks for that tip!

Hi , there I had the same problem too.
you only have to install that opcion that you click in the picture,then restart the computer and you will find the opcion you are looking for

Hello class. I need a little help here. I just finished compiling all my information in visual studio for the hello world session. I typed everything exactly like professor Ben but after I click the “start without debugging” button, the next screen pops up but it doesn’t say " Hello World ". It only says click to continue? Again everything in my code is the same as professor Ben’s. Any suggestions? Am I the only one with this problem?

1 Like

Hey class, I was running VS 2013 with no problems and updated to 2015 community. I used the custom install to add the Visual C++ package and followed the video to a T. I am getting an error when I try to create a Win32 Project, the error I recieved is "’C:\Program Files (x86) Microsoft Visual Studio 14.0\VC\VCWizards\default.vcxproj’ cannot be opened because its project type is not supported by this version of the application. To open it, please use a version that supports this project". I have tried shutting the program down and restarting my computer, I have also tried uninstalling and reinstalling but I keep getting the same error. Has anyone else run into this problem or can someone walk me through a fix for this? I use Windows 10 64bit if that has anything to do with it. Thanks.

I have figured it out, I had to uninstall every last bit of VS from my system

C++ has the concept of a “namespace”, which allows you to group code under a common name. The “std” namespace is the namespace used by the standard library. The advantage to using namespaces is that it helps prevent name collisions that can occur in the global scope (e.g. more than one “cout” being defined) as well as grouping together code that belongs together.

Well i got as far as running without debugging, and i got a console which told me that the .exe is not recognised as an internal or external command, operable program or batch file!

Any suggestions on what has gone awry there?

EDIT: Ignore me, there was a typo in my code! Fixed it now and it all works fine. Lesson of the day is to proofread your work before submitting :stuck_out_tongue:

Hi :slight_smile:


hi Sir,
May I use

using namespace std;
instead of std::

It’s considered bad practice to do so. If you search the Unreal section of the forums for “namespace” I’m sure you’ll find lots of discussion on the matter.

1 Like

Hi DanM! Thanks for advice. I appology that I could not get you. Do you mean that if i use “using namespace std;” before main instead of using std:: inside main is “Bad Practice” ?
I will search it too. Thanks

the statement using namespace std; is considered bad practice.

Followed instructions and it worked perfectly.

“Hello World!”. Everything worked for me. I’ve had some previous practice on Visual Studio. It’s been awhile. I’ve done forgotten just about everything.

Hi,

Is it ok to install the updated Visual Studio 2017 on Windows 10 rather than 2015? Just wanted to check before progressing.

Cheers

yes no problem with my Win 10

Thanks David

Privacy & Terms