News for hackers. Stuff that matters.
Re:I built a native Windows Todo app in pure C (278 KB, no f... by toxi360 on Sunday May 11, 2025 @03:23PM (#43956320)
Hello friends, I made this app just to try it out and have some fun, haha, but the comments are right, something like this could have been done more sensibly with C++ or other languages, ahaha.
Re:I built a native Windows Todo app in pure C (278 KB, no f... by tomtomtom777 on Sunday May 11, 2025 @03:59PM (#43956656)
This is exactly how I've learned to create my first Windows programs about 30 years ago, except that I'd use a C++ compiler.

I am not sure why but I believe writing C style code with a C++ compiler was how the windows API was documented to be used. I think Microsoft just went with the idea that C++ was an improved superset of C so should be used even for C-style code.

Re:I built a native Windows Todo app in pure C (278 KB, no f... by cesarb on Sunday May 11, 2025 @08:35PM (#43958532)
> I think Microsoft just went with the idea that C++ was an improved superset of C so should be used even for C-style code.

And as a consequence, for a long time their official C compiler was stuck on C89, while other platforms already had full C99 support and beyond. I believe their support for newer C standards has gotten better since then, but AFAIK they still don't have full C99 support.

Re:I built a native Windows Todo app in pure C (278 KB, no f... by drooopy on Sunday May 11, 2025 @03:31PM (#43956398)
Unironically, I would rather use your to-do app over the default Windows 11 one.
Re:I built a native Windows Todo app in pure C (278 KB, no f... by toxi360 on Sunday May 11, 2025 @03:42PM (#43956488)
AHhhahah thanks
Re:I built a native Windows Todo app in pure C (278 KB, no f... by toxi360 on Sunday May 11, 2025 @03:25PM (#43956339)
https://github.com/Efeckc17/YoutubeGO By the way, you can also review or examine this application, I would be very happy :D
Re:I built a native Windows Todo app in pure C (278 KB, no f... by kmangutov on Sunday May 11, 2025 @05:54PM (#43957476)
This is exactly the sort of project (clean, native UI) that motivated me to learn programming, kudos!
Re:I built a native Windows Todo app in pure C (278 KB, no f... by Johanx64 on Sunday May 11, 2025 @06:05PM (#43957557)
It's just the way it should be.

Other language doesn't fundamentally change anything if you want to use win32 API, if anything it would make things more confusing.

People often fall prey to C++isms, and they would have made the whole thing an even more confusing mess (to people not familiar with win32 API).

This is a very cute thing to do and some familiarity with win32 APIs is a nice basic competency thing, regardless of what other people think.

Re:I built a native Windows Todo app in pure C (278 KB, no f... by int_19h on Monday May 12, 2025 @01:18PM (#43965353)
C++ actually makes a lot of sense specifically for Win32 API because RAII takes care of releasing all the numerous handles at the right time in the right manner. Also, things like string operations are a pain in pure C (indeed, this app uses stuff like strcpy which is a recipe for buffer overruns etc).

WTL (https://en.wikipedia.org/wiki/Windows_Template_Library) is the oldschool way to do low-level Win32 coding in C++.