Timeline for Be liberal in what you accept... or not?
Current License: CC BY-SA 2.5
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 6, 2016 at 9:28 | comment | added | deworde | @immibis The principle here seems to be that that "trailing whitespace is non-semantic text", and yes, that's an assumption, but it's a common, and indeed necessary assumption for many CSV parsers. | |
Jan 5, 2016 at 4:19 | comment | added | Criticizing Israel not allowed | "When parsing a comma separated list, whether or not there's a space before/after the comma doesn't change the semantic meaning." - yes it does! If there's a space before a comma, that means there's a space at the end of the previous value! Silently trimming that space is the kind of problem this question is about. | |
Apr 6, 2012 at 2:06 | comment | added | Erik Reppen | @keppla, that should be failing in moz and Chrome. As a primarily JS dev, it pisses me off that it doesn't (it used to in Moz at least). It makes debug harder, not easier. IE is doing what it's supposed to do. Fail @ bad code. HTML is one thing. We don't need this crap in a scripting language. It's an example of awful application of the Robust principle, which is something browser vendors excel at. | |
Nov 15, 2011 at 12:11 | vote | accept | Matthieu M. | ||
Jul 22, 2011 at 13:07 | comment | added | David Ly | @keppla I agree completely. If different browser implement it differently it becomes ambiguous via implementation. I was speaking more from a design perspective rather than implementation. On the other hand though developers should program to the spec when at all possible. For instance there are types of collections where order isn't guaranteed but it may follow a specific ordering based on an implementation detail that isn't part of the spec. | |
Jul 22, 2011 at 11:59 | comment | added | keppla | @Davy8: Trailing comma seem to be illegal (stackoverflow.com/questions/5139205/…). I dont want to rely on this, my point is, when enough people accept the input, it becomes de-facto standard (because one does not notice that it is an error), which leads to something we encountered in HTML: that the errors become so commonplace that you cannot ignore them as bad input anymore. | |
Jul 22, 2011 at 11:45 | comment | added | David Ly | @keppla that's an issues with implementation rather than design. I'm not sure if that's legal by the javascript spec and IE isn't following, or if that's a "nice feature" that FF and Chrome added, but in Python it's specified to be valid and implemented as such. If it's specified as valid and it doesn't work, then it's a faulty implementation. If it's not specified then it shouldn't really be relied upon (although as a matter of practicality if it doesn't work in a major browser it might as well be considered not in the spec if you don't control the user) | |
Jul 22, 2011 at 8:27 | comment | added | keppla |
Even the comma separated list causes problems, kind of: chrome's and firefox's javascript engine seem to accept {"key": "value",} as valid, IE does not. I often stumbled upon this particular problem until i improved my build process with JSlint.
|
|
Oct 16, 2010 at 18:04 | comment | added | Matthieu M. | I agree, robustness when it doesn't cost much is worthwile. | |
Oct 16, 2010 at 16:25 | history | answered | David Ly | CC BY-SA 2.5 |