> If an object is just there to store data and no behaviour, then that's fine - don't add behaviour if it doesn't need it. In that case, you want values rather than objects. Alas, Python doesn't have compound values.
Please stop it. Every single time anything so much as slightly related comes up, you talk about compound object. Incessantly. And then you act superior when nobody knows what you mean, or cares about compound values. They're not really relevant to this discussion anyways, as storing data as desribed in GPP is perfectly reasonable. The worst part is, your definition of "value" and "object" in this context is so far ou…
Arguments against JSON-driven development
271–280 of 306 posts
Re: Arguments against JSON-driven development
#272> If an object is just there to store data and no behaviour, then that's fine - don't add behaviour if it doesn't need it. In that case, you want values rather than objects. Alas, Python doesn't have compound values.
I'm not sure what the dynamic is behind this weird flamewar, but it's definitely not the sort of discussion we want on HN, and your comments seem, presumably unintentionally, to have trolling effects. Please don't. We detached this subthread from https://news.ycombinator.com/item?id=12358875 and marked it off-topic.
I have no idea why stating facts would constitute “trolling”. But, anyway.
Re: Arguments against JSON-driven development
#273Earlier quoted context omitted.
Is there some kind of reference that explains the terminology and theory you're using? Because it makes no sense to me as you're explaining it. It would be nice if such a reference also gave some real world examples where the terminology and theory you're using actually pays dividends, as I asked before.
> Is there some kind of reference that explains the terminology and theory you're using? On values: (0) “In call by value, the argument expression is evaluated, and the resulting value is bound to the corresponding variable in the function” ( https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_va... ) (1) “Most languages use a call by value [evaluation] strategy, in which only outermost redexes are reduced and…
Re: Arguments against JSON-driven development
#274Earlier quoted context omitted.
>There's only one: Two entities are equal if nothing can distinguish them. This is the “identity of indiscernibles”. This doesn't exist. If you can distinguish past and present, you can distinguish anything by time. An object in one moment is not identical to an object in another moment because the moment changed? No. You have to decide on what invariants you care about to have a consistent notion of identity. Yours…
> If you can distinguish past and present, you can distinguish anything by time. That's the thing: Objects exist in time. Values don't. Values exist in the language's semantics, which is a timeless mathematical object. Does it make sense to ask when the number 2 suddenly came into existence? > An object in one moment is not identical to an object in another moment because the moment changed? No. You have to decide on…
Re: Arguments against JSON-driven development
#275> The fundamental advice on Unicode is decode and encode on system boundaries. That is, you should never be working on non-unicode strings within your business logic. The same should apply to JSON. Decode it into business logic objects on entry into system, rejecting invalid data. Instead of relying on key errors and membership lookups, leave the orthogonal business of type validity to object instantiation. This righ…
Re: Arguments against JSON-driven development
#276Earlier quoted context omitted.
> I'm deliberately provoking it. I'll just start flagging you for trolling then. It's one thing to attempt to have a meaningful discussion and unintentionally provoke ire. Meaningfully doing it by being obtuse and smug... I guess qwerty was spot on with the Randall Monroe quote.
> Meaningfully doing it by being obtuse and smug... I don't think I was being obtuse. I just expected (in the statistical sense of the term “expectation”) the reaction I got, and decided that it don't mind it.
If you're going to argue here about programming languages terminology it behooves you get terminology from other fields correct.
Re: Arguments against JSON-driven development
#277I'm not entirely in agreement. Use of object-oriented programming paradigms here would merely distribute the logic that is necessary to achieve the desired mapping over multiple points in the code. The example function presented is only marginally too complicated. I'd split it in two: one to obtain the book list given the same arguments as the example function, and one taking the result as its only argument to build…
Re: Arguments against JSON-driven development
#278I disagree with the anemic object argument. If an object is just there to store data and no behaviour, then that's fine - don't add behaviour if it doesn't need it. A large portion of back-end services are CRUD and data wrangling operations anyway - as in, convert data format A to data format B (which I guess could be a constructor or factory method if you're comfortable with having the conversion logic in a data cla…
Re: Arguments against JSON-driven development
#279The main reason this happens in Python is that creating actual datatypes is incredibly clunky (by Python standards) because of the tedious "def __init__(self, x): self.x = x". The solution here is to have a very lightweight syntax for more specific types, e.g. Scala's "case class". I'd also argue for using thrift, protobuf or even WS-* to put a little more strong typing into what goes over the network. Such schemata…
Re: Arguments against JSON-driven development
#280Earlier quoted context omitted.
From the official source: "Democratic People's Republic of Korea" http://www.korea-dpr.com/ It's democratic, and for the people. It says nothing about being a totalitarian dictatorship. Not everything is/does what it says on the tin. You don't have to agree with official or otherwise authoritative sources without question. (not that I wish in any way to compare Mr Crockford or whoever runs json.org with DPRK or its l…
I hope you feel clever, because in context, this is far too inapplicable to the discussed reality of JSON to be an actual point.
I generally do, thanks, though I'm not any sort of genius by any measure.
> because in context, this is far too inapplicable to the discussed reality of JSON to be an actual point.
You seem to be missing a bit of an intentional context switch. The comment was more about the logic of the GP's response to " isn't really X" which was "yes is X, it says so on 's home page", than it was about or X in particular.
So it was relevant in the context of the discussion and the facts being used for reference but not, as you call out, in the context of the subject of the discussion (hence my somewhat defensive clarification of intent in the last sentence)