JSON, not Jason - Computerphile

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 มิ.ย. 2024
  • Understanding one of the most commonly used methods of transferring data from one machine to another.
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

ความคิดเห็น • 447

  • @chrzan9608
    @chrzan9608 5 ปีที่แล้ว +303

    I think that it is also worth mentioning that JSON is easily read by humans, which is something that isn't mentioned and this fact is a very important aspect of its popularity.

    • @likwidmocean
      @likwidmocean 5 ปีที่แล้ว +7

      It's gotta be, since you're not able to comment.
      As usual it's, Horses for courses. It's great to have a small, unstructured, and browser friendly option like JSON, but when the use case shifts to the composition of large complex documents from multiple sources, and metadata collection, XML is worth it's bulk.

    • @chrzan9608
      @chrzan9608 5 ปีที่แล้ว +6

      @@likwidmocean Oh for sure, its the same as using dynamic types vs static types in a language for a corporate project level. The former is nice, but quickly looses its value when you deal with thousands of lines of code.

    • @crooked8168
      @crooked8168 4 หลายเดือนก่อน

      And it's also slow ; but yes, you're comment is 100% correct

  • @SergeMatveenko
    @SergeMatveenko 5 ปีที่แล้ว +664

    JSON is not just ASCII. It accepts the entire UTF-8 encoding and requires it from decoders in its spec.

    • @JochemKuijpers
      @JochemKuijpers 5 ปีที่แล้ว +71

      Strictly speaking JSON can be parsed as ASCII since all syntax characters are ASCII. String parsing can be done separately; the string itself is UTF-8 encoded, but escape sequences have to be handled first, and the unicode escape sequences are actually UTF-16 encoded. So it's kind-of a messy format in that sense.

    • @SergeMatveenko
      @SergeMatveenko 5 ปีที่แล้ว +9

      @@JochemKuijpers yeah, if you even skip parsing keys which could contain any utf-8 character as well then it could be parsed as ascii. But what is the point if you cannot parse the data?:)

    • @keksmlg
      @keksmlg 5 ปีที่แล้ว +30

      They just said ASCII instead of plaintext, boohoo. Don't waggle your exotic encoding knalij on our faces, you and the people that liked this :')

    • @MladenMijatov
      @MladenMijatov 5 ปีที่แล้ว +43

      He frequently gives wrong information so that's to be expected. I wouldn't want him as my professor. He spends most of the time talking about irrelevant things and drawing poor explanations. If you showed 5:07 to anyone and ask them what is written there, you'd be happy to get confused look. In short this video could have been simpler, shorter and better explained.

    • @user-qf6yt3id3w
      @user-qf6yt3id3w 5 ปีที่แล้ว +12

      @@MladenMijatov Whoosh!
      The sound a swinging pedant makes.

  • @MrLissu95
    @MrLissu95 5 ปีที่แล้ว +216

    From the title, I thought this video would consist of pronunciation advice

    • @victoranem
      @victoranem 5 ปีที่แล้ว +5

      me too

    • @andylib
      @andylib 5 ปีที่แล้ว +2

      Yup same

    • @taureon_
      @taureon_ 5 ปีที่แล้ว +1

      WaysToSaySame.json

    • @BarthiArgento
      @BarthiArgento ปีที่แล้ว

      😂

  • @Cur8or88
    @Cur8or88 5 ปีที่แล้ว +266

    What's the joke about XML? It's a format that can't be read by people or machines.

    • @KuraIthys
      @KuraIthys 5 ปีที่แล้ว +25

      And yet XML is a 'simplified' form of SGML created precisely because SGML had exactly that problem.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว +26

      At least XML allows comments.

    • @Diggnuts
      @Diggnuts 5 ปีที่แล้ว +2

      As a way to define a data struct, I find XML pretty solid. But as a format to interface with, indeed it is terrible.. therefor XML2JSON !

    • @psylock524
      @psylock524 5 ปีที่แล้ว

      @@lawrencedoliveiro9104 .jsonc for that, or YAML

    • @beskamir5977
      @beskamir5977 5 ปีที่แล้ว

      @@lawrencedoliveiro9104 Yea... the lack of comments in json kind of ruined it for me so I prefer to use ini files since usually that's all I need.

  • @Shadow81989
    @Shadow81989 5 ปีที่แล้ว +24

    "Children tend to be an ordered collection" is probably my favourite sentence. :-)

  • @alephii
    @alephii 5 ปีที่แล้ว +247

    The video really ends at 0:25

    • @Nick-kb2jc
      @Nick-kb2jc 5 ปีที่แล้ว +3

      😂😂😂

    • @abhishekshah11
      @abhishekshah11 5 ปีที่แล้ว

      I felt the same

    • @sammbci
      @sammbci 5 ปีที่แล้ว +23

      I only clicked because the title made it sound like he was gonna insist it's pronounced J S O N

    • @joeytje50
      @joeytje50 5 ปีที่แล้ว

      @@sammbci me too, so I feel kind of ripped off for my time...

  • @harisiqbalralph
    @harisiqbalralph 5 ปีที่แล้ว +138

    "Your children are a list of strings"
    Personally, I would prefer them to be pointers.

    • @Jet-Pack
      @Jet-Pack 5 ปีที่แล้ว +9

      NULL pointers as long as they are not born?

    • @CTde110
      @CTde110 5 ปีที่แล้ว +2

      Or children pointers? lol

    • @the-mush
      @the-mush 5 ปีที่แล้ว +9

      actually, only your dog could be a pointer

    • @KuraIthys
      @KuraIthys 5 ปีที่แล้ว +7

      @@Jet-Pack wouldn't that mean knowing in advance how many children you'll have in future?

    • @PhoenixD
      @PhoenixD 5 ปีที่แล้ว +3

      @@KuraIthys i'd go with a linked list of structs, with one element being a pointer to a string. You can even allocate that without wasting memory since you should decide their name before they are actually born!
      Only problem with that is when you free(myself) the reference to them will be lost, but still... That's a problem of whoever will have to upkeep the code :D

  • @iabervon
    @iabervon 5 ปีที่แล้ว +20

    He missed three values: true, false, and null. This is mainly notable because he otherwise covered absolutely everything you can represent in JSON. The nice thing about it is that it can represent enough structures to be useful and can't represent anything strange or subtle, which minimizes the chance that you'll have bugs in parsing.

  • @RobertMilesAI
    @RobertMilesAI 5 ปีที่แล้ว +34

    JSON has exactly two problems:
    1. No support for comments
    2. A comma after the last item in an array or object is a syntax error
    Both of these cause problems when manually editing JSON files, which I know isn't what JSON was designed for, but it would be so easy to fix.
    Maybe I should file an RFC

    • @Okabim
      @Okabim 5 ปีที่แล้ว +3

      Also the ability to disregard the quotation marks in some places like JS allows like {one:"Something"} instead of {"one":"Something"}

    • @MladenMijatov
      @MladenMijatov 5 ปีที่แล้ว

      Hah, I can feel you brother. So many Ansible scripts have caused an invalid configuration files for me just because I forgot that last comma is considered syntax error. Lack of comments is not so much of an issue in communication, but when writing configuration files it is nice to have them. Both are, like you said, easy fixes but they will never happen, too many integrations would need to be updated.

    • @haulin
      @haulin 5 ปีที่แล้ว +3

      There is a newer format called JSON5 that addresses all of those issues. Basically bringing JSON to ECMAScript5+ world. Identifier names without quotes, single quotes around strings, trailing commas, comments, hex numbers, ...

    • @noxabellus
      @noxabellus 5 ปีที่แล้ว

      1. CJSON exists

    • @killymxi
      @killymxi 5 ปีที่แล้ว +1

      Jonathan Crowder one of the issues with "__comment" field is when the system using this JSON document also has the document schema to check it against, and it starts to complain about unknown field...

  • @Qbe_Root
    @Qbe_Root 5 ปีที่แล้ว +166

    2:20 “This value can be any other JavaScript thing” except a Function, a Symbol, a RegExp, a Date, undefined, null (except in arrays), Infinity, NaN…

    • @slash_me
      @slash_me 5 ปีที่แล้ว +75

      null is a always a valid value, not just in arrays

    • @Qbe_Root
      @Qbe_Root 5 ปีที่แล้ว

      @@slash_me oh, my bad

    • @NatoNathan
      @NatoNathan 5 ปีที่แล้ว +4

      I think he meant any JavaScript primitive.

    • @Qbe_Root
      @Qbe_Root 5 ปีที่แล้ว +14

      @@NatoNathan Symbol and Undefined are primitive types, and Infinity and NaN are primitive values, yet none of them exist in JSON

    • @NatoNathan
      @NatoNathan 5 ปีที่แล้ว +2

      my, bad forgot about those.

  • @eschelon9067
    @eschelon9067 5 ปีที่แล้ว +255

    So Jason Derulo's full name is actually Java Script Object Notation Derulo?

    • @MyTokyodrift
      @MyTokyodrift 5 ปีที่แล้ว +10

      Indeed.

    • @JohnnyWednesday
      @JohnnyWednesday 5 ปีที่แล้ว +5

      Terrible jokes like these? are like a warm crackling fire for a geek - never, ever stop.

    • @31redorange08
      @31redorange08 5 ปีที่แล้ว +5

      No, notice the *a* in J*a*son?

    • @hattrickster33
      @hattrickster33 5 ปีที่แล้ว

      Yes.

    • @EdwardForgacs
      @EdwardForgacs 5 ปีที่แล้ว +4

      JSON Derulo

  • @LeonardChurch33
    @LeonardChurch33 5 ปีที่แล้ว +8

    JSON is one of those things in the programming tool box that made me feel really powerful the first time I picked it up. Up to that point I had been taught to either write all my program data out in a csv file, exporting and parsing "by hand" or use the pre-written SQL queries I'd been given to interact with a database. Having the ability to quickly pull data in and out of my program as whole objects without having to worry about how it was being written or whether all the control breaks were happening in the correct order made me feel untouchable.

    • @hattrickster33
      @hattrickster33 5 ปีที่แล้ว +2

      I got the same feels but with integration. Literally getting data that your app can use just like that, directly from Google's servers is a pretty powerful thing. Same goes for integration with Facebook, Twitter, Instagram, etc. I couldn't believe how easy it was the first time. Really makes you appreciate abstraction.

  • @DontTalkShite
    @DontTalkShite 5 ปีที่แล้ว +37

    You should have shown a prettyprint on-screen example. I work with JSON quite a lot and those sketches we're a bit all over the place.

  • @MilanVVVVV
    @MilanVVVVV 5 ปีที่แล้ว +40

    *The numbers, JSON, what do they mean??*

    • @IBAction
      @IBAction 5 ปีที่แล้ว +1

      Number: a signed decimal number that may contain a fractional part and may use exponential E notation, but cannot include non-numbers such as NaN. The format makes no distinction between integer and floating-point.

    • @aleksakocijasevic6613
      @aleksakocijasevic6613 3 ปีที่แล้ว

      Lol

  • @alimahdi6379
    @alimahdi6379 5 ปีที่แล้ว +21

    Now we know the true identity of JSON Bourne.

  • @theepicslayer7sss101
    @theepicslayer7sss101 5 ปีที่แล้ว +9

    you see a lot of JSON files in games nowadays. i guess it is easier to change the settings of things when they are defined clearly in human readable form and do not need compiling to be used.

    • @grn1
      @grn1 2 ปีที่แล้ว +1

      A lot of programs (games or otherwise) will have an INI or CONF file which I prefer for settings. Not sure if JSON has any real advantage over that.

  • @bytefoundry8702
    @bytefoundry8702 5 ปีที่แล้ว +10

    JSON Derulo uses the same notation when composing his songs

  • @nicholasbrownlee4209
    @nicholasbrownlee4209 5 ปีที่แล้ว +51

    So Alice and Bob are, in fact, friends with JSON?

  • @NoamSilvy
    @NoamSilvy 5 ปีที่แล้ว +21

    JSON is a great topic! 👏👏👏There are so many things to talk about around it:
    - jsonb
    - links to other JSON objects (instead of nesting everything in place)
    - JSON Schema
    - JSON API
    - JSON and Web Semantic
    - JSON-LD
    It would be great to beginning a series around this :)

  • @MartilloB
    @MartilloB 5 ปีที่แล้ว +7

    Plz do a video on the limitations of JSON (or other human-readable formats) or JSON vs. XML!

  • @madeso
    @madeso 5 ปีที่แล้ว +7

    Great introduction, but a few errors:
    Javascript and json have as much in common as java and javascript. JSON is inspired by javascript. It doesn't use the same parser. A javascript interpreter probably exposes a json api too, and stores the binary representation in the same way, but they are not the same. If your javascript is using the javascript parser to parse json, you are open to attack.
    In json, the strings are also not required to be unique, so it is not the same as a associative array. Any standard compatible parser however is allowed to place additional requirements, so most implementations ignore this fact.
    Javscript is not lightweight. It is lighter than some other text formats, but heavier than other text formats. It is also a lot heaver than binary formats such IFF/RIFF.

    • @okie9025
      @okie9025 5 ปีที่แล้ว

      Jsonis based on javascript it's literally in the name...

    • @madeso
      @madeso 5 ปีที่แล้ว

      @@okie9025 While it's true that it is based on a small subset of javascript, it is such a small subset and it makes changes to how you can use it, that it's basically inspired by it. In javascript, for example, you can have comments, in json you cannot. In json the string key in a object is not required to be unique, in js/chrome it ignores everything but the last.

    • @okie9025
      @okie9025 5 ปีที่แล้ว

      @@madeso in every way (except properties having to be strings), a json item is the same as a javascript object

    • @madeso
      @madeso 5 ปีที่แล้ว

      @@okie9025 so that's 2 exceptions for the object, no comments=3, json doesn't support functions=4, it's starting to have more things that are not javascript than things that are.

    • @okie9025
      @okie9025 5 ปีที่แล้ว

      @@madeso functions are different for every language and are this compiled in different ways
      also comments are not needed in a storage file, even SQL has very limited support for comments that only work in actual SQL queries

  • @al20ov87
    @al20ov87 5 ปีที่แล้ว +3

    I've used json to represent a graph for a decision tree pretty recently, and I gotta say it works very well for that kind of application

    • @stanisawszostak8065
      @stanisawszostak8065 4 ปีที่แล้ว

      since i'm pretty much a newbie at programming, i'd love to hear from you how exactly you managed to do that, would you mind?

  • @kisame_5331
    @kisame_5331 5 ปีที่แล้ว +65

    JSON at home: Jason

  • @python-programming
    @python-programming 2 ปีที่แล้ว +2

    This is another great Computerphile video! I've got a video series on JSON if anyone wants to learn about using it via Python.

  • @109Rage
    @109Rage 3 ปีที่แล้ว +1

    There are of course other data exchange formats that are agnostic to the application they're used in, and fairly human readable, such as YAML. I think the reason JSON is preferred is because the way it declares data types is more intuitive to programmers, as strings must be declared in quotes, numbers are always bare, arrays are in square brackets, and so on... I've used YAML several times, and while it's nicer to look at for something like a config file, half the time I forget the syntax for everything in it.

  • @sid98geek
    @sid98geek 3 ปีที่แล้ว +4

    5:13 to 5:20: "It is used for transferring data in a way that is pretty much _agnostic_ to the programming language being used."
    That was a beautiful and figurative way to use the word "agnostic"!

  • @snozzmcberry2366
    @snozzmcberry2366 5 ปีที่แล้ว +2

    JSON is delightful to work with. So clean, concise & easily pars..e..able? I love it.

  • @SergeMatveenko
    @SergeMatveenko 5 ปีที่แล้ว +36

    I'd expect to hear the word "serialization" at least once in this video.
    Let's go deeper and speak about BSON, Protobuf, CBOR, and etc then?
    Lightweight is a bold statement without comparison to alternatives. Just compare JSON and CBOR datagram sizes for the same data. You'll notice that CBOR produces much lighter data sizes.

    • @sebastianpopa7943
      @sebastianpopa7943 5 ปีที่แล้ว +11

      Dude chill out.

    • @SergeMatveenko
      @SergeMatveenko 5 ปีที่แล้ว +4

      @@sebastianpopa7943 the thing is that there are a lot of people out there who will watch this and remember it like it was said in the video.

    • @sebastianpopa7943
      @sebastianpopa7943 5 ปีที่แล้ว +6

      @@SergeMatveenko I see your point . But this is barely a preview/presentation to JSON. Computer scientists who'll actually work with JSON will anyway dive deeper for more information and for a non-programmer this is the most "human" way to introduce JSON. So everyone is safe . (sorry for bad english)

    • @DaveSohan
      @DaveSohan 5 ปีที่แล้ว +3

      This is the 'What is JSON?' video for people who don't actually know what JSON is and it's doing a really good job at that.

    • @Vextrove
      @Vextrove 5 ปีที่แล้ว +4

      @@sebastianpopa7943 he's not even angry. Don't tell people to chill out if they're not angry

  • @Jarvo98
    @Jarvo98 5 ปีที่แล้ว

    I haven't realized until now that computerphile's videos start with the xomputerphile tag and ends with the closing tag.

  • @myhumblebeginnings
    @myhumblebeginnings ปีที่แล้ว +1

    I am looking a journal which hosts papers from the early beginning of computer science. Can anyone help me on this matter? Thank you very much in advance.

  • @trucid2
    @trucid2 5 ปีที่แล้ว +41

    Next video: JSON vs XML

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว +3

      The _Alien vs Predator_ of data interchange formats!

    • @iii-ei5cv
      @iii-ei5cv 5 ปีที่แล้ว +2

      @@lawrencedoliveiro9104 more like Avengers vs Justice League

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว

      @@iii-ei5cv Yes, but which John Steed sidekick? Tara King? Emma Peel? Cathy Gale? Or one of the older ones?

    • @hattrickster33
      @hattrickster33 5 ปีที่แล้ว +2

      Different tools for different jobs.

    • @noxabellus
      @noxabellus 5 ปีที่แล้ว

      No contest. XML is complete trash.

  • @RussTrotter
    @RussTrotter 5 ปีที่แล้ว +4

    didn't JSON come about as a response to XML in that you could do "var data = eval(...);" on it and let the JS parser do the work for you? obviously the security implications won the day and JSON.stringify/JSON.parse came about, but I thought it was born out of that ad-hoc convenience.

    • @pfefferle74
      @pfefferle74 5 ปีที่แล้ว +1

      JSON as data exchange method became popular since Javascript had no built-in way to parse XML data and dumping out complex data to the browser as directly parsable JS code was simply the easiest method.
      Programmers also like it for making a clear distinction between numeric values and text strings, which XML doesn't.

    • @MladenMijatov
      @MladenMijatov 5 ปีที่แล้ว

      I don't think so. Its primary purpose is structuring objects, considering JavaScript doesn't have concept of classes. At some point people just started using it for communication since serializing and reverting it back to object is pretty straight forward and it maintains structure you are using in your code anyway.

  • @monumento.f.501
    @monumento.f.501 5 ปีที่แล้ว +2

    solidly equipped with older gear for data recovery, properly placed at the windows.

  • @X_Baron
    @X_Baron 5 ปีที่แล้ว +5

    It's called serialization. A program has some data (or code) in memory but dumping the contents of the memory wouldn't produce a usable format to store the data and then read back. You need some kind of representation for it, that is easy to read and parse. Creating such a format for every use case separately is a waste, so it's often better to use some preexisting serialization library to do it.

  • @Kihidokid
    @Kihidokid 5 ปีที่แล้ว +28

    PRESS "X" TO "JSON"
    JSON
    JSON
    JSON
    JJJJJSOOOOONN

    • @itskdog
      @itskdog 5 ปีที่แล้ว

      Anthony Ingram I get the reference there...

    • @XxJKLTVxX
      @XxJKLTVxX 5 ปีที่แล้ว

      }}}}}]}}}]}}}]}}}}}}]}}]}}}}

    • @iLiokardo
      @iLiokardo 5 ปีที่แล้ว

      The file has been stolen.

  • @freegracetoronto3876
    @freegracetoronto3876 5 ปีที่แล้ว

    do you still use a tractor feed printer, or are you still using out all the tractor feed paper you had left over from 30 years ago?

  • @thomasl863
    @thomasl863 2 ปีที่แล้ว

    I’ve always wondered- what’s the type of paper that he’s writing on? I keep seeing it in Computerphile vids

  • @LivvieLynn
    @LivvieLynn 5 ปีที่แล้ว +50

    I can't imagine anyone watching this channel and wondering what JSON is.

    • @trapper1211
      @trapper1211 5 ปีที่แล้ว +16

      and yet here i am

    • @baltakatei
      @baltakatei 5 ปีที่แล้ว +7

      I just want to know who this JSON is and why he keeps breaking my stuff.

  • @cacheman
    @cacheman 5 ปีที่แล้ว +36

    JSON is almost good. It should have been specified to allow trailing commas though.

    • @hrbattenfeld
      @hrbattenfeld 5 ปีที่แล้ว +1

      The fact that there is a dispute about this is an argument against the entire concept of using anthropocentric data structures to transfer data between machines.

    • @AlaaZorkane
      @AlaaZorkane 5 ปีที่แล้ว +4

      + if you indent with tabs, it doesn't parse

    • @hrbattenfeld
      @hrbattenfeld 5 ปีที่แล้ว +2

      @Ark Osf Absolutely.
      Machines are infinitely better than humans at generating human-parsable code that is also machine-parsable.
      The rubegoldbergian insanity is that in a properly working program, none of this human-parsable code is ever going to be parsed by a human.
      It's a small miracle that cryptographic key exchanges aren't done in Roman numerals.

    • @Yaxqb
      @Yaxqb 5 ปีที่แล้ว +10

      Tbh comments would be great as well

    • @dealloc
      @dealloc 5 ปีที่แล้ว +4

      @@AlaaZorkane Both tabs and spaces are allowed outside of values, but needs to be escaped inside strings as `\t` for tabs and `
      ` for newlines.

  • @muche6321
    @muche6321 5 ปีที่แล้ว

    2:45 Regarding arrays, it is possible to represent arrays as general objects, i.e. ["Alice", "Bob", "Charlie", "Derek", "Esmeralda"] could be represented as {"1": "Alice", "2": "Bob", "3": "Charlie", "4": "Derek", "5": "Esmeralda"}.
    Of course, the disadvantage is, it introduces issues like possibility of noncontinuous indices, 0/1-based indexing mixups, index transformations (string vs. integer) etc. that objects allow, so an object would need to be checked (upon reading the JSON) if it is indeed an array and/or stripping it of non-array features.

    • @dealloc
      @dealloc 5 ปีที่แล้ว

      Those are still separate data types. One is indexed while the other is a hash. They are not equivalent because the index in Arrays are integers, whereas keys in objects are strings. So you'd have to coerce the key before it could be used interchangeably (in JavaScript).
      Even worse for other languages that parses JSON, is that the deserialized data types are different and would need further serialization to become compatible with one another.

  • @scottfranco1962
    @scottfranco1962 5 ปีที่แล้ว

    In this day and age, where the heck did you find tractor fed greenbar????

  • @zenawarrior3012
    @zenawarrior3012 5 ปีที่แล้ว +4

    Love your videos. Can you guys do one on wireshark? Or intrusion detection?

  • @GrandadIsAnOldMan
    @GrandadIsAnOldMan 5 ปีที่แล้ว

    Anybody else get the JSON error message uploading thumbnails to TH-cam with Chrome. Works fine with Edge and Firefox and just another example of TH-cam's impressive enhancements since focusing on the Studio Beta fiasco.

  • @themistoclesnelson2163
    @themistoclesnelson2163 3 ปีที่แล้ว

    Thanks for the video!

  • @TorBruheim
    @TorBruheim 4 ปีที่แล้ว

    Is there any reason why you don't present the name of the guy in this particular video?

  • @tamasdemjen4242
    @tamasdemjen4242 5 ปีที่แล้ว

    One possible solution for representing a graph (or a tree with optional parent references) is using an indexing system, because you cannot reference parent nodes directly. Let's see a UK road map: { "graph": [ { "city":"London", "roadTo":[1,2,3] }, { "city":"Bristol", "roadTo":[0] }, { "city":"Manchester", "roadTo":[1,2] }, { "city":"Nottingham", "roadTo":[4] }, { "city":"Liverpool", "roadTo":[1,3] } ] }; So London(0) has a road to Bristol(1), Manchester(2) and Nottingham(3). To get from London(0) to Liverpool(4), you have to connect in Nottingham(3). graph[0] is the root node of the graph.

  • @morbidmanatee5550
    @morbidmanatee5550 5 ปีที่แล้ว

    XML + XSD + JAX-B = Heaven. I so wish JSON had something similar (JSON schemas and Java API like JAX-B)

  • @alexeimakes
    @alexeimakes 5 ปีที่แล้ว

    awesome video!

  • @sogerc1
    @sogerc1 5 ปีที่แล้ว +8

    No video is good without Alice and Bob!

  • @Keex11
    @Keex11 5 ปีที่แล้ว

    How does it handle data types? Is "value": "42" the string 42 or the number 42?

    • @icedragon769
      @icedragon769 5 ปีที่แล้ว +1

      just like in javascript, quotes mean strings, no quotes means numbers.

  • @prashank
    @prashank 5 ปีที่แล้ว

    what type-c dongle is that

  • @truezulu
    @truezulu 5 ปีที่แล้ว

    How did this have anything to do with JSON?

  • @MagicAndWires
    @MagicAndWires 5 ปีที่แล้ว +3

    Solid end credits joke.

  • @_MagL
    @_MagL 5 ปีที่แล้ว +2

    Since JSON could be used in multiple programming languages, isn't it time JSON gets a new name?

  • @toasty8432
    @toasty8432 5 ปีที่แล้ว +2

    You know you're a fossil when you mention a Sun workstation...

  • @AdamHawkesDeveloper
    @AdamHawkesDeveloper 5 ปีที่แล้ว +21

    Sun workstation? Might as well talk about the Atari ST.

    • @tagno25
      @tagno25 5 ปีที่แล้ว +3

      I have a Sun workstation that I still use, though it is an amd64 based one.

    • @RedwoodRhiadra
      @RedwoodRhiadra 5 ปีที่แล้ว +2

      Considering there *is* at least one functioning Atari ST in that room...

  • @s8w5
    @s8w5 5 ปีที่แล้ว +3

    I really wonder what the name of the 12th child would have been.

    •  5 ปีที่แล้ว

      Lucas?

  • @FuzailShaikh
    @FuzailShaikh 5 ปีที่แล้ว

    Can we have a video about gRPC?

  • @lebigsquare
    @lebigsquare 5 ปีที่แล้ว +2

    Amiga 1000 behind the guy ? 👍

  • @IoDavide1
    @IoDavide1 5 ปีที่แล้ว +1

    Json is usefull as well as a txt delimited file.
    No advantage of any sort to use that instead of a txt delimited or fixed, that's why most standard communication softwares do not use json but delimited text for interface functions.
    The reason is easy to understand, what is difficoult in data communications is not the format of the file containing the data, but the nature of the data transfered.
    So it doesn't matter if the data is transfered with plain text, json or xml, it is a question of what data is contained in the file.

  • @karolszymanowski518
    @karolszymanowski518 5 ปีที่แล้ว +3

    How do you guys pronounce "json": json or json?

  • @LordOfNihil
    @LordOfNihil 5 ปีที่แล้ว

    i usually just write my own damn parser and call it a day. so long as you include the same header at both ends it works.

  • @TheAstronomyDude
    @TheAstronomyDude 5 ปีที่แล้ว

    How do you read an element in JSON? Say I want to know the name of Alice's third Kid. How would I find him if there are no indices?

    • @sensiblewheels
      @sensiblewheels 5 ปีที่แล้ว

      For any such indexing requirements, JSON on its own won't suffice. It's only a way to describe relationships and what not. You will need a NoSQL engine working on top of this data , which then creates index's and what not.

    • @okie9025
      @okie9025 5 ปีที่แล้ว

      You can JSON.parse() and then index it like a normal JS object

    • @Diggnuts
      @Diggnuts 5 ปีที่แล้ว

      Depends on what you mean by "third". The 3rd that exists in the data? the third that was born? The 3rd best liked?
      You can easily traverse a tree, directly look up the n'th instance or search by key.

  • @_MagL
    @_MagL 5 ปีที่แล้ว

    So many computers in one room

  • @konstantinrebrov675
    @konstantinrebrov675 5 ปีที่แล้ว

    Please make a video, or a series of videos about packet encodings, how data is sent in packets via a network, and how to build a packet sniffer!

    • @firefox21xl
      @firefox21xl 5 ปีที่แล้ว

      Building a packet sniffer seems kinda out of scope for a computerphile video.... It's not simple in the slightest and definitely spills out of the 5-15 minute bites they normally put out.

  • @e1nste1in
    @e1nste1in 5 ปีที่แล้ว

    So how would I reference to an object that I already defined before? Eg. the second parent of a child.

    • @tamasdemjen4242
      @tamasdemjen4242 5 ปีที่แล้ว +1

      JSON is purely a declarative language, you cannot put code in it. One thing you can do is to assign a unique id to each node, and then reference the node via its id. Later build an index where you can address objects by id, but you can only do it from code, it cannot be part of the data. For example: { "id":1, children: [ { id:2 }, { id:3 }, {id:4, parent:1 } ] }; That's how PDF does it as well.

  • @sharpfang
    @sharpfang 5 ปีที่แล้ว

    No standard-defined way to store binary data though. You may send an array of ints, or a base64-encoded string or a string of hex digits, but there's no native built-in way in Javascript to encode a binary segment.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว

      You would store the structure that the binary data represented.

    • @sharpfang
      @sharpfang 5 ปีที่แล้ว

      @@lawrencedoliveiro9104 So how'd you go about sending, say, a PNG image over JSON?

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว

      @@sharpfang Encode the chunks.

    • @sharpfang
      @sharpfang 5 ปีที่แล้ว

      @@lawrencedoliveiro9104 So, first I take the PNG image from disk on the sender computer, decode it, disassemble into components, send them over JSON, including the image data as arrays of decimal values, then reassemble on the other end before displaying as a notification icon?

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว

      @@sharpfang Represent the entire structure of the file as JSON structure.

  • @FortoFight
    @FortoFight 5 ปีที่แล้ว

    SEAN!

  • @martinleduc
    @martinleduc 4 ปีที่แล้ว

    Has Computerphile ever made a video about JSONP ?

  • @t.walker3101
    @t.walker3101 5 ปีที่แล้ว +3

    Awesome, just using JSON for my iOS programming app project

  • @512TheWolf512
    @512TheWolf512 5 ปีที่แล้ว +6

    [X] JASON!

  • @j7ndominica051
    @j7ndominica051 5 ปีที่แล้ว

    A config file in this format is very human readable in notepad without a syntax highlighter, almost as clear as an ini, perhaps even better because the structure is visually nested. An XML is almost impossible to read, and type all the repeated attributes for every value and symbols all with the right hand. Most XML was clearly never intended to be edited by people, but is still saved to disk in verbose text format.

  • @AnarKloot
    @AnarKloot 5 ปีที่แล้ว +2

    What about Jason Schemer? Seem to hear a lot about that bloke these days

  • @GDNTB
    @GDNTB 5 ปีที่แล้ว +1

    What about Jay’s son?

  • @Nicolai0Nerland
    @Nicolai0Nerland 5 ปีที่แล้ว +2

    JSON?
    JSON..?
    JSON!?
    JSON!

  • @Jsuwinski
    @Jsuwinski 5 ปีที่แล้ว +2

    KISS, love it, too easy

  • @shurmurray
    @shurmurray 5 ปีที่แล้ว +13

    Lightweight JavaScript: please ignore that 350+ Mb of RAM occupied by an instance of chromium to run me.

    • @karolszymanowski518
      @karolszymanowski518 5 ปีที่แล้ว +6

      U can run js outside web browsers in node.js... besides he said json is lightweight not js (which actually is lightweight in mentioned nodejs).

    • @JohnnyWednesday
      @JohnnyWednesday 5 ปีที่แล้ว +7

      Web browsers are really slow, bloated virtual machines. Node.js is lovely and it's 'fast' because it's essentially compiling the code before its run. You know what's even faster? A real language with a COMPILER. I'm sorry that BEtoN is so hard to type that everybody throws a ton of their compute resources in the bin.

    • @willtheoct
      @willtheoct 5 ปีที่แล้ว +2

      @@JohnnyWednesday you can compile JS to machine code. JS is the real language and most others are frauds

    • @Concentrum
      @Concentrum 5 ปีที่แล้ว +4

      ​@@willtheoct r/gatekeeping

    • @JohnnyWednesday
      @JohnnyWednesday 5 ปีที่แล้ว +5

      @@willtheoct - said exactly like an amateur coder that only knows javascript ;)

  • @DJDoena
    @DJDoena 5 ปีที่แล้ว +2

    That it is not JaSON is the real tragedy here. What kind of computer person ignores such a pun when it's handed to them on practically a gold platter? The a isn't just convenient, it's right there in the spelled-out word. But then again, there is this English guy who took the longest sounding English letter in the alphabet and trippled it just to name something. :-P

    • @BoWeava
      @BoWeava 5 ปีที่แล้ว

      DJDoena XD

  • @blunderchips
    @blunderchips 5 ปีที่แล้ว

    I love json

  • @frankhaugen
    @frankhaugen 5 ปีที่แล้ว +5

    Sun? IBM? You might be living in the wrong decade mate ;-)

    • @autohmae
      @autohmae 4 ปีที่แล้ว +1

      He probably works on supercomputers.

  • @FandCCD
    @FandCCD 5 ปีที่แล้ว +6

    Thank you! I need to know what JSON is.

    • @SergeMatveenko
      @SergeMatveenko 5 ปีที่แล้ว

      I feel sarcasm:)

    • @FandCCD
      @FandCCD 5 ปีที่แล้ว +1

      Serge Matveenko actually no, no sarcasm.

    • @SergeMatveenko
      @SergeMatveenko 5 ปีที่แล้ว

      @@FandCCD Sorry, I felt like you're referring to the fact that this thing has been around for almost two decades already.

    • @FandCCD
      @FandCCD 5 ปีที่แล้ว

      Serge Matveenko no prob. I’m new to the scene.

    • @JochemKuijpers
      @JochemKuijpers 5 ปีที่แล้ว +2

      @@SergeMatveenko Something that "everyone knows" is new information to a lot of people every day

  • @freshleaf1231
    @freshleaf1231 ปีที่แล้ว

    DAMN JASON!

  • @Rouverius
    @Rouverius 5 ปีที่แล้ว +1

    Yeah, that's what I said: Jason

  • @svavarkjarrval8757
    @svavarkjarrval8757 5 ปีที่แล้ว +1

    The biggest crime against nostalgia is that Eve wasn't listed as one of the children.

    • @smergibblegibberish
      @smergibblegibberish 5 ปีที่แล้ว

      Eve is classically the eavesdropper in the scenario involving an exchange from Alice (point A) and Bob (point B). Using the name Eve in the context of this video would be unfitting.

    • @svavarkjarrval8757
      @svavarkjarrval8757 5 ปีที่แล้ว

      @@smergibblegibberish Yes, Eve would be the eavesdropping sibling. ;)

  • @pooryaj2092
    @pooryaj2092 5 ปีที่แล้ว

    Do the PDF video please

  • @BoWeava
    @BoWeava 5 ปีที่แล้ว

    Where's my fellow Jason's? 🤗

  • @oaktwig
    @oaktwig 5 ปีที่แล้ว +2

    You called?

  • @Garfield_Minecraft
    @Garfield_Minecraft 3 หลายเดือนก่อน +1

    who the hell is Jason?

  • @KaathKilo
    @KaathKilo 5 ปีที่แล้ว +1

    No, it's Jason

  • @1973Washu
    @1973Washu 5 ปีที่แล้ว

    So? System agnostic code?

  • @bikutoso
    @bikutoso 5 ปีที่แล้ว +1

    Two things I seem to use to frequently is JSON (Well, actually YAML in my case) and CSV.

  • @akiren7730
    @akiren7730 5 ปีที่แล้ว +3

    React Redux uses Json to store States and its awsome ;)

    • @dealloc
      @dealloc 5 ปีที่แล้ว

      Any state management library for JavaScript uses JSON to store state :) That is the fundamental of JavaScript, and what it's building blocks are (objects).

    • @akiren7730
      @akiren7730 5 ปีที่แล้ว

      ui_wizard still awesome ;)

  • @schifoso
    @schifoso 5 ปีที่แล้ว +4

    This explains how to increase sales for companies that make RAM and processors.

  • @saveusbloodymess
    @saveusbloodymess 5 ปีที่แล้ว

    Gotta love how we have up to 7 kinds of the Universal Serial Bus used at once, but the JavaScript Object Notation is a standard that works pretty much globally.

  • @cliffordkahn6830
    @cliffordkahn6830 5 ปีที่แล้ว +5

    I'm deaf... and I need caption for this video.

  • @AlphaFoxDelta
    @AlphaFoxDelta 5 ปีที่แล้ว

    JSON is great for computing in general in my view, but is no replacement for RDBMSs #DataIntegrity #WhyWaitToWriteToDB
    Dr. B here even hinted at it if you caught it, when he remarked that it'd be interesting to see a graph like structure with a bunch of relationships to one another. That's where Relational Databases shine, foreign keys and all that.
    Plus the fact that in some NoSQL DB architectures you can wait to write data, not having to at the instant the operation is handled, which can lead to trouble with data integrity... all for fast benchmarks... which of course JSON offers with its universal and small "packets".

  • @noredine
    @noredine 5 ปีที่แล้ว +2

    can we talk about why typeof [ ] == typeof { }

    • @dealloc
      @dealloc 5 ปีที่แล้ว +5

      They are both objects in JavaScript, so it's true. All values in JavaScript. There are some primitive types like `number` and `string`, which values of those types resolves to when using `typeof`, but they are objects as well.
      All values has a prototype, which is inherited from Object's prototype.
      Another thing to notice is the use of == (loose equality) rather than === (strict equality). Loose equality converts types beforehand, so 1 == '1'. Whereas strict equality compares both the type _and_ the value, without type conversion, and therefore 1 !== '1'.
      If you wanted to check wether a value is an array and not an `object`, then use Array.isArray.

  • @chachamarwa6047
    @chachamarwa6047 5 ปีที่แล้ว

    0:32 the phrrrrrrrrrobhreem, until my phone Vbrated.

  • @RocketLR
    @RocketLR 5 ปีที่แล้ว

    Every time I read json, my mind "the numbers, json. what do they mean!?"

    • @xybersurfer
      @xybersurfer 5 ปีที่แล้ว

      "the numbers json"?

    • @RocketLR
      @RocketLR 5 ปีที่แล้ว

      @@xybersurfer I corrected the sentances. Anyways, it's from CoD black ops. But He says Mason instead of json..

    • @xybersurfer
      @xybersurfer 5 ปีที่แล้ว

      @@RocketLR oh, i see. then it makes sense that i don't recognize it

  • @sRowTL985
    @sRowTL985 5 ปีที่แล้ว +6

    Don't go JSON waterfalls