tag:blogger.com,1999:blog-46127711958834054072024-02-08T02:17:46.314-08:00JLoo @ GuidanceJason K. Loo | Technical Director
310.754.3877 direct | jason.loo@guidance.com
Guidance | www.guidance.com
4134 Del Rey Ave | Marina Del Rey, CA 90292
310.754.4000 main | 310.754.4010 faxJason K. Loohttp://www.blogger.com/profile/06959756343513468380noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4612771195883405407.post-63357340342038013042007-06-12T21:47:00.000-07:002007-06-14T06:49:39.139-07:00JSON - What's Taking So Long?<span class="blsp-spelling-error" id="SPELLING_ERROR_0">JSON</span> is the ideal method for data interchange; consider its compact payload, <span class="blsp-spelling-corrected" id="SPELLING_ERROR_1">native</span> support in JavaScript, and its interoperability with other languages (via a bridge), and it is surprising that support for <span class="blsp-spelling-error" id="SPELLING_ERROR_2">JSON</span> is not more ubiquitous. While Yahoo and Google are now offering data feeds in JSON format, I am anxious for other information providors to follow suit. <br /><br /><strong>What Is JSON</strong><br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_3">JSON</span> (JavaScript Object Notation) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing objects and other data structures and is mainly used to transmit such structured data over a network connection (in a process called serialization).<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_4">JSON</span> finds its main application in Ajax web application programming, as a simple alternative to using XML for asynchronously transmitting structured information between client and server.<br /><br /><strong>Syntax</strong><br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_5">JSON</span> is a subset of the object literal notation of JavaScript and is commonly used with that language. However the basic types and data structures of most other programming languages can also be represented in <span class="blsp-spelling-error" id="SPELLING_ERROR_6">JSON</span>, and the format can therefore be used to exchange structured data between programs written in different languages. Code for parsing and generating <span class="blsp-spelling-error" id="SPELLING_ERROR_7">JSON</span> (the latter is also known as "<span class="blsp-spelling-error" id="SPELLING_ERROR_8">stringifying</span>") is available for the following languages: <span class="blsp-spelling-error" id="SPELLING_ERROR_9">ActionScript</span>, C, C++, C#, <span class="blsp-spelling-error" id="SPELLING_ERROR_10">ColdFusion</span>, Common Lisp, Delphi/Object pascal, E, <span class="blsp-spelling-error" id="SPELLING_ERROR_11">Erlang</span>, Haskell, Io[1] Java, JavaScript, Lasso (programming language), Limbo, <span class="blsp-spelling-error" id="SPELLING_ERROR_12">Lua</span>, ML, Objective-C, Objective <span class="blsp-spelling-error" id="SPELLING_ERROR_13">CAML</span>, Perl, <span class="blsp-spelling-error" id="SPELLING_ERROR_14">PHP</span>, Python, <span class="blsp-spelling-error" id="SPELLING_ERROR_15">Rebol</span>, Ruby, Smalltalk and <span class="blsp-spelling-error" id="SPELLING_ERROR_16">Tcl</span>.<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_17">JSON</span> is built on two structures:<br /><br />A collection of name/value pairs. In various languages, this is realized as an object, record, <span class="blsp-spelling-error" id="SPELLING_ERROR_18">struct</span>, dictionary, hash table, keyed list, or associative array.<br />An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.<br />These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is <span class="blsp-spelling-error" id="SPELLING_ERROR_19">interchangable</span> with programming languages also be based on these structures.<br /><br />In <span class="blsp-spelling-error" id="SPELLING_ERROR_20">JSON</span>, they take on these forms:<br /><br />An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).<br /><br />An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).<br /><br />A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.<br /><br />A string is a collection of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.<br /><br />A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_21">Whitespace</span> can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.Jason K. Loohttp://www.blogger.com/profile/06959756343513468380noreply@blogger.com1tag:blogger.com,1999:blog-4612771195883405407.post-38162962351140485682007-05-17T08:22:00.000-07:002007-05-17T08:35:37.109-07:00Guidance SolutionsGuidance <a href="http://www.guidance.com">www.guidance.com</a><br />4134 Del Rey Ave Marina Del Rey, CA 90292<br />310.754.4000 main 310.754.4010 faxJason K. Loohttp://www.blogger.com/profile/06959756343513468380noreply@blogger.com0