General Category > Programming
Tags
OnewingedDragon:
I made a webpage for the heckuvit yesterday and this did not happen to me although I have read on multiple occasions that it is bad to overlap tags as opposed to nesting them.
What is the difference and how can it cause problems with the page, or whatever else you might use tags for.?
ScienceFair:
Nesting tags is like doing this <text><Italics>blah</italics></text> When you over-lap it'd be like <text><italics>blah</text></italics>
If you pretend that <text> is a command that allows you to state how the text should be displayed then in the example that overlaps the coding the browser or whatever is reading your programming may have no idea what </italics> refers to... You have to remember that machines are stupid and won't understand things like typos.
Basically that means that if you over-lap your coding then the second code or the overlapping one may never actually be processed, so you can't be sure, unless you're really experienced with the language that what you write will show up how you thought it would, especially when it comes to multiple programming languages.
So... you use nested tags to make sure what your program actually happens the way you expect it to...
Granted I haven't really programmed for like 5 years, but I hope that makes sense...
This only really matters when you start getting somewhat complicated though...
OnewingedDragon:
Basically a more tags there are the more important it is to nest?
ScienceFair:
Basically, you should nest as a general rule, because any failure to nest can result in the complete failure of your programming to work how you expect it to... and the larger the program the harder it is to find where you messed up if you don't do it naturally... Granted you don't have to program with it, but if you don't... and ignore it for awhile and then go back to it wanting to change something you might be pulling your hair out. :-D
Meh, whatever... I'm a fool. Mike can set you straight.
Mike Caron:
It's like this. Consider each tag to be a box:
This represents Text. As you can see, all the tags are neatly contained within their container. The boxes are physically confined to the box they are contained in.
Now, consider what happens to the fabric of reality if we allow the box borders to cross:
What? The box is half in, and half out of the outer box?! That's not physically possible!
Alternatively, you can consider that it's the rules of the language, and breaking them isn't something you have the authority to do.
Navigation
[0] Message Index
[#] Next page