VS 2017 fixes PlayGame() sideeffect

The side effect that Ben talks about in video 22 “Clarity is Worth fighting For” when making the “PlayGame()” using Visual Studio’s built-in tool is fixed from VS2015 to VS2017. When I went to create the function using the tool in 2017, it automatically put the prototype at the top instead of in a header file.

Has anyone else tried it yet in 2017 and have it do the same?

1 Like

Yes, thankfully this doesn’t happen anymore in VS 2017.

I think? I’m not too sure what a “prototype” is, but it seems to have copied all of my code and put it inside another window that is within the original code itself…if that makes sense. But yes, what he describes in the video after highlighting play game and extracting the function, does not happen.

The window is just a preview of the file that contains the code, so you can focus only on this part of the code while you also edit another file. So the window you see, is a window to another file (acutally to a part of it).

In this case, we have the GetMaxTries() const method, which is DECLARED in the header file, but DEFINED in the cpp file. So when you create the definition of a method, VS will automatically open the window you see below that shows you the definition of the method in the cpp file.

Yes this happens to me as well.

Hello all! Yes, in VS2017 the side effect of not including the prototype in the main.cpp file and creating the header file is no longer there.

Privacy & Terms