Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nothing in VS Code is terribly web specific. I've been using it for C++ for which it works swimmingly.


The personal preferences file includes several defaults for S/CSS, HTML, JS and TS, and it has a lot of Typescript stuff out of the box, some node stuff.


Right, but VS Code's depth into other languages and stacks is quite extensive, as well. If I were promoting a new text editor (hell, or any piece of software), I would certainly set the most-visible defaults to hit the most common use case, which at the moment is web front-end oriented tasks. To get a fairly full featured C++ experience, VS Code is up and running in three mouse clicks and two text fields from the splash screen -- this includes automated downloads and installs of major pieces of Clang tooling. I also write a fair amount of more data-centric Python, and the experience is similarly painless (I haven't tried Rust or Go, but if f*ing C++ is this easy I can't imagine other stacks are worse), so I don't think I'd call it web centric at all!


I wonder what set up you have for c++ in VCode (plugins etc) I'm learning c++ at university and currently I use CodeBlocs since it have quite nice code completion.


I would like to try it for native development. How do you run and debug your C++ programs from VSCode?


https://code.visualstudio.com/docs/languages/cpp

> VS Code supports tasks that you can configure to build your application, and natively understands the output of MSBuild, CSC, and XBuild.


Yes, building works well. But how do you run your application?

(To be clear I'm asking what workflow users use personally, since it seems like nobody else has this issue.)


For me, I build on the command line, because I have a funky build process, and then when I want to debug it I just press the 'debug' button.

There's a big JSON file with the debug configurations, and a drop-down to allow you to select which one is active. Each gdb debug configuration lets you specify the usual binary path and command line arguments, plus a whole lot of other configuration I haven't looked at. I haven't had to do any project-style setup --- it just magically finds all my source files.

It looks like it supports gdb on Windows and Linux and lldb on OSX (only ever tested on Linux, though). Out-of-the-box you get sample configurations to both run and attach to a C/C++ binary.

gdb integration is pretty seamless; breakpoints, conditional breakpoints, stack traces, local and global variables. Haven't seen threads, watchpoints, or an assembly window yet. There's a debug console, but entering commands doesn't appear to send them to gdb.

It's one of the best Linux gdb environments I've seen (even though most gdb integrations are terrible).


Threads are part of stack trace - if you look closely, it has nodes for threads, if you have more than one thread running.

If you attach or launch more than one process, that's where they will appear also, as top-level tree nodes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: