Douglas Crockford- JavaScript Object Notation (JSON)
دوره: Python Data Structures / فصل: Chapter Ten- Tuples / درس 5سرفصل های مهم
Douglas Crockford- JavaScript Object Notation (JSON)
توضیح مختصر
And if you look at other data representations like the property lists that were used at, at NeXT and then later at Apple, except for a couple of cosmetic changes, it's the JSON notation as well. And we'd developed a platform for doing applications which could be delivered through unmodified web browsers, what today is called AJAX. But we produced some brilliant demonstrations and we were starting to make some progress in trying to convince, you know, potential customers that they should adopt the style of application and development.
- زمان مطالعه 0 دقیقه
- سطح خیلی سخت
دانلود اپلیکیشن «زوم»
فایل ویدیویی
برای دسترسی به این محتوا بایستی اپلیکیشن زبانشناس را نصب کنید.
ترجمهی درس
متن انگلیسی درس
So JSON is the world’s best-loved data interchange format. It, I discovered it in 2001. I don’t claim to have invented it, because it already existed in nature. I just saw it and recognized the value of it, gave it a name and a description, and showed its benefits.
But I did not invent it. I don’t claim to be the first person to have discovered it. There were other people who I later found out had come with, along the same idea in 2000.
The earliest instance I found of JavaScript being used as a data interchange format was at Netscape in 1996, so it’s a, an idea that’s been around for a while.
And if you look at other data representations like the property lists that were used at, at NeXT and then later at Apple, except for a couple of cosmetic changes, it’s the JSON notation as well.
So it seems like it’s an inevitable sort of representation for data, at least data that is intended to be consumed by programming languages. And ultimately, that’s all data.
I started with JavaScript. But my first application was facilitating communication between programs written in JavaScript and servers written in Java.
So I recognized that even though it was born out of JavaScript, it could be and should be language independent.
So I simplified it as much as possible, took as much out, tried to make the simplest possible specification for how to structure data and put it on the wire. And that ultimately became called JSON.
In 2001, I was in a company I had started called State Software. And we’d developed a platform for doing applications which could be delivered through unmodified web browsers, what today is called AJAX.
But in 2001 that was kind of a radical idea, and not many people would believe that was even possible or, if it were, that was a good idea.
But we produced some brilliant demonstrations and we were starting to make some progress in trying to convince, you know, potential customers that they should adopt the style of application and development.
And as part of the description, we’d say and then we use this JSON idea for communicating the stuff back and forth.
And they’d say JSON, what’s that? And we’d say it’s this thing we found in JavaScript and it’s really great.
And they’d say oh, we can’t use that, we just committed to XML. So, no we can’t. I’d say, but XML was wrong for all of these reasons, it’s, it’s hugely expensive, it’s much harder to use, and all of that.
Well, we can’t use that thing you did because it’s not a standard. I said, it is a standard, it’s a proper subset of ECMA-262, which is a standard.
They said no, that’s not a standard. So I decided if I want to be able to use this thing, I need to make it a standard.
So I bought json.org, and put up a web page, and sort of declared it’s a standard. That’s it, that’s all I did. I didn’t go around trying to convince industry and government and, and everybody that this is what they should do. I just put up a website.
Basically, a one-page website. And over the years, people discovered it and realized, oh yeah, this is so much easier. I’m just going to do that.
The thing I never understood about XML for data interchange, ok, so basic, generally the pattern is, you’ve got a query. You send it to the server. It gives it to the database.
And you get back this XML thing. Then you have to send queries to that in order to get the data out of it.
And I said, why can’t you just give it to me in a form where I know what it is and I can use it immediately, and so that was the main benefit of JSON, I think. It wasn’t that curly braces are so much better than angle brackets. I mean, ultimately none of that matters.
The thing that mattered was that the data structures that JSON likes to represent are exactly the same data structures that programming languages represent.
You know, when AJAX was formulated, the X in AJAX was supposed to be for XML. And the smart kids right away realized, oh this is too hard. We, we don’t want to be doing XML here.
And some of them discovered, hey, you can use JSON here instead and it’s so much easier. So much faster.
So they started doing that. And for a while there was a debate, you know, where some people were arguing Jesse James Garrett said the X stands for XML, so you can’t use anything but XML.
That didn’t last very long. There were a number of other alternatives to XML that were being considered around those times, but JSON was the only one that was designed specifically for AJAX.
The, probably the boldest design decision I made in designing JSON was not to put a version number on it, so there is no mechanism for revising it. So, JSON, we’re stuck with it. Whatever it is in its current form, that’s it.
And that turns out to be its best feature. And because it wants to be a low-level thing and it’s, it’s basic infrastructure and it’s the thing that you pile everything else on.
You know, it’s sort of the equivalent of alphabet in a language. I mean, we might make up lots of words and lots of ways of having sentences, but it’s very uncommon to make up new letters.
And that’s sort of the place where JSON lives. So it’s good that it’s not going to change. I, I expect maybe someday we’ll find that there are really important things that JSON doesn’t do, like cyclical structures. Graphs are not easily represented in JSON.
They can be, but it requires a level of indirection, a little bit more work. Some day we might decide we don’t want to do that work and then we replace JSON with something else.
We will not extend JSON to do that, we’ll replace JSON. And even after we do that replacement, everything that was ever developed that still uses JSON will still work, because JSON will never change.
مشارکت کنندگان در این صفحه
تا کنون فردی در بازسازی این صفحه مشارکت نداشته است.
🖊 شما نیز میتوانید برای مشارکت در ترجمهی این صفحه یا اصلاح متن انگلیسی، به این لینک مراجعه بفرمایید.