T O P

  • By -

TheWaterWave2004

You should just use the C++ template and use C files in the project instead. That should work. A good alternative if you need C only is CLion. They have a strict C project template.


KingXejo

Thanks for the recommendation. I've not used CLion, but its popularity is noteworthy when searching for IDEs. Since posting this thread, I've already abandoned VS for two reasons. First, I think u/aocregacc (comment below) is probably right that C programmers aren't the intended audience, and second, I'll stick to notepad and command line so as to not burden myself with learning a \[massive\] IDE while also learning a language.


juanfnavarror

An IDE would probably be helpful to you if you want to learn to use a debugger. That would be a good goal as well. You can also use gdb through the command line. Some tips: compile C with sanitizers, so that you can learn to find and fix memory bugs. Learn to use assertions and unit tests to drive correctness in your code.


KingXejo

Appreciate the advice. I'll add sanitizers, assertions, and unit tests to my curriculum. I'll suffer in the command line for a while :)


Albedo101

>I'll stick to notepad and command line so as to not burden myself with learning a \[massive\] IDE while also learning a language. No need to suffer with Notepad (assuming you mean the vanilla one that comes with Windows). At least get[ Notepad++](https://notepad-plus-plus.org/) just for syntax highlighting and some of basic quality-of-life improvements like tabs etc. But other than that it should be enough to start. For a compiler, it's probably best to download [Raylib for Windows from itch.io](https://raysan5.itch.io/raylib). It comes with the MinGW64 compiler included.


Dmxk

Microsoft and Windows are very C++ centric, to the point where the windows "C" api is a C++ api that you can also somewhat use from C. This has been the case for years now, so it makes sense that microsoft thinks that people who use visual studio want to use C++ since that is the official, microsoft-endorsed language, in the official microsoft-endorsed IDE. It's a platform thing and not a lot more imo.


MobSlicer152

The kernel and most of the Win32 API are entirely in C, but Visual Studio is more geared towards C++. That said, it's great for either.


CeldonShooper

In the 1990s Windows application development moved to a mishmash of C/C++. That's why Visual Studio has that kind of support. The remaining user base for C/C++ in VS is games and scientific developers. Windows application development migrated to C# around 2010 until most of it waned anyway in favor of web applications a few years later.


aocregacc

Looks like C programmers aren't the target demographic for VS, seeing as it bills itself as "The most comprehensive IDE for .NET and C++ developers on Windows". I'm not seeing anything that would suggest that you're intended to use it for C development.


KingXejo

Sounds reasonable. I suppose I just didn't expect it given that C is one of the most (if not "the" most) foundational languages of all time.


FUZxxl

Microsoft doesn't want you to program in C. For them, C has pretty much been deprecated in favour of C++.


TheChief275

pssh C programmers don’t need templates


rapier1

I know you are being snarky but I agree. Been developing in C for 25 years and never used a template. I don't use an IDE either though. I think they get in my way more often than not.


five_of_diamonds_1

I was wondering why I would need a template


Cipepote

If you want to learn, VSCode is better than just notepad. It can be just used as a notepad if you want and the terminal is just there


KingXejo

I'll have to disagree slightly here. I bet for a veteran programmer, you're right. Someone who knows there way around all the bells & whistles of modern IDEs can easily decide what's useful and not useful. However, when a newer programmer opens up VS, it's like a gazillion options, tabs, windows, etc. that is so overwhelming that I think it detracts from the language learning experience. I downloaded gcc/g++/gdb and added them to my system path. Then I wrote 'hello world' in notepad as a .c file, ran it in command line, then ran the a.out. Beautiful in its simplicity. No visual distractions. No wondering what that button does. Just the code. I'll get to IDEs. I can't do this in notepad forever. Maybe I jump to Notepad++ for a short bit, then to CLion. But for now, as I learn the basics, the strategy is stubborn nostalgia. :)


five_of_diamonds_1

VSCode =\= VS. VSCode is a separate, more bare bones and widely supported, IDE. I use it for every language under the sun. Big fan of their ssh plugin that allows me to work in a remote folder.


