Timeline for Is there anything wrong with putting comments in an HTML closing tag?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 10, 2019 at 12:00 | history | tweeted | twitter.com/StackSoftEng/status/1160158998051590145 | ||
| Aug 10, 2019 at 10:20 | answer | added | JacquesB | timeline score: 1 | |
| Sep 22, 2015 at 11:15 | comment | added | Brandin |
I sometimes use a comment such as <!-- /wrapper --> to mark the end of the "wrapper" section, for example. Obviously / has no special significance in the comment, but it is short and easy to understand.
|
|
| Sep 22, 2015 at 5:05 | answer | added | sideshowbarker | timeline score: 7 | |
| Sep 21, 2015 at 13:36 | comment | added | fet |
Good call, thanks. You guys are all right. I have a great IDE and set of plugins that highlight the closing tags for me already. I wanted to document the closing tag at the bottom because sometimes several divs end at the bottom of a document. It's nice to know what you're looking at without having to scroll up. When I'm writing javascript or ruby I usually put comments like end # def calcIndex or } // function shouldExist. It's just a style thing and it helps me. Thanks guys. Sticking to plan A.
|
|
| Sep 21, 2015 at 13:27 | vote | accept | fet | ||
| Sep 21, 2015 at 8:09 | comment | added | JᴀʏMᴇᴇ | Why do you want to do it? It sounds like a pointless question - but it's important. If it's to aid others at development-time (i.e. keep track of which opening tag each closing tag belongs to) - there may be IDE plugins that can offer info on closing tags. | |
| Sep 21, 2015 at 7:16 | comment | added | Neil |
This is like writing in C++: if (A) oneLiner(); else if (B) oneLiner(); else oneLiner(); Is that a if else with another if else in else clause or an if/else if/else? It will probably be interpretted correctly, but you don't leave these things to chance.
|
|
| Sep 21, 2015 at 6:23 | answer | added | async | timeline score: 12 | |
| Sep 21, 2015 at 5:33 | comment | added | Mario | If you really want the association, grab an editor that will highlight same level closing tags for you. | |
| Sep 21, 2015 at 5:08 | comment | added | Robert Harvey | Does it serve any useful purpose? | |
| Sep 21, 2015 at 4:51 | history | asked | fet | CC BY-SA 3.0 |