3 ms·
Follow up question should probably be what is a good IDE setup for plain C. CGO support in VSCode for instance never really worked for me. How well does C/C++ p
by xaduha 4y ago
Follow up question should probably be what is a good IDE setup for plain C. CGO support in VSCode for instance never really worked for me. How well does C/C++ plugin by Microsoft work on linux?
- flohofwoe 4y agoI'd recommend starting in VSCode with the MS C/C++ plugin (this works across Windows, Linux and macOS) and do the very first steps without a build system (the VSCode C/C++ plugin has some support for building single-file projects). Or just build in the terminal with: cc hello.c -o hello After those first steps I would recommend installing the MS CMake Tools extensions (https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/README.md https://github.com/microsoft/vscode-cmake-tools/blob/main/do...), this automatically discovers CMakeLists.txt files in the project and then uses those to setup build- and debugging targets and configure the C/C++ language server / Intellisense. I prefer this setup because it is more 'transparent' than a 'fat IDE' like Visual Studio, Xcode or CLion, but YMMV of course :)
- CodeSgt 4y agoI plan to use CLion
- bitwize 4y agoYour first C program should be written in an editor like vi, and compiled with cc at the command line. Use tools like IDEs when you're ready for more sophisticated programs and really need their help to manage the complexity. If your only exposure to C is through an IDE, the IDE can hide important things you really should know (that's kind of its job). I knew a girl in college who was really smart and on a CS major track. At the time everybody used Borland C++, and some people's first exposure to C++ -- or programming in general -- was through this IDE. She asked me if her C++ classroom exercises would compile on a laptop. I said it should be fine. Then she said, "But isn't there like a chip or something in my desktop that compiles the programs?" I was a bit flabbergasted that anyone would think that, but simply replied that the compiler was just another piece of software that will run on any PC. People come in to programming and they don't understand what's going on. A lot of details are hidden with development today. And it's great that we have the IDEs and so forth to help us not be bogged down in these details -- but a greater perspective is useful to any programmer, and that's why I and Charles Petzold and some other programmers recommend that your first, simple programs be done "the old fashioned way". (Come to think of it though, maybe if there were a compilation chip -- an FPGA or something -- the compilation times of C++ and Rust could be mitigated...)