The tale of min and max.



  • So I needed to use std::numeric_limits<unsigned>::max() somewhere. Fine. Except that

        ...\Somewhere.h(19) : error C2589: '(' : illegal token on right side of '::'
    

    Oh, right, Microsoft #defines min and max. I didn't want to go the boost route of writing (std::numeric_limits<unsigned>::max)(), but fortunately if one defines NOMINMAX, the definitions will go away. Right, so I add /DNOMINMAX to all projects. Win32 target goes fine, Pocket PC 2003 (ARMV4) target (side note: the code is also compiled for 3 non-microsoft platforms) does:

        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h(40) : warning C4005: 'NOMINMAX' : macro redefinition
                command-line arguments : see previous definition of 'NOMINMAX'
    

    Oh, right. So it looks like it's defined by default on WinCE, so let's remove it from WinCE targets:

        ...\Somewhere.h(19) : error C2589: '(' : illegal token on right side of '::'
    

    WTF? It is defined, but min and max are still getting defined?!?! Well, yes. It turns out windef.h (the SDK has it's own copy, but it's identical to the Win32 one) might sometimes get included before altcecrt.h. So now the compiler options include:

        /D_CE_CRT_ALLOW_WIN_MINMAX /DNOMINMAX
    


  •  It's a bitch when your natural naming conventions are the same as the library/framework/system you're using.



  • @dhromed said:

     It's a bitch when your natural naming conventions are the same as the library/framework/system you're using.

    If it was my naming conventions, I'd just change them. But here naming conventions of the system (Windows) conflict with naming conventions of another part of the system (standard library)…



  •  We're talking about Microsoft here, which, as we all know, has its own ideas about what constitutes a standard, and who should establish it.



  • The options aren't the WTF. The #defines in Microsoft's standard headers are the WTFs.

    The C++ FAQ Lite is great fun with regards macros. For example:

    @C++ FAQ Lite said:

    39.5 What should be done with macros that have multiple lines?

    Answer: Choke, gag, cough. Macros are evil in 4 different ways: evil#1, evil#2, evil#3, and evil#4. Kill them all!! (Just kidding.)

    .... answer ....



  • Bulb: I know how you feel. I've also had this sort of problem with Windows CE.

    I think my issues related to DirectX, though.



  • Yeah and Ballmer dances like a monkey and throws chairs LOL Gates has a borg eyepiece LOLOL



  • @blakeyrat said:

    Yeah and Ballmer dances like a monkey and throws chairs LOL Gates has a borg eyepiece LOLOL
    That was a bit uncalled for, no?



  • @Zecc said:

    @blakeyrat said:

    Yeah and Ballmer dances like a monkey and throws chairs LOL Gates has a borg eyepiece LOLOL
    That was a bit uncalled for, no?

    I dunno, seemed like the kind of post that Severity One would be comfortable and familiar with given what he posted.



  • In a thread with people with reasonable complaints you decided to make a sarcastic post responding to a guy two posts above you without quoting.

    Okay.



  • Glad you approve.

    You're okay too!



  • I should probably say that I wasn't having a go at Microsoft particularly. The decision to do such a thing in any code (particularly header files) is WTF and it would be WTF in any API or set of headers. This thread happened to be talking about a Microsoft package with which I'm not familiar.



  • @blakeyrat said:

    I dunno, seemed like the kind of post that Severity One would be comfortable and familiar with given what he posted.
    Are you actually over the age of 12? Because I remember the time that Microsoft couldn't give a hoot about standards, and invented their own, and perverted existing ones (their take on Java comes to mind).

    They're a lot better behaved now. I quite like them, actually.

     



  • @Severity One said:

    Are you actually over the age of 12? Because I remember the time that Microsoft couldn't give a hoot about standards, and invented their own, and perverted existing ones (their take on Java comes to mind).

    No. I actually agreed with their viewpoint. If the standard was incomplete, or sucked balls, they said fuck it and made something better while remaining as faithful to the standard as possible. Letting people write HTML scripting in ActiveX wasn't a violation of the (original) standard; Microsoft thought people would want to do that so they implemented it. Microsoft saw there was no good way for a JavaScript to tell whether the load event had already happened or not (there still isn't, in 2013), so they brought in readyState to the DOM. Mozilla implemented the DOM method to get the text of an element without its tags with the fucking retarded name "textContent", Microsoft said that's a fucking retarded name and used "innerText" which matches the W3C's own naming standard "innerHTML". (Of course the W3C chose the Mozilla name, even though it sucked.) Microsoft saw the W3C's retarded definition of the Button property of mouse-related events didn't allow for the possibility of chording, or receiving a mouse event when no button at all was down, so they threw it out and built a much, much better one.

    Java apps couldn't do many things that Windows apps are expected to do (still can't), so they extended the Java VM until they could. I'll never in a MILLION YEARS see how improving the Java VM to run Windows apps better is a bad thing-- have you seen how fucking awful it is at running Windows apps NOW? And it's been A DECADE since Microsoft showed the need was there! Java apps still can't even find the fucking Local App Settings folder!

    They protested giving away the spec to the Word and Excel file formats because, in the field of word processors and spreadsheets, your file format spec is your program spec-- they were basically required to give away, to their (fortunately utterly incompetent) competitors the exact spec of their competitive advantage. Frankly I'm with Microsoft on that one, the request was completely unreasonable.

    So the point isn't my age, but my opinion. And in my opinion, I find it very hard to criticize anything Microsoft did standards-wise, once you understand what was actually going on in each case.



  • @Severity One said:

     Because I remember the time that Microsoft couldn't give a hoot about standards, and invented their own, and perverted existing ones (their take on Java comes to mind).

    They extended the JAVA standard to help make the apps work better on their OS, if you wanted to use the feature you could, but did not happen to.

    Then, in the company-killing move of the century, SUN decided to sue Microsoft over changing their implemntation.  Here you go, sue the company that is now making your standard available on the biggest computing platform in use and shipping as part of the standard install of the OS, even if they had a little extension on it, it was a fast implementation of your standards and they were embrasing JAVA.  Microsoft's answer:  Dump JAVA and J++ and go in a different direction.  That direction?  The poorly named .NET framework.

    Now, instead of having your platform installed, you have to get people to install your (poorly built) implementation of the runtime on their machines.  Meanwhile your comptitor's new framework is faster and standard.

    (Does anyone else remember when every button on a website was done in Java?  Front page would build them for you! )





  • Why don't you just write a post reading: SLASHDOT!

    It's the absolute height of paranoia to assume Microsoft improved Java purely to kill it off-- how does that even make goddamned sense? "We want your product to go away, so here: now it's a lot better! TAKE THAT!"



  • @blakeyrat said:

    "We want your product to go away, so here: now it's a lot betterhas proprietary extensions that cannot be used on anything but our platform! Your code is now useless! TAKE THAT!"

    FTFY



  • Considering it's 2013 and Java apps run WORSE NOW than apps built for the Microsoft JVM in 2001 did-- uh. I think Microsoft kind of had a point, right?

    They were proprietary because the OS they applied to was proprietary. I don't see an issue with that. There's no point to a Java extension to use a specific Windows feature on a platform other than Windows.


  • Winner of the 2016 Presidential Election

    @blakeyrat said:

    Considering it's 2013 and Java apps run WORSE NOW than apps built for the Microsoft JVM in 2001 did-- uh. I think Microsoft kind of had a point, right?

    They were proprietary because the OS they applied to was proprietary. I don't see an issue with that. There's no point to a Java extension to use a specific Windows feature on a platform other than Windows.

    The impossible goal of Java was "write once, run anywhere." Using platform-specific extensions ties you to that specific platform. The Java-way is to abstract the OS differences away, but this usually leads to the lowest common denominator in functionality.

    The conspiracy theorists think Microsoft didn't want Java apps written for Windows to be portable to other platforms, so users would have a disincentive away from switching to a rival platform. I think they may have a point, but I avoid Java like the plague so I don't really care.



  • @blakeyrat said:

    Considering it's 2013 and Java apps run WORSE NOW than apps built for the Microsoft JVM in 2001 did-- uh. I think Microsoft kind of had a point, right?

    I'd be interested in seeing concrete benchmarks to back this up.

    @blakeyrat said:

    They were proprietary because the OS they applied to was proprietary. I don't see an issue with that. There's no point to a Java extension to use a specific Windows feature on a platform other than Windows.

    Except Java doesn't run on Windows. It runs on the JVM. Other languages like Scala also run on the JVM. Windows is outside the JVM. Java is inside the JVM. Connecting them gives you the worst of both worlds. Your code is limited to one outer platform (windows), it's slow (because it's still in a virtual machine, just a less portable one), and you can't use features that aren't available from the standard library (because no native libraries will work).

    To be clear: I don't hate Oracle any less than I hate Microsoft. The mindless following annoys me more than Microsoft's attempt to piggyback on Java and then render it unusable by making their operating system incompatible with the original implementation (hey, it says I need Java! I already have Java!).



  • @Ben L. said:

    Except Java doesn't run on Windows. It runs on the JVM. Other languages

    Except pedantic dickweed pedantic dickweed pedantic dickweed pedantic dickweed.

    Tell ya what, if you actually want to respond to my post, write a reply that's not so slathered in pedantic dickweed that I don't even bother to read the whole thing. Just a little pro-tip there.



  • @blakeyrat said:

    @Ben L. said:
    Except Java doesn't run on Windows. It runs on the JVM. Other languages

    Except pedantic dickweed pedantic dickweed pedantic dickweed pedantic dickweed.

    That wasn't pedantic dickweedery. That's the key idea behind Java and reason why Sun didn't like what Microsoft was doing.

    Unfortunately while it would be nice if the idea was workable, it does not seem to be. That's why after all the years the only way to write portable applications is still in C++ despite all the pain in the arse it involves.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.