News for hackers. Stuff that matters.
Re:Essential C (2003) [pdf] by Xophmeister on Wednesday May 11, 2016 @05:20AM (#11673758)
The "C Programming Cleverness and Ego Issues" is a good bit of advice:

> Build programs that do something cool rather than programs which flex the language's syntax. Syntax -- who cares?

Otherwise, I'd never heard of/seen the `#pragma once` preprocessor directive. (Not that I do that much C programming!) How common is it to use this over include guards?

Re:Essential C (2003) [pdf] by exDM69 on Wednesday May 11, 2016 @05:26AM (#11673786)
> How common is it to use this over include guards?

Not very. It works in Microsoft's C compiler but can't be relied on elsewhere.

Re:Essential C (2003) [pdf] by claudius on Wednesday May 11, 2016 @08:53AM (#11674783)
It depends. Clang, GCC and the Intel C++ compiler all support #pragma once perfectly. Personally, I prefer it, as it is only one line rather than three and I don’t have to think of a unique name for the header guard. Supposedly it breaks if you play weird tricks with the filesystem (s.t. the compiler thinks two identical files are actually different), but I have never encountered such breakage.
Re:Essential C (2003) [pdf] by Xophmeister on Wednesday May 11, 2016 @05:44AM (#11673872)
Then why mention it over include guards, which are not discussed. Is Stanford a Microsoft shop, so to speak?
Re:Essential C (2003) [pdf] by exDM69 on Wednesday May 11, 2016 @06:09AM (#11673966)
They might have used MSVC for their exercises on this course. They're not using some C99 features such as stdint.h, which were not available in MSVC when this article was written.