119 points · by type0 · 10y ago · 27 comments
Some on this thread are acting like these are trivial problems to avoid. I think they are wrong...
Basic software quality assurance is missing from the majority of web development businesses.
If I would blow up my code at least tenfold if I tried to take care of all the possible conditions - creating a lot more of them in the process. Writing code feels amazingly fragile to me, and yet it works well. Note that that code has had several reviews from other developers, so I'm not talking about really bad code.
After having delved deep into medical topics out of curiosity - hundreds of hours of anatomy, physiology, neuroscience, bio-chemistry, lots of statistics, I'm even less concerned. The ways things go wrong in a biological system are orders of magnitude more numerous, and the approach of nature is "fix it when it happens" (or start by creating a new instance).
I think the more complex our own human-made systems become we'll have to use more and more of the nature method. We are already doing it everywhere, electronics or software.
I see two competing forces:
a) The human attempt to make systems more "provable", for example by formalization/"mathematization",
b) Nature showing us that complex systems can only be done with a relaxed and laissez-faire attitude ("shit happens") after putting in a reasonable effort.
The balance shifts towards b) for systems in rapidly changing environments, and to a) for systems in static conditions.
So discussions about the subject should never be just about the system (piece of software) itself, it must include the environment it is to operate in.
Good news is that their people are smart. Makes up for it a bit. Inexperience will still bite them, though.
Don't be ignorant.
This only applies to coupon redemption
For the record I agree with you. I think when someone says something that is silly, naive, or somehow just wrong in a forum like this... it seems like it would be far more productive to both participants and observers to have someone just point out what's wrong (yes, that takes time, but you cared enough to down vote, right?) Some part of the time you'll just uncover a misunderstanding or actually find out the person that would otherwise be down voted may have had a point.
Oh well... back to work.
I struggle to understand how that could even have happened. Were they storing the results of the DB lookup referenced against my IP somehow?
A common occurrence of this I've seen in many places (including some of our old code years ago) is using a cookie to store simple client-side choices that you want to persist between requests, for instance the tab that was selected when you were last on a complex page, or some other temporary preference, or as in your example breadcrumbs for navigation.
This falls over as soon as the user has two tabs/windows open because (unless the window is explicitly opened with a different session i.e. in private mode, with File/NewSession in IE, or such) the cookies (even temporary session level ones) are a shared resource. It isn't a big issue usually as more often than not it only concerns superficial UI matters (those that are "nice to have"s rather than breaking something essential), but I can imagine circumstances where the problem could open more serious problems.
Caching in particular seems to be something that's applied without much analysis, I've seen it slow down implementations more often than it sped them up.
What I'd really like is for the browser to send a tab id on every request, so we can scope variable to a tab as well as user.
* it is persistent across refreshes
* it remains even if you leave page to another domain then return to page on same tab
* it disappears if the tab is closed
* it doesn't change as you navigate back/forward
* would be most useful with xhr requests or a hidden field in form post requests.
Downsides:
* no origin security
* no obvious nice way to use with page GETs for server to know which tab a page request is from.
https://developer.mozilla.org/en/docs/Web/API/Window/session...
localStorage is often used for it's persistance across closing/reopening the browser, but for times when you don't want storage to bleed across tabs or closing the browser then session storage is much better, and unlike a cookie doesn't automatically get attached to request so there aren't XSRF worries.
(You still need to be careful of XSS of course.)