6 ms·
Regarding the "Windows culture": WinProc programming was indeed pretty horrible. Didn't really program a lot in WinProc - but I've cut my teeth with MFC which
by brusch64 11y ago
Regarding the "Windows culture":
WinProc programming was indeed pretty horrible. Didn't really program a lot in WinProc - but I've cut my teeth with MFC which was supposed to make it better.
They broke down the big switch in the program and created classes (the c in MFC) and macros.
The VCL of Borland was more abstracted, but we've used MFC.
I am pretty happy that I don't have to do this any more.
When I started with C# and Windows Forms it seemed like a revelation for me.
- pjmlp 11y agoComing from a Borland background, MFC was pretty bad when compared with any of its frameworks. However in MFC's defense I think one can blame it on Microsoft's study group. I read somewhere that the Afx prefix came from their original design. A framework close in spirit to OWL, but their study group deemed it to high level. So they made it a thin wrapper over Win16 instead. On my case, the few cases I was forced outside OWL and MFC into pure C land, I use a set of macros from the Windows SDK. They weren't properly documented, but with the Windows 3.1 SDK Microsoft created a kind of "type safe" handles and message dispatch macros, which relieved the WndProc pain. Nevertheless, Xlib was even worse.
- brusch64 11y agoI've heard the same thing about the Afx macros and the plan for another more ambitious framework. In my opinion the biggest obstacles for MFC were: * a pretty bad C++ compiler (the first good MS C++ compiler was the one with Visual Studio 2003 as much as i remember) * that the core group were "old school" C guys that either couldn't design a better object oriented system or thought that it would be to hard for the "normal" developers
- pjmlp 11y agoJust decided to do a bit of archaeology. The macros in the Windows 3.1 SDK were the strict header mode and message crackers. https://support.microsoft.com/en-us/kb/83456 https://support.microsoft.com/en-us/kb/83456 It made my life sane every time I had to use C instead of C++, and yet very few people knew about them. Petzold never mentioned them in his books, I discovered them by chance in another book. Nice to know that the Afx story might have not been a rumour, since other people heard the same. My first Visual C++ was v5.0, by then it was already clear that Borland was on they way out as first choice. Sadly.
- gecko 11y agoYou know what's ridiculous? I totally agree that WndProc was horrible. But the web community is now reinventing it so directly that all I can do is bang my head repeatedly on my desk. Have you seen Facebook's Flux/Dispatcher framework, for example? The Dispatcher is usually a massive switch statement that takes a single argument, which will be a record field that corresponds with the event type. It's exactly like switching on uMsg and then casting lParam to the relevant struct. And this is considered one of the absolute best web frameworks available right now. On the bright side, I suppose we can look forward to equivalents of message crackers, OWL, and MFC for React soon enough.
- mstade 11y agoHaha yes, this is so on point it makes me laugh and then want to cry a little bit. Also, they host conferences for these things, where the kool-aid is a-plenty.
- narrator 11y agoOne thing that also reminds me of Windows culture in web development is the continuous reinvention of how to do the same old boring stuff.
- agumonkey 11y agoIt kinda frightens me too. Partly because reinvention at that scale is a bit sad, partly because it took me far too long to unplug myself from the current trends thrill and realize it. Somehow it also says something, whatever the underlying structure, local and native VS remote and abstracted (dom/js), some patterns keeps coming back over and over.
- gecko 11y agoAnd the comment is now a blog post with more context for those who were lucky enough never to write raw Windows code: http://bitquabit.com/post/the-more-things-change/ http://bitquabit.com/post/the-more-things-change/
- nubianwarrior 11y agoGood article.