8 ms·
Headline makes it sound like there is a bug with Twitter. In reality they are doing something totally legal, if a little gross to look at IMO (C / C++ embedded
by tseabrooks 14y ago
Headline makes it sound like there is a bug with Twitter. In reality they are doing something totally legal, if a little gross to look at IMO (C / C++ embedded coder by training).
The actual bug appears to be not a bug so much as a limitation in the Opera parser with regards to how many comma delineated calls it can handle at a single time. Somewhere around comma 1019 things get messy.
- deleted 14y ago[deleted]
- ajross 14y agoRight. "70's-style static limitation in Opera parser crashes Twitter" would be more like it. Seriously guys? You don't get to do dumb things just because you don't think syntax will be used....
- mibbitier 14y agoDo you think a js parser should also cope with a 10GB source file with nesting a million levels deep? I think it's pretty sane to suggest that a single statement won't be 4MB in length.
- ajross 14y agoIf I have a machine with many gigabytes of memory and ~100MB of stack space available (the latter requires some tuning at thread-creation time with current runtimes, but the former is frankly routine)? Yes. Yes, I'd expect my software to handle it correctly. The fact that you think otherwise is precisely the problem. If you don't want to write correct software (which, frankly, isn't any harder than writing broken parsers) you might want to reconsider your career choice.
- akkartik 14y agoEasy, tiger. Be nice. It's a plausible line of reasoning; getting personal interferes with the education process. You can't persuade if you alienate.
- ajross 14y agoFair enough. I was terribly impolite. Though to be fair, sticks (via public shaming, in this case I guess) work as well as carrots often. The "coming to the defense of clearly broken software" thing (which happens far, far too much) is a pet peeve. People who make arguments like that are generally the ones who write code like Opera's parser.
- akkartik 14y agoYeah, 99% of everything is crap. Large companies aren't immune to that. If anything, the opposite. <shrug> whatchagonnado? :) Public shaming works to stamp out activities that the shamee knows to be bad/anti-social. I think the case here is well-intentioned.
- jessedhillon 14y agoPublic shaming also only works if the shamer knows they are right. I love giving a shaming as much as anyone else (maybe more?), but it's not a posture that's compatible with learning. It requires becoming entrenched.
- xentronium 14y agoWhen you are not right, attempts at public shaming look fairly stupid.
- mibbitier 14y agoOK, Lets see. Do you think you should be able to create a billion files on a default ext3 file system without issues? Because you won't be able to, even if you have the space for them. Unfortunately, sometimes you have to put in some sane limits, because of constraints elsewhere. To call software that has sane limits to cover 99.9% of usage patterns "broken" is pretty silly. If you think as a software developer, you never have to make compromises, or make a tough call on what 99.9% of users will do, you're being naive.
- samspot 14y agoYup, there will always be bugs, many of them not important enough to ever fix.
- tomjen3 14y agoYes, I think it should. For a very simpel reason -- you are not implementing a new language, but writing a parser/evaluator for an already existing one. And you shouldn't change the language (as much as all of us have a beef with Javascript).
- colanderman 14y agoThe headline used to mention Opera. Then an overzealous mod edited it to match the page title, which leaves out the context that this is an Opera-specific blog.
- tseabrooks 14y agoI agree, over zealous mods are really having a negative effect on this site lately with submission renaming. In this case both the current title and the original title (if memory serves) give the impression that twitter is somehow at fault.
- Yver 14y ago"give the impression that twitter is somehow at fault"... which it is. This is definitely partly Twitter's fault for craming all of their code as one humongous instruction (comma) rather than multiple lines (semi-colon.) It's also obviously partly Opera's, for not handling terrible code such as Twitter's as well as they should have.
- tseabrooks 14y agoI'm not sure I agree... "Terrible code" is this sort've nebulous subjective thing. Clearly, to you and I, this is terrible code, though probably created by a minifier / compiler. Lots of code can be terrible (We've all written some in our time). However, if terrible code is valid it's the interpreter's (in this case) problem to figure it out. The ECMAScript spec is nightmarish but we get the spec we deserve :). Twitter has ZERO fault here. They wrote terrible valid code and the parser / interpreter should be spec conformant no matter the pain.
- MatthewPhillips 14y agoI would say that not accounting for a browser bug is definitely their fault. Remember that they have a responsibility to their users to make their site work by accounting for bugs. Designers spend a lot of times meticulously working on CSS to account for all of the various browser rendering quirks. Developers need to put the same care into their JavaScript. Perhaps Twitter has chosen not to support Opera which is fine by me (even though I'm a user), but I think more than likely this was a slip-up in their QA process.