2 ms·
«Surely this is the worst-of-the-worst kind of non-DRY code you can write, where you have to have two identical implementations in two different languages, but
by WorldMaker 10y ago
«Surely this is the worst-of-the-worst kind of non-DRY code you can write, where you have to have two identical implementations in two different languages, but they also have to have other responsibilities? Even if you did write tests for both, you would have to make sure that the tests were testing the same things.»
It's always been somewhat common in client-server programming since the dawn of time. Even sometimes in the same language on both sides like many classic C/C++ game models where the client and server are intentionally kept at a remove and use different codebases. In the classic game architecture paradigm, the client can't be trusted, but you also want to make sure that the client responds as quickly as possible.
It's interesting to see some of those game architecture approaches returning to web development: things like "optimistic updates" in the Redux world are a very similar pattern to classic game state client/server management. Client reducers act as if the server-side action was carried out in advance of server response and server response corrects only if necessary.
I don't think I can comment that deeply on the rest of your post, but maybe the above digression helps a bit?