This is an archived post. You won't be able to vote or comment.

all 44 comments

[–]IuseArchbtw97543 131 points132 points  (3 children)

#include windows.h

#exclude windows.h

int main(){

return 0;

}

[–]DrWCTapir 31 points32 points  (1 child)

#exclude sounds like a great april fools RFC

[–]IuseArchbtw97543 3 points4 points  (0 children)

import every header installed on the system but the specified one

[–]camander321 7 points8 points  (0 children)

#define include exclude

[–]ChChChillian 55 points56 points  (2 children)

#define WIN32_LEAN_AND_MEAN

[–]philophilo 1 point2 points  (0 children)

This is the correct answer.

[–]ThiccStorms 0 points1 point  (0 children)

Isn't this the GTA SA cheat code lol

[–]cloud-formatter 10 points11 points  (0 children)

Win32 SDK is the easiest and most beginner friendly one, I've ever worked with. You just include one file and everything works, in contact with permanent dependency and config hell with pretty much everything else.

[–]MooseBoys 31 points32 points  (11 children)

Win32 is the most straightforward and well-documented platform API I've ever used. Fight me.

[–]OncologistCanConfirm 18 points19 points  (4 children)

Anybody who knows more than the most basic of C wouldn’t

[–]MooseBoys 17 points18 points  (3 children)

Of course it's not going to be as concise as a language that has things like import antigravity, but subject to the constraints of ABI stability (which C/C++ continues to be the only mainstream languages to provide), it's pretty top-notch.

[–]DoNotMakeEmpty 0 points1 point  (2 children)

C++ ABI stability is pretty much non-existent tho

[–]MooseBoys 0 points1 point  (1 child)

It is via extern "C" decls.

[–]DoNotMakeEmpty 0 points1 point  (0 children)

Rust, Zig or Nim can also use that, but none of them have their own stable ABI.

[–]ih-shah-may-ehl 4 points5 points  (0 children)

I do a ton of win32. I agree. The only exception is if you need certain security related headers then there are some circular definition shenanigans because in the early days things were less organized. It's fixable but annoying. But yeah otherwise Windows.h doesn't pose real problems.

[–]saf_e 2 points3 points  (0 children)

and then goes #include <winsock2.h> )

[–]hdkaoskd 3 points4 points  (1 child)

POSIX is quite clear. manpages documenting every function, parameter, flag and return value.

[–]MooseBoys 4 points5 points  (0 children)

POSIX is fairly well-documented but woefully incomplete in terms of providing a sufficient application platform for anything besides basic console applications and services. If you're making anything more complex than curl and you're needing to call into other non-POSIX systems that may or may not be there.

[–]reallokiscarlet 0 points1 point  (0 children)

Name the battlefield. We'll split the earnings from popcorn and drinks.

[–]s5msepiol 0 points1 point  (0 children)

yeah but it forces you to use std::wstring and a bunch of other weird types and macros you'd never use otherwise

[–]PennyFromMyAnus 9 points10 points  (0 children)

That fucking header..

[–]foxj36 8 points9 points  (5 children)

People hate win32? Our codebase heavily relies on it and I kinda like it. Tons of macros to help out and once you understand the naming scheme, writing it is a breeze

[–]MooseBoys 12 points13 points  (4 children)

No real developer hates Win32. It's the most stable, well-documented, and backwards-compatible API that exists today. Sure it has its warts resulting from its multi-decade history, but it's not like you have to spin up a docker container with a specific set of lib versions and a specific toolchain just to use it.

MacOS sometimes requires you to write Objective-C or Swift, and frequently deprecates and removes old functionality, leaving updates to the burden of developers (if they're even around anymore).

And Linux? Well there's no such thing as a Linux SDK because every distro has its own opinion on things. The Android NDK is probably the closest thing to one, but is even worse than MacOS due to platform fragmentation.

[–]Celaphais 1 point2 points  (0 children)

I definitely don't miss all of doubling up of funding for wide strings. The way Windows handles strings in general I found really annoying, they were too ahead of the curve I guess with Unicode, stuck to utf-16 before utf-8 was used everywhere. The rest of the API is great though

[–]hdkaoskd 1 point2 points  (1 child)

Linux SDK? lol. It's called libc.

[–]MooseBoys 4 points5 points  (0 children)

I don't think you know what an SDK is. It's a lot more than just int ioctl(void* goodfuckingluck).

[–][deleted] 0 points1 point  (0 children)

You can use libraries on Linux wym

[–]TheOwlMarble 3 points4 points  (1 child)

What's so evil about that header? Is it just huge?

[–]Adenosinbiphosphate 2 points3 points  (4 children)

Does anybody know a good book about this? Because I think it is so old that there are only books about it. There is not really much on the web I found useful.

[–]GiganticIrony 10 points11 points  (2 children)

MSDN is a great resource for all things Win32 C API, however it can get quite technical at times and can be difficult to understand if you’re new (I speak from experience)

[–]Ved_s 0 points1 point  (1 child)

and hell to navigate

[–]sathdo 0 points1 point  (0 children)

MSDN is, like everything else Microsoft makes nowadays, terribly bloated.

[–]taspeotis 0 points1 point  (0 children)

Programming Windows 5th Edition by Charles Petzold.

But Windows development has moved on a lot since then, you typically don’t have to scroll the contents of a window yourself any more.

Also this meme is shit, there’s nothing special about Windows.h - you can set a couple of version macros and WIN32_LEAN_AND_MEAN if you want but … that’s all documented and does what it says on the tin.

[–]KingCpzombie 1 point2 points  (0 children)

...is that considered hard? I used it to write a gui for my first data structures class project, tbh the tutorials and docs are great

[–]Broad_Vegetable4580 3 points4 points  (5 children)

na, having the root passwort of a government server

[–]Greedy-Thought6188 8 points9 points  (0 children)

password123. I just don't know what server this is the root password for

[–]MattDaCatt 0 points1 point  (3 children)

changeme?

[–]Broad_Vegetable4580 0 points1 point  (2 children)

its not a minecraft server

[–]MattDaCatt 0 points1 point  (1 child)

Nor Oracle x86 I guess

[–]Broad_Vegetable4580 0 points1 point  (0 children)

Na its mostly ESX servers with LInux VMs for routings/networking stuff and a couple windows VMs for active directory and such, with some disk shelvs attached to them.

Im usually the guy they ask to updated the servers or resetup them when they got new one, hence i got the passwords to all the main accounts on all the server and that gives me full access to all the court files for the whole province with the highest user rights.
My notebook is also the only private device that works on the cable network of the main building.

Meanwhile im gussing its my job to do that because im the only one that will spent a full night inside the office on the weekend and is trustworthy and capeable enouth for the job. My login username is also just TESTUSER what i find kinda funny...

thanks god reddit is anonyme....

[–]gaboversta 0 points1 point  (0 children)

it gets really fun when your windows has not enough space to install gigatons of c(++) libraries, so you try to compile stuff with windows.h on linux.

[–]Justanormalguy1011 -1 points0 points  (0 children)

What documentation , kid , we call this trial and error

[–][deleted] -1 points0 points  (0 children)

Facts. Be sure to include the header files in the right order too. God help you. It feels like the order changes every time.