Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Do you mean "any change to whitespace in HTML or XML results in a semantically inequivalent document"?

In a very limited sense it is like this for most languages, at least ones where error traces include line:cols numbers or that give magic macros like php's __LINE__.

If you where to use those data in you logic a formatting could break your code, similarly if you read the text content of you html and use its whitespace in your logic a formatting could break your code, aside from that in most cases 1 whitespace or 1000 whitespace are generally equivalent in HTML



> In a very limited sense it is like this for most languages, at least ones where error traces include line:cols numbers or that give magic macros like php's __LINE__.

But generally people take the view that code that throws error traces with different line numbers can still be semantically equivalent, and that changing your code's behaviour depending on __LINE__ is unreasonable. Ultimately which files are considered equivalent will be a social convention, but it should be a social convention that fits the use cases and makes the file format easier to work with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: