(no title)
burgerbrain | 14 years ago
What could possibly make somebody want to do that? Are there any examples around of people doing that?
burgerbrain | 14 years ago
What could possibly make somebody want to do that? Are there any examples around of people doing that?
tolmasky|14 years ago
greghinch|14 years ago
chris_wot|14 years ago
1. Internet Explorer has conditional comments - http://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%2...
2. Sprockets' directive processor uses directives in comments. https://github.com/sstephenson/sprockets
famousactress|14 years ago
I quickly get visions of version numbers, customized namespace declarations, typedefs, strftime date format strings...
kuahyeow|14 years ago
wmil|14 years ago
And people do all kinds of nonsense with HTML comments. A very bad idea is often the fastest to implement.
Yarnage|14 years ago
So this wouldn't surprise me one bit. Would be interesting to see some real-world examples though.
pavel_lishin|14 years ago
jhaglund|14 years ago
mcav|14 years ago
jerf|14 years ago
(Better yet is to create an explicit place for metadata. I almost reflexively use {"metadata": null, "payload": ...} now instead of putting my payload right at the top level, because wouldn't you know it, sooner or later some metadata always seems to wander in. And if it doesn't... shrug. If you're in a place where you can afford JSON in the first place the extra cost is probably way below the noise threshold for you.)
frobozz|14 years ago
/* jslint nomen: true, debug: true, evil: false, vars: true */
endgame|14 years ago
kabdib|14 years ago
Also, Emacs uses comments to set file-local options. There's a long tradition of overloading comments to achieve metalinguistic ends. JavaDoc and Doxygen are great examples.
Even when handed a decent macro language with whizzy namespaces and a great DOM, I imagine that some people will still stoop to gross and convenient hacks.
Nagyman|14 years ago
https://developers.google.com/closure/compiler/docs/js-for-c...
mseebach|14 years ago
http://en.wikipedia.org/wiki/C_preprocessor
pyre|14 years ago
mikeash|14 years ago
devicenull|14 years ago