Fuck you, Microsoft: near and far macros

If you target the Windows platform, chances are that your code will have this:

#include <windows.h>

Which in turns includes <windef.h>, which unconditionally defines the following macros:

#define far
#define near

Right. Because there’s no chance in hell that, writing 3D code for Windows, someone’s gonna name any of their variables near or far. Never happens. Never will.

Fuck you, Microsoft, for not even providing a way to disable that monstrosity with a global macro such as NOFUCKINGMACROSFROMTHEEIGHTIES but instead requiring me to #undef those macros after each inclusion of <windows.h>. And it’s not like you don’t know how to do that, because you provide NOMINMAX which deactivates your min() and max() macros in the same fucking file. Fuck you for silently breaking code that compiles cleanly on every platform, Mac OS X, Android or the Playstation.

I refuse to be swayed by your terror tactics and name my variables m_fNearPlaneClipDistance or whatever deranged mind decides is better. My near and far values are called near and far, because I love this naming scheme, and if you don’t, fuck you and your fat wife.

  • Posted: 2011-03-04 13:44 (Updated: 2011-03-04 14:54)
  • Author: sam
  • Categories: windows rant code

Comments

1. anonymous -- 2012-03-21 01:00

One day I defined a function that took parameters measured in radians called "rad1" and "rad2". Turns out that Microsoft has #defined rad1 0x0420 and rad2 0x0421. Fine, whatever, but the resulting error message doesn't give me any clue why the heck my perfectly reasonable function declaration wouldn't compile. Then later I defined a pair of variables called "large" and "small". Well, Microsoft's rpcndr.h (whatever that is) has "#define small char".

2. anonymous -- 2012-06-18 21:46

I'm totally agree with you. I had a same trouble today!

3. Pietro Gagliardi (andlabs) -- 2014-05-06 03:56

Some years late, but.

Welcome to the wonderful world of compatibility. Specifically, in the dark age of 16-bit Windows, before 3D programming was really a thing (yes I know this is inaccurate), you had these things called "near pointers" and "far pointers". Raymond Chen talks about them here: http://blogs.msdn.com/b/oldnewthing/archive/2004/11/01/250610.aspx (and a few other places).

