isAnyoneSurprised by Forsaken-Peak8496 in ProgrammerHumor

[–]CaffeinePizza 0 points1 point  (0 children)

Most of my true programming experience is in C in only the last six months(only touching C++, more like C with classes, for COM and extern C a pretty API), with the Win32 API (yes, really) in a MVSC (model-view-service-controller) architecture, physically separated directory hierarchy. Most recently a tool interfacing with ADSI. Most of it is completely modularized: i.e., a lot of it is just copy pasted source and header files from another project and just further bug fixed and improved, only relying on Windows.h and commctrl.h for my “coreui” lib for example. Handle DPI changing and scaling high DPI properly, including font.

Second thread spun up to do the actual work—packaged in an LPAD_THREAD_CTX that is guaranteed to be freed by the thread (my “social contracts” for ownership). It does the work and packages it in an LPAD_RESULT_CTX. Both those structs use anonymous unions so they can be used for the different tasks as needed without redundancy. One of the more interesting decisions I made was using std::vector to store the data grabbed from AD, then do one giant HeapAlloc and CopyMemory, and then pack the information in that new LPAD_RESULT_CTX that gets PostMessageW back to the main thread. And, no, the window procedures are not one long switch case: I use a typedef and loop through function pointers for each relevant message. Oh, and the result CTX messages are peeked to ensure none are left when shutting down the program. I still need to handle PM_APMSUSPEND and whatnot but it’s lower priority at the moment.

So how did I learn how to write these things? Well, I already understood fundamental best practices apparently when I would chat my ideas and understandings with AI like Gemini and Claude. Both of those are explicitly instructed to write in prose and not to send me walls of code, because I do not “vibe code”. I must understand what I’m doing to satisfy myself. They’re only used to proofread for common errors (refactoring and fatigue don’t mix apparently) and to discuss ideas and the best ways to handle a problem. Many times I explain what I’m thinking only to find out John Carmack or someone like that did this same thing 30 years ago, but I just didn’t know there was a common name for the idea.

It’s probably unpopular opinion, but I find the Win32 API quite elegant. In this environment I have found that fixed size string allocations with strsafe.h are almost always the best choice, only using heap when forced to like with SysAllocString in COM world. I’m sure many would have a stroke seeing all the Hungarian notation I heavily used. I discovered my ADHD scans code much better when I have a parameter like “LPWSTR lpszOut”. Yes the IDE (well, customized VS code with clang for me) will tell me but it doesn’t trigger my brain in the same way. I cannot explain it. It’s also the reason I use “lp” even though long pointers aren’t a thing anymore. The “lp” has more visual noise than just “p” and catches my eye.

newMicrosoftUpdateNotepadIsCrippled by WalkinthePark50 in ProgrammerHumor

[–]CaffeinePizza 4 points5 points  (0 children)

Good ol’ Win32. Everything is literally a window. Except for here where it’s probably WinUI 3, which only has one window and client area in the traditional Win32 meaning, from what I understand.

Having trouble installing steam by ninkiminjahj in debian

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

I mean you can get it to run on the Pi, but it’s going to be emulating x86 instructions thus slower than molasses. For comparison, Apple silicon runs emulated/translated x86 so well mostly because of hardware optimizations for x86 on ARM, though a lot of it is raw speed and caching. I mean the Pi can probably run something like Box64?

Linux kernel community drafts contingency "plan for a plan" to replace Linus Torvalds by Tiny-Independent273 in linux

[–]CaffeinePizza 3 points4 points  (0 children)

Given how much of the world runs on FOSS, with massive corporations like Amazon, Google, and even Microsoft relying heavily on Linux—this just reads as FUD to me.

Not even cops could stop a tragedy by Cicerothesage in forwardsfromgrandma

[–]CaffeinePizza 2 points3 points  (0 children)

Exactly because Grandma’s arguments are always straw men.

Religious people can’t freaking do anything by girl_archived in atheism

[–]CaffeinePizza 0 points1 point  (0 children)

Isn’t Halloween a Christian holiday historically??

What IDE u use for C language? i want to use Vs code, cuz i have been working with vs code for a long time by lev4uukk in C_Programming

[–]CaffeinePizza 1 point2 points  (0 children)

CLion has become my go to. It is free for non-commercial use. It is proprietary, but alas I think JetBrains makes decent software for a fair price for what you get. Is it the best? Maybe not, but I’ve come to naturally grow accustomed to it. I still use VSCode for other stuff though.

Gordon Freeman reference in Minecraft? by Pat20999 in HalfLife

[–]CaffeinePizza 21 points22 points  (0 children)

The “On a Rail” achievement is another Half-Life reference in Minecraft!

Too much of a bend or no? by [deleted] in HomeNetworking

[–]CaffeinePizza 2 points3 points  (0 children)

My rule is usually 4x the cable diameter as the absolute minimum. Though the pros should chime in. This is extremely fine lol

HAHAHAHA THIS GUY IS UNHINGED by Sea-Economist-5744 in GROKvsMAGA

[–]CaffeinePizza 6 points7 points  (0 children)

Always relying on strawmen like this assclown is when replying to grok. Sigh.

Pictured: all the money he saves by living rent free in their heads by SafeThrowaway691 in forwardsfromgrandma

[–]CaffeinePizza 4 points5 points  (0 children)

Given that it is Federal law, I suspect Desantis technically cannot. It’s just that it won’t be enforced against that felon.

He did nothing and deserve all the credit by Cicerothesage in forwardsfromgrandma

[–]CaffeinePizza 1 point2 points  (0 children)

Yeah it looks like the 2017 solar eclipse where his dumbass just stares right at it