4 ms·
15 or so years ago, my manager at WalMart Stores Information Systems Division was previously a programmer on one of the many finance related teams. Specificall
by Diederich 7y ago
15 or so years ago, my manager at WalMart Stores Information Systems Division was previously a programmer on one of the many finance related teams. Specifically, she worked with gift cards, and one time I asked her how different state laws affected how much money WalMart could recover from those cards. She was delighted to elaborate!
I don't recall the particulars of the answer, but it was eye-opening. She said that they had a team of lawyers whose job was to (try to) keep track of all of the laws, all over the world, that had any bearing on this topic. Not only was it state and federal law, but also county and even city law. (And territories...and military bases....etc.) There were some stipulations about where the card was bought AND where the card was used, if in different jurisdictions. Many of the laws were contradictory. In some cases, none of the money could be reclaimed, and would revert to different local funds. There were effectively endless permutations.
She and her team had to decide what of all of this they would model with code. They could not model all of it, so there was a hybrid of some actions being taken with the code, and the code outputting reports that humans would use to make decisions about actions.
It was eye opening to consider how legally complex many such 'simple' things, like gift cards, are when implemented on a wide scale.
- ryanianian 7y agoAnything anything involving money is complicated to a fractal degree. I worked on a system to populate data into an large (well-known international) retail site's order database. Representing the simplest possible concept of "this order had no sales tax" took 18 rows across 4 tables. The complexity was due to similar things you point out - the system had to support combinatorically large numbers of cases and even the concept of "nothing" had to be encoded in dozens of different ways.
- modo_ 7y agoI'm curious if a rules engine [1] could be used instead of implementing the logic in code for something this complicated? Could fuzzy logic be used to build a case when the laws become contradictory? Maybe after the case is built it could be passed on to legal counsel for approval. [1]: https://en.wikipedia.org/wiki/Business_rules_engine https://en.wikipedia.org/wiki/Business_rules_engine
- ignoramous 7y agoI'm wondering if constraint programming is better suited to such cases? https://en.wikipedia.org/wiki/Constraint_programming https://en.wikipedia.org/wiki/Constraint_programming
- segmondy 7y agoNah, logic programming and expert systems.
- kjeetgill 7y agoHaving worked with these sorts of tech/libraries before... they do little or nothing to solve the hard parts of this kinda problem, like: a) actually obtaining the requisite knowledge of all the jurisdictions involved, b) encoding the relevant knowledge to make it useable in a rules engine, and c) understanding and verifying the intent and interactions of all the rules as expected. In practice, rules engines are almost never more useful than just coding things up normally in the language of your choice when encoding/building the logic for your product. You just have a few business rules that change within your company via conversations, projects, and people involved. What they're actually useful for is when your product let's your product's users build up logic in some way that you need encoded and executable. In this case the rules are data from your customer. Think a state machine for a Jira ticket/help desk work flow that your customers define, or some workday process that walks your customer's users through new hire onboarding.
- dragonwriter 7y ago> I'm curious if a rules engine [1] could be used instead of implementing the logic in code for something this complicated? Rules engine rules are code; just code in a language that is usually very simple but also (because it's not used anywhere else) completely obscure. > Could fuzzy logic be used to build a case when the laws become contradictory? Didn't the Bayesians kill fuzzy logic?
- whatshisface 7y agoBayesian statistics quantifies fuzzy knowledge of absolute statements, fuzzy logic quantifies absolute knowledge of fuzzy statements.
- zt 7y agoAh yes, the subtle distinctions between escheatment and breakage, my two old friends. A nice Google search proves why this can be so complicated: it's actually very important and the best blog post about it is this one https://blog.agilenceinc.com/making-sense-of-unused-gift-card-data https://blog.agilenceinc.com/making-sense-of-unused-gift-car... (it's not very good)
- mbesto 7y ago> It was eye opening to consider how legally complex many such 'simple' things, like gift cards, are when implemented on a wide scale. To the armchair HN community who ask "why does it take 1k engineers to run <insert random silicon valley app that operates at global scale>". Here is your answer. Note - to be fair, yes many of these team are indeed bloated and work on projects that are a result of NIH syndrome, where "buy vs build" decisions just automatically default to "build". Ask anyone at Amazon if they enjoy working with the code on their custom internal ERP system and you'll know what I'm talking about.
- jimmaswell 7y agoSo bloated sets of laws necessitate bloated teams.
- jasim 7y agoMore generally, reality just gets more nuanced as things go broader or deeper in scope. Toy projects are clean, uncluttered; production code needs error handling, logging, monitoring, scaling, and much more.
- ghaff 7y agoAnd, even more generally, it needs to be promoted and sold, money collected, customers supported, taxes paid, partners engaged with, events attended, people hired, people managed, their expenses reimbursed...
- akhilcacharya 7y ago> Ask anyone at Amazon if they enjoy working with the code on their custom internal ERP system and you'll know what I'm talking about. Can you elaborate?
- hef19898 7y agoNot from the tech teams, but I used to be on one of their ops teams working with ERP system. Having quite some experience with SAP before and since I came to the following conclusion: - Amazon's ERP is way better suited for e-commerce ops than SAP - SAP is much better as an overall ERP system when it comes to include non-ops / warehouse management functions - Amazon's ERP system became hard to adopt and change, meaning it kind of lost the general advantage of a custom system to compared to an off the shelf one - One of the biggest advantages of Amazon's ERP was the full integration of the webshop front end - One of the biggest mistakes Amazon made was to not develop their ERP-webshop systems into a stand-alone product (imagine Shopify with a arguably very good e-commerce ERP system) Let me elaborate on the last point. The big strength of commercial ERP systems is that they are to large part a readily available collection of best practices from countless companies. By keeping it all in-house Amazon lost that opportunity to learn. IMHO it is not the system that gives Amazon the edge but the way it is used, so incorporating eyternal best practices coupd only help. Also, from the commercial side, it is one gigantic missed opportunity. Imagine a SaaS version of Amazon's ERP running all the shops currently using stuff like Shopifyone that is used by countless small stores as a point of sale software with integrated inventory ans warehouse management functions. That would allow Amazon to create a global, decentralized ERP environment fully integrated into any existing or future fulfillment solutions Amazon has. The upside for Amazon and users of such a system are basically endless.
- AndrewKemendo 7y agoThis is exactly how I answer the folks from the crypto community that make a serious run at the argument that crypto could be a feasible alternative currency. Things like gift cards are, for all intents and purposes currencies, minted by non-governmental organizations with dollar-parity and limited transferability - and even with those constraints it's incredibly difficult to actually play nicely with Federal/State/Local laws. If there's one thing governments have ZERO tolerance on it's messing with currencies/money.