Looking for C++ IDE for Windows

Pages: 12
I don't know, the built in whatever has been great for me. When I copy and paste terribly formatted code, it formats it automatically almost instantly.

Maybe I don't know what I'm living without!
VS has the ability to reformat pasted code according to changeable rules a user sets, but there formatting options the editor doesn't have that I like. There are extensions that do the work for that.

Example. Here is how I like a WinAPI WNDCLASSEX struct initialization to look:
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  WNDCLASSEX wc;

   wc.cbSize        = sizeof(WNDCLASSEX);
   wc.style         = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc   = WndProc;
   wc.cbClsExtra    = 0;
   wc.cbWndExtra    = 0;
   wc.hInstance     = hInstance;
   wc.hIcon         = (HICON)   LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
   wc.hIconSm       = (HICON)   LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
   wc.hCursor       = (HCURSOR) LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED);
   wc.hbrBackground = (HBRUSH)  (COLOR_WINDOW + 1);
   wc.lpszMenuName  = NULL;
   wc.lpszClassName = szAppName;

Copy'n'paste in my current setup and I get this:
19
20
21
22
23
24
25
26
27
28
29
30
31
32
   WNDCLASSEX wc;

   wc.cbSize = sizeof(WNDCLASSEX);
   wc.style = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc = WndProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
   wc.hInstance = hInstance;
   wc.hIcon = (HICON)LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
   wc.hIconSm = (HICON)LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
   wc.hCursor = (HCURSOR)LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
   wc.lpszMenuName = NULL;
   wc.lpszClassName = szAppName;

A nice extension allows me to line up parts of code the way I want.
Hmm, that does seem like a neat feature. While the first one looks nicer, and somehow prefer the bottom one. Maybe I'll search for some neat extensions.
Try the Visual Studio Marketplace. I routinely look before I "buy."

https://marketplace.visualstudio.com/

I really like "Tweaks 2019" and "The Essentials 2019"

https://marketplace.visualstudio.com/items?itemName=MadsKristensen.Tweaks
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BasicEssentials

"The Essentials" includes "Tweaks."
Furry Guy, Does your edition of VS have clang format support?
Last edited on
VS 2019, yes it does have clang support, I have the clang compiler-clang/LLVM tools installed. Never used them, though.

I know about clang Tidy, etc. I like what I can do with my current setup so haven't had the desire to learn other ways to do things.
I was just going to say that if it uses clang format for the automatic formatting then you can use the Clang-Format Editor to generate a file to use.
https://www.clangpowertools.com/clang-format-editor.html
zapshe,

Here is one awesome thing you must absolutely try out:

First enable map mode scrollbar under:
Tools -> Options -> Text editor -> C\C++ -> Scroll bars -> behavior:
Tick "use map mode for vertical scroll bar"
Enable "Show preview tooltip"
Under source preview choose "Narrow"

This will give you map mode scroll bar, try playing with it and benefits are obvious,
what I like the most is scrolling becomes faster because you don't have to aim for scrollbar with you mouse to grab it, because scroll bar is bigger now!

Next step is to install extension called "Match margin"
https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MatchMargin

Install and restart VS, then open some of your projects and a source code file, inside source code select or click on any identifier or variable etc. your selection should highlight every instance of that identifier in that source file and this should be reflected in your map mode scrollbar thanks to this extension.

For example: in a source file where you use nullptr in 10 different places, selecting one will highlight them all, in both source and map scrollbar.

The benefit of this is that you don't have to scroll trough source code to find all instances of an identifier, because you can simply click on matches inside map mode scroll bar and instantly jump to that position, or just hover over matches too bring up preview tooltip!

Ain't that cool?

Now if you wish, go one step further with map mode scrollbar and install one more extension called "Visual Studio Spell Checker":
https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater

You'll need to adjust it to work as you wish, but main point here is that all mispelled words will be shown in your map mode scrollbar, which is awesome because again you don't have to search and scroll things, instead just click or mouse hover on matches in your scrollbar.
Last edited on
This will give you map mode scroll bar, try playing with it and benefits are obvious

Funny, this was on by default on VS code and the first thing I did was turn it off... It takes a lot of space and the text on it is super tiny. I just tried it on VS and its a little different, like you can hover to see the code, but just not my style - takes up too much space for my taste.


For example: in a source file where you use nullptr in 10 different places, selecting one will highlight them all

This one sounds kind of useful. However, I usually just double click the variable name or whatever, Ctrl+C, Ctrl+F, Ctrl+V, and then VS indicates every instance of it on the scroll wheel as well. It doesn't take me even a full second to do this.


I don't doubt that these extensions are probably very useful to people, but I suppose I'm just not the right person for them 0-0.


The spell checker might be the most useful one there, might put a typo in a string and not realize it. Though sometimes I really don't care about spelling and I'll put some random stuff in there, I'd have to see if its annoying.

I may have a minimalistic mindset when it comes to extensions.
I usually just double click the variable name or whatever, Ctrl+C, Ctrl+F, Ctrl+V, and then VS indicates every instance of it on the scroll wheel as well.

That's a lot compared to implicit draw on map scrollbar right away.

It takes a lot of space

Maybe not on 1920x1080 monitor.

but OK, you know the saying, 100 people 100 different preferences..
@Furry Guy,
the bloated exe files are not a bug in the ide, it's a problem with GCC.
I have no idea why the executables is GCC or clang are much larger than in MSVC
I don't know, but I'm surmising that if that is the case then MS do a better job of code optimisation and/or they have smaller standard library files. Don't forget that the size of an .exe also includes the code for all of the statically linked libs and all the included standard library files.
The Red Panda IDE uses GCC, so that's a bug in the IDE IMO*. At the least Code::Blocks allows their IDE to use different compiler tool chains if the user wants to make the change, including MSVC++.

Bloated files, no matter where the cause lies, is a problem.

I get it, you like the IDE. I've tried it and I prefer different IDEs.

*"That's (somewhat) a joke, son."
Last edited on
Hey
Just download it from here:
https://visualstudio.microsoft.com/downloads/
Topic archived. No new replies allowed.
Pages: 12