Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I am coming to seriously love JSON.

I am coming to seriously love JSON.

Scheduled Pinned Locked Moved The Lounge
jsoncomquestionlounge
20 Posts 12 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard Andrew x64R Richard Andrew x64

    I first read that as "I am coming to seriously love JSOP" !!

    The difficult we do right away... ...the impossible takes slightly longer.

    D Offline
    D Offline
    dandy72
    wrote on last edited by
    #11

    Let me guess who the one up-vote is...

    1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      I first read that as "I am coming to seriously love JSOP" !!

      The difficult we do right away... ...the impossible takes slightly longer.

      S Offline
      S Offline
      Slacker007
      wrote on last edited by
      #12

      JSON, son of JSOP.

      1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        I had an Excel sheet I wanted in my app - so I converted it to CSV (which Excel will output), then rethought - do I really want to play with CSV data, when the rest of my app is JSON and includes Newtonsoft already? Nope. So one quick online converter later (CSV To JSON Converter[^] - free and works!) and I've got it in JSON. Then it was the "sod it!" moment: I'd really rather have that in a DataTable ... Bingo! 11 characters added to the file later, and it deserializes as a DataTable! It's just sooooo friendly! :thumbsup:

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        honey the codewitchH Offline
        honey the codewitchH Offline
        honey the codewitch
        wrote on last edited by
        #13

        I liked it until i had to do fixed length allocations with it (fixed number of elements) in my IoT stuff. Now I kind of find it a pain.

        Real programmers use butterflies

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          I had an Excel sheet I wanted in my app - so I converted it to CSV (which Excel will output), then rethought - do I really want to play with CSV data, when the rest of my app is JSON and includes Newtonsoft already? Nope. So one quick online converter later (CSV To JSON Converter[^] - free and works!) and I've got it in JSON. Then it was the "sod it!" moment: I'd really rather have that in a DataTable ... Bingo! 11 characters added to the file later, and it deserializes as a DataTable! It's just sooooo friendly! :thumbsup:

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          S Offline
          S Offline
          Slacker007
          wrote on last edited by
          #14

          better late than never, I guess. :-D

          1 Reply Last reply
          0
          • P PIEBALDconsult

            You're working too hard. :-D One of the utilities I've been working on at work recently is a very simple ETL tool.

                            Source Destination
            

            CSV Y Y
            JSON F F
            Sharepoint (list) Y N
            SPLUNK F N
            SQL Server Y Y
            SSAS (OLAP) Y N
            XHTML Y Y
            XLSX Y N
            XML Y Y

            Y=Yes , N=No , F=Future support possible

            Each "source" provides a DataReader and each "destination" reads a DataReader. One design decision I made was not to use any third-party technology (e.g. Newtonsoft), it's all .net -- it doesn't use interop either. I intend to add reading and writing JSON to it once I have .net 4.7 or newer -- which supports JSON natively. The point being that opening an XLSX file and wrapping a "worksheet" in a DataReader is not all that difficult -- non-trivial, yes. With the DataReader, you can create and populate a DataTable, but what do you do with it then?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #15

            Great stuff :thumbsup: I'm just working on a similar thing where you can also inject a database scheme and with this it does recursively collect the data from any starting record from a table. Additionally this part does also support the mapping of 'internal technical id' (usually an integer in my case) against 'user id' (usually a nvarchar(n) in my case). Nice challenge to solve it in general for compound keys of any data type, detect self references on the same record, detect circular references...

            Quote:

            With the DataReader, you can create and populate a DataTable, but what do you do with it then?

            o Briefcase to exchange data (e.g. customer has a specific problem and you need to debug) o Importing data from e.g. Excel (often ask by customers) o ...

            It does not solve my Problem, but it answers my question Chemists have exactly one rule: there are only exceptions

            1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              I had an Excel sheet I wanted in my app - so I converted it to CSV (which Excel will output), then rethought - do I really want to play with CSV data, when the rest of my app is JSON and includes Newtonsoft already? Nope. So one quick online converter later (CSV To JSON Converter[^] - free and works!) and I've got it in JSON. Then it was the "sod it!" moment: I'd really rather have that in a DataTable ... Bingo! 11 characters added to the file later, and it deserializes as a DataTable! It's just sooooo friendly! :thumbsup:

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              W Offline
              W Offline
              W Balboos GHB
              wrote on last edited by
              #16

              I discovered the simpleton's beauty in it a year or two ago. The need to get multiple pieces of data back from AJAX. It can do much more but I like to imagine it was designed and built for this purpose - where only one string comes back. No more worries with parsers where where, no matter what delimiter I choose some jackass user decided they must have it in their input. Even '|' had its sanctity violated. (I gave up and sanitize all user input). JSON gets rid of that for me in the name of "going forward". One oddity in my use:   I typically build the JSON stings from my own code but do convert them back with the ubiquitous version of it that exist it most languages (that I care about). One thing - you'll likely do your own research: SQL Server actually allows a JSON type - a type that can be searched with with SQL WHERE clauses. So I asked my fearless leader, a particularly good DBA, what he thought of it. Apparently, as he sees it, the overhead involved will be horrific in terms of performance.

              Ravings en masse^

              "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

              "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                I had an Excel sheet I wanted in my app - so I converted it to CSV (which Excel will output), then rethought - do I really want to play with CSV data, when the rest of my app is JSON and includes Newtonsoft already? Nope. So one quick online converter later (CSV To JSON Converter[^] - free and works!) and I've got it in JSON. Then it was the "sod it!" moment: I'd really rather have that in a DataTable ... Bingo! 11 characters added to the file later, and it deserializes as a DataTable! It's just sooooo friendly! :thumbsup:

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #17

                The only thing I've noticed, is that there are more JSON questions in Q&A than XML. My last web service dealt with USPS, FedEx and UPS: all XML; sending and receiving. I serialize and deserialize my app settings: XML Post performances at the race track: XML etc. My main complaint with XML, a little more verbose; i.e. no shortcut ending tag. But since it's all generated from class definitions, the only drawback is in my head.

                It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

                1 Reply Last reply
                0
                • G GuyThiebaut

                  Definitely my favourite format for passing around information too. It makes me wonder who would want to use XML, or rather why on earth XML became so popular when JSON simply lets you pass objects around between different platforms/services.

                  “That which can be asserted without evidence, can be dismissed without evidence.”

                  ― Christopher Hitchens

                  P Offline
                  P Offline
                  Peter Kassenaar
                  wrote on last edited by
                  #18

                  Not to forget that XML has been around since the 1970s, and JSON was only described in the early 2000s by Douglas Crockford et al. So in the meantime, A LOT of applications went with XML as the default for exchanging data. -- Peter.

                  G 1 Reply Last reply
                  0
                  • P Peter Kassenaar

                    Not to forget that XML has been around since the 1970s, and JSON was only described in the early 2000s by Douglas Crockford et al. So in the meantime, A LOT of applications went with XML as the default for exchanging data. -- Peter.

                    G Offline
                    G Offline
                    GuyThiebaut
                    wrote on last edited by
                    #19

                    Good point, it also seems to have taken a long time after 2000 for devs to trust using JSON.

                    “That which can be asserted without evidence, can be dismissed without evidence.”

                    ― Christopher Hitchens

                    T 1 Reply Last reply
                    0
                    • G GuyThiebaut

                      Good point, it also seems to have taken a long time after 2000 for devs to trust using JSON.

                      “That which can be asserted without evidence, can be dismissed without evidence.”

                      ― Christopher Hitchens

                      T Offline
                      T Offline
                      thewazz
                      wrote on last edited by
                      #20

                      Because JavaScript.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups