Thank you Mr. Petzold
You made writing code for Windows much less painful than it could have been.
Charles Petzold’s book Programming Windows (in various editions) was how a generation of developers learned to code for Windows – 25 years ago when Microsoft’s operating system was the hot new thing. Charles Petzold Petzold now works for Xamarin, and I caught up with him at the company's Evolve conference in Atlanta last …
I cut my teeth on programming in Win32 by reading Charles Petzold's book about 15 years ago. He made the Win32 API make sense to me, though I'm worried about Xamarin forms given that he's working at Xamarin and probably has some input on its design.
Do I really want someone who has spent the last 25 years on the Win32 API anywhere near the design of a new API? Even if he is Charles Petzold?
Problem was that people took the examples from Petzold's book and extended them, which led to the 14-page switch statement programs that everyone has seen once and run away from them as fast as he/she could.
OWL was a bit worse than Delphi's framework (don't remember the name right now) but both made C++/Pascal programmers way, way more productive than raw Win32 or MFC programmers. But the MS borg crushed Borland (with a little help from Borland itself) so what remained was the VHS of Windows frameworks.
Now that Windows is the niche and the number of developers on Objective-C or Android is vastly superior to the number of Windows developers perhaps Microsoft feels some incentive to make Windows development a bit better. Such as, oh god, making it cross platform?
The funny thing is that most of the non-OO stuff in MFC was layered on by macros. Under the hood was a reasonably clean OO design. I took advantage of that with my PP2MFC product which mapped the lovely PowerPlant framework from Metrowerks to MFC, so you could cross-compile Mac GUI code.
The history of MFC is that it was supposed to be a much more OO design, informed by Apple's MacApp, but the "Advanced Framework" was deemed too hard for Win32 C programmers so was dumbed down. Hence the "AFX" prefix on many identifiers which lingers on like the NS prefix in Apple lingers as a reminder of NextStep.
I evaluated both OWL and MFC at the time, and OWL was clearly designed by someone who understood OOD, while MFC didn't seem to grasp the concept.
What you're missing is that MFC wasn't trying to grasp that concept.
MFC was not so much an attempt to build a good OO framework for C++ as a pragmatic approach to providing a framework that could straddle the gap between 16-bit Windows (and Microsoft's 16-bit C++ compiler that no support for exceptions or templates) and Win 32 (and their new 32-bit compilers that at least paid lip-service to some newer language features).
It wasn't lovely, but it was effective.
OWL was a bit worse than Delphi's framework (don't remember the name right now)
That would be the Visual Component Library (VCL) perhaps?
It it just me or is the general tone of this article (despite details stated to the contrary) along the lines of "Meet Charles Petzold - the man who reverse-engineered the Windows API"?
Or even ...
Windows 1.0 had tiled windows and I had a paragraph in my first chapter explaining why tiled windows were better than overlapping windows.
"Charles Petzold vindicates Windows 8"
Face it, Windows is no longer the dominant OS on machines connected to the Internet. Explorer is no longer the browser leader outside desktops and laptops, and even there is leading by a tiny margin.
The previous mindset that made developers stick with Windows technologies assuming that they could spend their professional lifetime with them no longer holds true. You have to look outside if you want to remain relevant.
"The previous mindset that made developers stick with Windows technologies assuming that they could spend their professional lifetime with them no longer holds true. You have to look outside if you want to remain relevant."
Yeah, you can now spend an entire career trying to get a single Android app working on every combination of device hardware and OS variants... and still not get done before it's time to retire!
Of course it is.
Change "machines" for "devices" and you might be right although it would be interesting to see stats for total number of pages loaded across desktop & mobile OS, not number of unique devices, to measure where the bulk of usage is coming from.
"Of course it is.
Change "machines" for "devices"
If "machines" means desktops and laptops to you, then you're likely right. However my point was about what you call "devices" (perhaps I'm not up to industry standards, for me a "machine" and a "device" are the same)
As for number of pages, I'd say that metric is becoming irrelevant. Mobile apps don't "load pages" from a browser in the conventional sense, they may have a browser component embedded that does so, but the most popular apps (FB, YouTube, etc) have their native front end communicating over http, but no notion of "browser" is in the middle. And they are usually generating way more traffic than desktop/laptop browsers.
I used to be an avid Delphi user (and quite proficient with the VCL).
Today I'm mainly using C# and this morning I again found myself shaking my head in dismay as I tried sorting out taborder on a winforms form. In Delphi, setting the TabOrder property would automatically renumber TabOrder on other controls. Which makes sense, because what good would it do anyone to have two (or more...) controls on the same form with the same TabOrder? In Delphi it is simple to go back to a five year old form, insert an edit field in the middle of the form and get the TabOrder in order (pardon the pun). Using Visual Studio's Winforms editor OTOH is a chore. Even Delphi 1.0 (from 1995) beats VS hands down in this regard.
We are making the move to WPF. It has become my favorite way of making GUIs, but its steep learning curve is naturally easily beat by Delphi. However, the possibilities that WPF offer makes it worth it. At least I hope that will be the case. I18n is one of the trickier aspects of WPF in my opinion. I feel somebody dropped the ball there.
But Winforms? It should have been put out of its misery a long time ago.
The one thing I remember about OWL is Borland changed everything between a particular pair of versions (was it 1.0 to 2.0?) They basically told developers to rewrite all their code and provided tools that did a rather bad job of automatically converting it.
In my book, if you're providing API you should keep the interface to it backwardly compatible - we felt betrayed by Borland and our small company shifted to plain Windows with MFC after that since we were going to have to rewrite our code anyway. Prior to that we'd used Borland from the days of Turbo C.
I remember learning to program windows using Petzold book as a young programmer just cutting their teeth on coding.
Looking back now, I do think that Petzold taught a lot of early windows programmers some really bad habits such as the use of naked global variables to store things like handles and we ended up with a lot of really bad, unstructured, difficult to maintain code.
Unfortunately at the time I didn't know any better
...my copy of Programming Windows 3.1. The knowledge of how the internals of windows worked came in useful for many years afterwards even as things moved on to proper multi tasking, and wrappers, APIs and frameworks came to hide some of the more laborious parts of the code we had to write.
The Hungarian Notation comment above made me szChuckle too :-)
I still slip in to using it sometimes and people wonder why the variable names have all 'that crap' in front of them [myself included] ;-)
> Apart from 'Microsoft don't know how to do the overlapping ones they promised two years earlier
They could and did do overlapping windows in Windows 1. That's what a drop-down menu is. What they chose not to do was overlapping top-level app windows, partly for fear of litigation from Cupertino and partly because they genuinely thought, backed by observation of novice user behaviour, that it was less confusing.
This belief later gave us the Metro UI. Someone hammer a stake through it, please.
Long ago in another age, MS stabbed IBM in the back and dropped OS2. A very prominent author got so irate at MS deep-sixing a finally rational API set, he swore he'd **never** write another book for Microsoft's APIs. Was that Petzold? Because strangely I have not in the last several years been able to track down exactly who that was... I sure though it was him, but can't find *any* mention. Very strange, as it was a big deal at the time.
And here I thought OS/2 died because it was tied into the proprietary microchannel architecture that IBM refused to license and ultimately dropped as a Waste Of Time.
IBM are good at Aiming At The Wrong Target. From the Wikipedia page on OS/2
"At the launch of OS/2 Warp in 1994, Patrick Stewart was to be the Master of Ceremonies; however Kate Mulgrew of the then-upcoming series Star Trek: Voyager was substituted at the last minute"
So instead of the "captain" who rebooted the Star Trek franchise with nitromethane, they picked the one to whose show's theme you could sing:
"Boring song, it's a boring song,
A boring song,
A boring song,
What a boring song
Boring song, it's a boring song,
A boring song,
And *what* a boring show."
ST:TNG - people exploring out beyond the limits, ever outward and upward.
ST:V - people running for home and the familiar as fast as possible.
Which metaphor do you want nailed to your product?
I had a colleague who lost a hard-won and prestigious CIO position when his support of OS/2 outpaced IBM's.
Biting the hand that feeds IT © 1998–2021