And so to continue to support this ancient code, which they MUST support (Raymond Chen again: http://blogs.msdn.com/b/oldnewthing/archive/2004/03/01/82103.aspx), you get these macros.

It's a shame Microsoft doesn't provide an override switch like they do with min()/max(). Here's a silent #define to get (as far as I know, legitimately) angry about: #define small char From what I can tell it's a MIDL leftover in rpcndr.h.

19. Smithe841 -- 2016-12-23 21:20

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your weblog? My blog is in the very same niche as yours and my users would truly benefit from a lot of the information you present here. Please let me know if this alright with you. Thank you! fgbdfadefebecefe

46. BiesCaw -- 2017-01-02 14:37

Hello, I just wanted to say hi, vast to be here, enticing comunity! In case you interested, my website: http://motiondetector.xyz

55. Joyce@tiZ -- 2017-01-16 18:29

Hi boys! I have nice videoshow for you! Join to see my perfect body!! http://goo.gl/YGwvnM I’m waiting for you!!!

58. Joyce@tiZ -- 2017-01-17 19:13

Amanda need relaXXXing Massage >> http://goo.gl/WoaOm6 <-- #like4like #vitaindiretta #tru_beauty

60. Sharon@Scaro -- 2017-01-19 08:33

Most characters will be naked and performing aggressive sexual actions, will you allow it? http://goo.gl/4uwwKV

61. LauriLok -- 2017-01-19 21:35

Fast Ties for Rough Sex >> http://goo.gl/WoaOm6 #cum #cock #cumtribute

94. Allhek -- 2017-01-24 14:04
101. Smithb938 -- 2017-01-26 00:32

You have brought up a very excellent details , regards for the post. kdecdgcdeedecgkf

103. Agata@phalk -- 2017-01-27 09:57

#Hardcore anal compilation (fast) http://goo.gl/mZ7OI7 #hunks #stream #bitch #fuck #fun #

107. Agata@phalk -- 2017-01-28 15:03

Huge natural titties blonde sheer hose screw http://goo.gl/mZ7OI7

111. Agata@phalk -- 2017-01-29 06:48

Super online sex game! http://goo.gl/mZ7OI7

114. LauriLok -- 2017-01-30 08:07

Fast Ties for Rough Sex >> http://goo.gl/mZ7OI7 #cum #cock #cumtribute

126. Visit Website -- 2017-02-01 08:02

XWCuDX You are my inspiration , I have few web logs and rarely run out from to brand.

139. Svetlana@fet -- 2017-02-06 12:37

Hi boys! I have nice videoshow for you! Join to see my perfect fitness body!! >>> http://ufgd.at.ua I’m waiting for you!!!

152. Lauri_Lok -- 2017-02-13 19:55

[b]Cam sex Find it hereb http://goo.gl/tFf5Ys

166. Smithb715 -- 2017-02-25 00:50

Today, while I was at work, my sister stole my apple ipad and tested to see if it can survive a 30 foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone! acgeebkcddacgfec

167. Linda@CON -- 2017-02-25 19:51

Free Sex Tube Videos: Hot HD Porn Movies & Mobile XXX >> http://goo.gl/oPPZp3

200. Bermakle -- 2017-03-20 11:40

Владелец http://healbio.ru/ лох.

204. XRumerTest -- 2017-03-21 04:10

Hello. And Bye.

347. XRumerTest -- 2017-04-29 00:18

Hello. And Bye.

355. XRumerTest -- 2017-05-10 09:10

Hello. And Bye.

356. _[ᶫᵒᵛᵉ]ℓข¢γ∱ะµะЯŋ¡ƈΣ -- 2018-01-19 22:35

now's a good time to fuck roslyn/coreclr/corefx/standard for removal of com if you want to preserve history.

357. _[ᶫᵒᵛᵉ]ℓข¢γ∱ะµะЯŋ¡ƈΣ -- 2018-01-19 22:36

I guess the difference is it is less corporal and with the previously mentioned projects it is easy to communicate with the developers.

358. Cranberries -- 2018-07-04 10:46

I am looking for and I love to post a comment that "The content of your post is awesome" Great work! Cranberries

359. Blueberries -- 2018-07-04 12:18

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Blueberries

360. Raspberries -- 2018-07-04 12:48

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site. Raspberries

361. Elderberries -- 2018-07-04 13:10

I feel a lot more people need to read this, very good info! . [https://www.naturalfoodseries.com/11-benefits-elderberries/ Elderberries

362. Elderberries -- 2018-07-04 13:10

I feel a lot more people need to read this, very good info! . Elderberries

363. Crowberries -- 2018-07-04 19:59

It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. Crowberries

364. Grapes -- 2018-07-05 16:10

A great website with interesting and unique material what else would you need. Grapes

365. Gooseberry -- 2018-07-05 16:53

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information... Gooseberry

366. David Bennett -- 2018-07-07 07:19

PS3 Emulator Android version, unlock the doors of incredible gaming fun accessing through the multifarious PS3 Games.

https://aroundandroid.com/ps3-emulator-for-android/

367. anonymous -- 2018-07-14 07:09

Hi, this is great job for macros <a href="https://www.creditcardvalid.com/fake-credit-card-numbers-work/">Fake Credit Card Numbers</a>

368. anonymous -- 2018-09-04 12:38

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your weblog? My blog is in the very same niche as yours and my users would truly benefit from a lot of the information you present here. Please let me know if this alright with you.

Thank you! * super mario bros

369. anonymous -- 2018-09-24 04:06
371. wooc -- 2018-09-27 09:43

Big Boy Survey You can win a reward and gift card for complete Big Boy Survey. Nowadays almost every brand and company want to know their customer feedback to improve their product and services and this is possible only when real people and their customer give feedback about their services and product. https://holiday-hour.com/www-bigboy-com-big-boy-survey/ <a href="https://holiday-hour.com/www-bigboy-com-big-boy-survey/">Big Boy Survey </a>

372. katcafe12345@gmail.com -- 2018-09-27 12:08

<a href="https://surveyguide.net/"> My Survey Guide </a>

373. Assignment help -- 2018-09-28 10:57

Psychology is the most crucial discipline which supports other disciplines as well. Students have to write essay assignments on the several topics of psychology which are assigned by teachers. Students Assignment Help provides the services of customer psychology assignment help to the students. https://www.allassignmenthelp.com

374. anonymous -- 2018-09-30 14:13

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Scott Keever SEO agency https://scottkeeverseo.com

375. anonymous -- 2018-10-02 12:17

This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it inground pools https://www.harvestpools.com.au

376. anonymous -- 2018-10-03 09:23

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. cool things to buy on amazon https://coolthingstobuy247.com

377. anonymous -- 2018-10-03 14:42

I like this post,And I guess that they having fun to read this post,they shall take a good site to make a information,thanks for sharing it to me. spijunske kamere https://www.mikrokamere.com/

378. anonymous -- 2018-10-03 14:52

I love this blog!! The flash up the top is awesome!! spijunske kamere https://www.mikrokamere.com/

379. anonymous -- 2018-10-04 11:53

This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. คอกีฬา https://corekela.com/

380. anonymous -- 2018-10-06 10:24

I read that Post and got it fine and informative. Please share more like that... e zigaretten shop https://www.classyvaper.de/

381. anonymous -- 2018-10-06 17:52

I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, i am always look for people to check out my web site. the jovell floor plan https://www.the-jovell-condo.com.sg/

382. anonymous -- 2018-10-07 07:14

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. jui residences floor plan https://www.jui-residences-officialsite.com.sg/

383. anonymous -- 2018-10-07 19:02

Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here. oxyextensions https://www.oxyextensions.de/

384. anonymous -- 2018-10-08 09:40

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business.

SMS Connect https://smsconnect.robocent.com/

385. anonymous -- 2018-10-08 17:49

Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information. hypnose https://www.hypno-sup.com/

386. anonymous -- 2018-10-10 07:58

I am definitely enjoying your website. You definitely have some great insight and great stories. third eye supplements http://thirdeyeactivaor01.nation2.com/

387. woom -- 2018-10-11 08:55

Nice blog, the article you have shared is good.This article is very useful. My friend suggest me to use this blog.

<a href="https://tellthebell.website/"> Tell the bell survey </a>

388. anonymous -- 2018-10-13 08:54

Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. encanador https://servico24horas.com.br/

389. anonymous -- 2018-10-17 19:28

Merely a smiling visitant here to share the love (:, btw outstanding style. The Opus floor plan http://opusofficial.nation2.com/

390. anonymous -- 2018-10-20 17:13

If more people that write articles really concerned themselves with writing great content like you, more readers would be interested in their writings. Thank you for caring about your content. wooden easels https://www.indigodisplays.co.uk/wooden-display-easelshtml

391. anonymous -- 2018-10-21 11:30

I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! website design bournemouth https://www.seoflatrate.co.uk/rent-a-website-services

392. anonymous -- 2018-10-21 11:30

I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! website design bournemouth https://www.seoflatrate.co.uk/rent-a-website-services

393. mynikevisit -- 2018-10-22 10:23

The Nike conducts the survey to know about customers satisfaction and experience. For that, they ask the customers in the form of a survey. https://surveyinfo.xyz/nike-survey/

394. anonymous -- 2018-10-22 10:45

Is it okay to post part of this on my website basically post a hyperlink to this webpage? digital currency exchanger https://www.rightchanger.com/

395. anonymous -- 2018-11-01 12:02

I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... hdmi over ip matrix https://www.provideoinstruments.com/HDMI-Over-IP-Matrix_c_27.html

396. anonymous -- 2018-11-04 14:18

Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thank you! Tot Talk https://tottalk.com

397. anonymous -- 2018-11-05 15:28

Nice post mate, keep up the great work, just shared this with my friendz Affordable Locksmith Milwaukee https://affordablelocksmithmilwaukee.com

Add New Comment