Squirrels, Cilantro, and WPF
Friday, August 02, 2019

There are things in life that you find folks either love or hate, with seemingly no one sitting on middle ground – things like squirrels and cilantro...

Some people find squirrels just the cutest little things, even inviting them to their yards enthusiastically, eager to watch their foraging and deft acrobatics. Others find them nothing more than vermin, seemingly set only on stealing bird seed, harassing pets, and damaging property.

Cilantro's another one... Some people find the taste bright and citrusy as it adds a vibrant green pop to anything it adorns. Still others are cursed with a gene which makes cilantro taste just like soap, and even a fleck of nature's leafy green kryptonite can render an otherwise perfect taco or burrito inedible.

In my experience, there's a third: WPF.

Some techs you can work with, and while you may not be a big fan of them, if you get out of them for a while, you may not totally dread having to circle back and work with them again. For me, C++ would fall into that category. I'd rather not have to work with it – and it would never be my first choice for any task that I could do comparably well in another language – but it's not awful.

Other techs can just rub you the wrong way, and when you're finally done with them, a palpable wave of relief comes over you. If you're ever forcibly thrown back into the arena with them, mental anguish is sure to follow (okay, that may be a bit dramatic, but it's close). For me, WPF is one of those techs.

I won't rant too hard on my specific points of contention. I don't want to upset WPF's myriad fans, I don't want to be flamed for "not knowing how to use it", and I definitely don't want to be convinced that WPF is great. What I will say is this... I've written a lot of WPF code in the past, and when I get put into a WPF project in today's day and age, I hate it.

I have a very good memory, and this is a definite asset when writing code. Obviously, the more I can remember, the less I have to look up. Every time I've had to write a WPF application (usually after vowing never to do so again), I find myself spending more time reading docs than writing code.

source: microsoft.com

Is this something you could remember? Is this something anyone could remember? Is this something anyone should have to remember? I don't even want to have to type this, let alone memorize it!

"Ah!" you may say, "you don't hate WPF, you hate XAML!" Well, truth be told, I hate both. Sure, you can do WPF development without XAML, but who really does that? I also hate INotifyPropertyChanged. I know, I know – there are multiple ways to make implementing it easier, but none of them make me hate it any less.

Now to be fair, if I had to write a desktop app which needed a particularly slick UI and my options were WinForms and WPF, I would choose WPF. It does give you a level of control over things which would be much harder to do in WinForms via old-school control subclassing.

That said, for most other desktop apps (again, where my choices were WinForms and WPF), I would still choose WinForms. Heck, there are modern desktop apps that still use MFC and the ultra-old-school "dialog class #32770" – and look great while doing so. (Even today, I often use Spy++ to satisfy my curiosity as to what's being used for desktop app development).

When my options aren't limited to WinForms and WPF, I'd just as soon use something else entirely. Personally, I'm a fan of Electron, the same technology that powers Visual Studio Code and many other notable modern desktop apps.

Still, just as is the case if you Google for "i hate squirrels" or "i hate cilantro", a search for "i hate wpf" will yield just as many fans as haters, and chances are, they'll (we'll) never see eye-to-eye – and I, for one, am fine with that.

...and by the way, I prefer my ceviche with extra cilantro, and my squirrels in other people's yards!

Blog engine and all content © 2024 Jason Plackey