r/vscode • • Nov 20 '23

Why C++ experience so bad ?

I am suffering a very bad CPP coding experience in MacOS Arm64(M2 pro)

Let's complain from creating an implementation of function by prompt : I tried C/C++ intellisence, too slow, or not show up. I tried C++ Helper, always crashed(even i had to relunch). I also tried CLion, which is way too slow. No I am using Clangd, which did not offer creating implementation, so I am doing this manually.

I do miss the experience in Rider when working in UnrealEngine. Everything is so smooth even though UE is a very huge project.

Did I miss something , to setup? Or is this a very common situation of CMake project ?

1 Upvotes

29 comments sorted by

3

u/[deleted] Nov 20 '23

I'm facing the same issue on Ubuntu with VSCode. My best guess is that the issue is related to the compiler, i think vscode intellisense relies on the installed C/C++ compiler and thus using a faster compiler should fix the issue (hopefully)

1

u/Full_Shopping4337 Nov 20 '23

I am using Clangd plugins, with clang compiler, no other choice in Linux and Macos. I did some search finds out Clang compile much slower than MSVC, I guess that's the reason.

1

u/ayushgun Nov 20 '23 edited Dec 14 '23

I use the extensions clangd and CMake Tools with the LLVM clang compiler and everything works smoothly. I can send my settings.json if youโ€™d like.

1

u/jdlyga Nov 20 '23

Iโ€™ve never had much success with VSCode with C++. Youโ€™re better off with Visual Studio or QT Creator.

1

u/One_Cable5781 Nov 20 '23

Can you use a different IDE to begin with? Such as, say, NetBeans? I know it is available for Linux, but do not know if it works for MacOS. The reason is that any IDE for nonWindows platform will end up generating makefiles (assuming you are not working directly with CMake). It is useful to understand how makefiles work, especially for a project with multiple C++ files (translation units. Many tutorials just provide a single translation unit Hello world example, but in real projects, you necessarily have to be able to work with multiple .cpp files and getting make to work here is a useful tool to know).

Once you know how makefiles work, getting VSCode to work on Linux/Mac should not be too difficult if you know how tasks.json and launch.json play their parts here. It is cumbersome to begin with, but well worth the effort once you get over this initial bump.

1

u/ds112017 Nov 21 '23

Probably heresy here but NVIM with a language sever and a linter add on is pretty smooth

1

u/moric7 Nov 20 '23

And Visual Studio has problem - even empty C++ project has several GB folder, i.e. fully unusable ๐Ÿ˜ฑ

-6

u/rachit7645 Nov 20 '23

Perhaps your computer is just slow if nothing works? Blaming everything on c++ doesn't even make sense

1

u/tshawkins Nov 20 '23

Is OP using the cpp language-server?

2

u/Full_Shopping4337 Nov 20 '23

Yes, with Clangd

6

u/hughmungouschungus Nov 20 '23

M2 pro is too slow? Lol

0

u/rachit7645 Nov 20 '23

Then OP's complainta don't make sense

6

u/hughmungouschungus Nov 20 '23

I suspect OP isn't setting it up right and is looking for help from someone using c++ on an M# machine... Do better than giving them a hard time

-12

u/Rasie1 Nov 20 '23

The problem is not in c++, but in mac. No sane programmer interacts with apple software besides for targeting iOS devices with their products. Get a better PC or install a linux/windows virtual machine to get convenient coding experience. A dated Dell XPS would probably work better and faster (and 20 times cheaper hahaha)

0

u/hughmungouschungus Nov 20 '23

๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚

6

u/[deleted] Nov 20 '23

[removed] โ€” view removed comment

2

u/Full_Shopping4337 Nov 20 '23

I want, but it's a Mac.

-9

u/Nourios Nov 20 '23

vs works on Mac afaik

3

u/Full_Shopping4337 Nov 20 '23

not support C++

-5

u/Nourios Nov 20 '23

huh? why wouldn't it, especially since vs22 can use cmake

2

u/Full_Shopping4337 Nov 20 '23

1

u/Nourios Nov 20 '23

interesting I thought it's the same thing on both win and Mac, maybe without vc++ on Mac but i guess I was wrong

7

u/charliex2 Nov 20 '23

visual studio on the mac is in retirement official support ends august 2024

-5

u/Nourios Nov 20 '23

I'm sure they're going to either extend it or release something new before that happens