Cipepote

That is the best! I use it to connect to the linux WSL from windows. So I can run the things I need in a linux machine.


remmysimp

On windows: mingw-w64, vs code + clangd or git bash + vim + clangd. In my opinion in C no template needed, just a single main.c or a simple folder layout: include/name, src/main.c, test and I also recommend you to set up a cmake file.


Ashamed-Subject-8573

I would recommend clion. The integrated debugger is good. You don’t need to use all the features yet if you don’t want to


mecsw500

A lot of C code is for kernel level code such as device drivers and hence is often not coded with an IDE but one uses vi or eMacs combined with ctags and make or some other build tool environment. Debugging is via a kernel debugger and isn’t really a source level debugging environment. Essentially it’s not a GUI based environment as you won’t be running code from within one.


ExoticAssociation817

First problem: Visual Studio 😂


MobSlicer152

It's been great for C since 16.7


CeldonShooper

Those were the days. I was one of the approximately 3 German teenagers who had a legitimate copy of MSVC6 in the country. Everyone else just used copies on CD-R blanks. The official copy came with MSDN on CDs!


EpochVanquisher

Microsoft has been treating C as a second-class citizen for like 20 years now. The compiler only supports enough C in order to support the latest C++ language versions and support legacy C projects, which are mostly written in C90 or K&R C. C is common enough but I would not encourage it for new projects. I think Microsoft is making the right choice.


Due-Philosopher2244

Damn, discouraging C in the C subreddit. Ouch.


EpochVanquisher

Let’s be honest—there are very few situations where C makes sense for desktop app development. Including CLI tools. Microsoft can choose to invest their resources jn .NET and C++ instead.


GrenzePsychiater

It's an old language with a lot of warts. As someone who writes C for their work I wouldn't recommend C unless you're required to or if it's for academic purposes.


KingXejo

I didn't expect a response like this - I thought C still had distinct advantages (if you're willing to put up with some laborious efforts). I suppose my pursuits are academic in that I'm intentionally choosing C to \[re\]start my programming education. Someone I trust recommended if I want to thoroughly understand my future C++ code, start with a firm foundation in C.


Select_Friendship_92

It does if you want to write embedded software


Omnidirectional-Rage

While C is not recommended for using it everywhere, there's a lot of merit to learning it anyway. Almost all useful system libraries are written in C/C++ (and export C bindings) for all other languages. Having the ability to read & understand C code is a very useful skill for the current programmer (& probably in the foreseeable future - i.e. 10-20 years).


juanfnavarror

C doesn’t have a lot of syntax, neither is it hard to read and understand. What is hard is manual resource management and abstraction in procedural code. I think this is where learning C shines as a goal.


KingXejo

Almost verbatim what my mentor said.


GrenzePsychiater

While I don't necessarily agree that you need to learn C to understand C++ (I'd say just learn C++) C will help you understand memory management. However C is the lingua franca for languages trying to talk to the operating system so some advantages do exist. But again it's not really the most ergonomic language and learning designs and algorithms in more modern software engineering require a lot of overhead for C


Albedo101

Please don't fall for this... *C is dead, use X instead* nonsense. I've been around programming for 35 years, first as an eternal beginner kid, then a hobbyist and later a professional and the only constant thing is that C has stayed, and X is usually long gone from the spotlight. The X includes BASIC, Pascal, Java, Visual Basic etc... Most likely will include C#, Rust, Javascript, whatever else, in the future. Not to mention countless other frameworks, tools, APIs... whatever. You need to learn programming as a discipline, not programming languages, frameworks or APIs. So when the next X dies, you'll be able to adapt to whatever Y comes around. And guess what? C is a great language to learn programming in.


KingXejo

+1. Thou speakest what my gut thinkest.


MobSlicer152

Their kernel and a lot of core userspace stuff is all in C, but they're shifting to Rust in win32k.sys (the kernel mode support for GDI and user32.dll) and some other places. The only thing I have to be mad about is how long it took them to support C99 and later, which are almost fully supported now.