Fog Creek Software
Discussion Board




Why Pragma?

I've seen the word "pragma" used in the context of HTTP cache control and also as a C++ macro, but what does this word actually mean? Google didn't help.

John Topley (www.johntopley.com)
Thursday, December 04, 2003

Dictionary.com claims it's a contraction for "pragmatic information." No clue whether that's true or not, though.

Jimmy Jo-jo
Thursday, December 04, 2003

One of dictionary.com's definitions of "pragmatic" is "Dealing or concerned with facts or actual occurrences; practical".

This makes sense for C++ #pragmas, which I normally use to work around bugs or idiosyncracies with the compiler or languages. In an ideal theoretical world, we shouldn't and wouldn't need the #pragma, but at the bottom line it needs to be done to get something working.

Better Than Being Unemployed...
Thursday, December 04, 2003

Pragma is a classical Greek noun meaning "deed" or "action"

Breandán Dalton
Thursday, December 04, 2003

Google helps if you look for Latin/Greek dictionaries

Greek pragmatikos with root pragma: deed, as in "to do!"
pragma - item, matter, thing

Andy
Thursday, December 04, 2003

The use of the "pragma" keyword dates back at least as far as Ada in the mid-1980s. It was used for compiler control.

Bored Bystander
Thursday, December 04, 2003

>>This makes sense for C++ #pragmas, which I normally use to work around bugs or idiosyncracies with the compiler or languages.

To nitpick, I would describe C++ pragmas more as a way to access compiler features that are outside the scope of the standard (and thus don't have a standard way of accessing).  E.g., the most common uses I've seen are for suppressing certain warnings (4786!), specifying structure layouts, and preventing multiple header includes.
Which does nothing to further the discussion of the origin of "pragma".

Brian
Thursday, December 04, 2003

Worst. Keyword name. Ever.

Computer Book Guy
Saturday, December 06, 2003

*  Recent Topics

*  Fog Creek Home