3 ms·
Sharing code between frontend and backend isn't a bad idea, yes. However, using Json for it is. And the problems and limitations with json can't be "fixed" in a
by valenterry 5y ago
Sharing code between frontend and backend isn't a bad idea, yes. However, using Json for it is. And the problems and limitations with json can't be "fixed" in any way.
- dragonwriter 5y ago> Sharing code between frontend and backend isn't a bad idea, yes. However, using Json for it is. I don't see why serializing close to JSON is any worse than doin so to, say, S-expressions, or Algol-style syntax, or WASM. If you aren't manually coding it, but generating it, the capabilities matter, the syntax matters a lot less.
- valenterry 5y agoI think there are very good reasons why languages have their own custom formats and none of them ever decided to serialize into json, even when just "generating it".
- gnulinux 5y agoNo I don't think there is a good reason. You're completely missing that programming language syntax is designed for humans. You can still serialize all languages to json syntax trees, just like you can do so with lisp notation, Polish notation etc.
- valenterry 5y agoI'm not saying that you _cannot_ do it. But tell me: why has no programming-language done that? They all could have chosen to serialize their code or AST into json but they didn't. (except JsonLogic I guess)
- andyana 5y agoBecause someone didn't have the time to do it? Or they didn't think of it? Just because nobody has had success at an idea, doesnt mean that the idea can't work. Or do you think we are at our peak?
- valenterry 5y agoI mean, you are not wrong. But I think the chance for all these people just missing out or not having the idea seems quite low to me.
- gnulinux 5y ago> all these people just missing out or not having the idea seems quite low to me. You mean like every single idea/project/etc that ever existed before their invention?
- andyana 5y agoUnfortunately, it has taken me 40 years to learn that most people have no clue about innovation. I mean, imagine believing there are no good ideas left, all the good songs have been written. From now on, when someone tells me something is a bad idea, I'll take it mean that I should examine it further.
- gnulinux 5y agoPeople did do it (JsonLogic by your own admission) and similar things (every single Lisp based language every) so if your only argument is "people didn't do it before, therefore it cannot be a good idea" it doesn't work.
- dragonwriter 5y ago> I think there are very good reasons But what reasons and are they relevant to this use? For instance, I can think of one really good reason (actually several different ones justifying different formats getting used depending on the actual use case, but they can all be summarized the same way when it comes to not using JSON): Shipping an AST between endpoints one of which is a web page and therefore has JSON as its best supported generic object serialization format isn’t the use case.