I hate Win32 (Was: The new std.process is ready for review)

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Sun Mar 31 08:49:45 PDT 2013


On Sun, Mar 31, 2013 at 7:21 PM, Lars T. Kyllingstad
<public at kyllingen.net>wrote:

> <rant>
> While working on std.process, I have developed a deep and intense loathing
> for Windows process handling in particular, and the Win32 API in general.
>
> On Windows XP, what do you think will happen when you run the following
> program?
>
>     int main()
>     {
>         if (TerminateProcess(INVALID_**HANDLE_VALUE, 123))
>         {
>             writeln("TerminateProcess succeeded, but it shouldn't
> have...");
>             return 1;
>         }
>         else
>         {
>             writeln("TerminateProcess failed, as it should.");
>             return 0;
>         }
>     }
>
> As you may already have guessed, it does *not* print "TerminateProcess
> failed" and exit with code 0.
>
> But does it print "TerminateProcess succeeded" and exit with code 1? NO!
> It prints NOTHING and exits with code 123, because TerminateProcess()
> terminates the CURRENT process when it is passed INVALID_HANDLE_VALUE.
>  Aaaaargh!
> </rant>
>
> Sorry, just had to get that off my chest.  I just spent quite some time
> trying to figure out why the Win32 unittests were failing when there was no
> assert error or any other indication of what went wrong.
>

<agreement>

I used to hate Windows for similar reasons. I hated it with passion. I
dreamed of devoting my life to the goal of putting Microsoft out of
busyness to avenge the loss of countless hours of trying to get things to
work as they say they should.

I ended my misery by buying an Apple MacBook Air and I couldn't be happier.
The development environment is a bit unusual (needs some tweaking to become
full-fledged posix development environment), but worth the time and money.
OS X is the absolute best operating system I ever had to work with. It's
system API (cocoa) makes so much more sense (despite being a bit hard to
access via C ABI).

I really recommend you to ditch that excuse for an operating system and
forget it like a bad dream.

</agreement>

-- 
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130331/b64571d6/attachment.html>


More information about the Digitalmars-d mailing list