Reply to (formatting)
- ...you've been changing the Syntax sections' markup from using
codetags to using leading-space preformatted blocks and adding variable declarations, although this isn't the way things are handled in the rest of the reference.
I'm not sure how closely you'd follow my talk page, so I'm responding here. Oh, how I hate the talk-page mechanism...
The leading-space preformatted blocks are cleaner and more readable than the code-formatted ones. The code in effect looks like it's been blockquoted, you don't get misalignment for the first line due to a leading opening code tag (or a gratuitous newline), and on-page it's displayed in a box with a background to distinguish it from article text. The other alternative that I occasionally use is a pre tag, only because HTML (and wiki formatting) in it is interpreted as raw text. As for why it doesn't use the indent-formatting already, that's partly because the initial importer didn't know about it at the time. We were all new to wiki syntax at the time, and we pick it up as we go.
Finally, the code-changing issues. First, let me say the original way the reference did it (e.g. just
propertyIsEnumerable(p)) was completely unacceptable. Even though most methods are almost invariably called on objects, the reference just didn't show them being used that way, making them basically useless. I've been fixing that as I edit pages in the reference. (I'd be surprised if I haven't converted more than half, to be honest.) Second,
var. The reason I've been adding
var is that this code will be copy-pasted a lot. Without
var, any one of these will create a global variable, breaking modularity and eventually setting up whoever's done this for a fall when they depended on the assignment being local. We should not promulgate code with a hidden gotcha like this when it's so trivial to avoid the problem.
I think we should change back the edits you made to undo these changes, but I'd at least like to try to convince you that there are good reasons for the changes before reverting. Let me know your feedback (here or on my page, either works as I read the recent changes feed), and we'll work from whatever your understanding is to some sort of agreement. --Waldo 11:37, 1 December 2007 (PST)