You do your documentation in JSON? :quizzical:
Announcement
Collapse
No announcement yet.
Documentation
Collapse
X
-
Much of my code is, but you can't rely on that. The project I'm working on now has forty full-time software developers in three cities and three timezones. The documentation required is pretty strict, and it's reviewed before any code commits to the repository as performed. While things like class diagrams, functional hierarchy, etc are auto-generated...there are requirements to provide formatted documentation (Doxygen) for methods and classes. As well as in-line documentation where needed, if it's not immediately obvious from the variable names and code structure.
It's amazing how much easier the system is to work with when the team leads are nazis when it comes to documentation."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Originally posted by Hauldren Collider View PostWHOOOOSH
http://json.org/
But JSON has a ton of problems with it, specifically with encoding. You also have to be far more vigilant with defensive programming when using JSON. And the JSON encoder/decoder libraries are usually much slower than the XML ones.
It's also far easier to communicate with vendors & teams by sending out an XSD than trying to document JSON structure."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
So, JSON versus XML/DOM:
1. Verbosity
JSON is as verbose or not verbose as you want it. XML has closing tags. ****ING CLOSING TAGS. WHY.
JSON does not have attributes. There is no point to attributes if you're just trying to send data structures.
2. Interchange
XML sucks for interchange, and it is only possible because a lot of people spent a lot of time writing this horribly ****ty interface known as DOM that is in all languages. JSON already IS in all languages in some form or another, you just have to translate it a little bit and BAM. It is even LITERAL javascript and I think literal python, even.
3. Simplicity
JSON is a very simple tree data structure. XML is sort of this half-aborted B tree with its attributes and namespaces and text nodes and oh god oh god.
4. Extensibility
Who the **** cares about this? And WHY? Make a spec and keep it
5. Namespaces
SEE FOUR. WHAT THE **** IS THIS ****.If there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
Originally posted by Kuciwalker View Postis also designed to be written once and then never altered."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Originally posted by Asher View PostBut JSON has a ton of problems with it, specifically with encoding. You also have to be far more vigilant with defensive programming when using JSON. And the JSON encoder/decoder libraries are usually much slower than the XML ones.If there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
I don't think you fully understand DOM if you're comparing it with JSON.
Originally posted by Hauldren Collider View PostSo, JSON versus DOM:
1. Verbosity
JSON is as verbose or not verbose if you want it. XML has closing tags. ****ING CLOSING TAGS. WHY.
JSON does not have attributes. There is no point to attributes if you're just trying to send data structures.
2. Interchange
XML sucks for interchange, and it is only possible because a lot of people spent a lot of time writing this horribly ****ty interface known as DOM that is in all languages. JSON already IS in all languages in some form or another, you just have to translate it a little bit and BAM. It is even LITERAL javascript and I think literal python, even.
"translating it a little bit" should never have to be done in a real data interchange format.
3. Simplicity
JSON is a very simple tree data structure. XML is sort of this half-aborted B tree with its attributes and namespaces and text nodes and oh god oh god.
At my last job, our nightly batch process uploaded 2-3GB XML files nightly. Can you imagine trying to parse a 2-3GB JSON string?
4. Extensibility
Who the **** cares about this? And WHY? Make a spec and keep it
When I had to syndicate video data across 20 different online video platforms, I defined an XML schema and published it then sent it to all of the sites. Programmatically, they used tools to import our schema and add it to their translation engines -- within a few minutes they hooked up a data transformation from our XML format to their internal XML format. If we had used JSON for this, it'd have been a nightmare and require a manual parser to be implemented.
5. Namespaces
SEE FOUR. WHAT THE **** IS THIS ****.
I think it's abundantly clear you've simply not encountered any problems that suit XML. That's not too surprising, considering they're usually bigger in scope and interoperability than most people experience before they graduate.
Do you think Microsoft should've implemented XAML in JSON instead of XML, by the way?"The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Originally posted by Asher View PostWhoever "designed" that should be fired.
It's a jsp designed to display a fixed set of immutable documents (spreadsheets) that all share a template. When a new template comes out each year, we aren't going to update the old ones, so we need the old jsp to hang around anyway.
Comment
-
Originally posted by Hauldren Collider View PostYou can serialize just about any heirarchy of primitives (IE A CLASS) into JSON easily. You can also prevent bad code from being run with 4 (that's FOUR) regexes that you can copypasta from anywhere and shove in a method and you're done.
How do you specify which character encoding your JSON is using?"The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Originally posted by Hauldren Collider View PostJust assume UTF/8
Frankly most of the time people forget to put character encoding into XML ANYWAYS making your point moot.
You've no idea how much of a nightmare this was for me. We supported English and French equally. We were talking to vendors who expected UTF-8, UTF-16, Latin-1, etc. It was an absolute mess, and JSON would've been a disaster in such an environment.
Also, I'm unaware of any databases with full JSON integration, while many fully integrate XML. It's hugely helpful."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
There's a reason XML and JSON are both prevalent. They both serve different purposes and complement eachother.
JSON is more of a lightweight web-services format, XML is far more powerful and sports far more diversity in its usage. It's used in code commenting formats (as you've mentioned) -- try doing that in JSON?
It's used to describe interfaces (Android and WPF/Silverlight use XML to define the UI).
It's used to store/retrieve data from DBMS.
It's used to transfer massive amounts of data between systems.
It's used to translate data between systems quickly, easily, and safely.
etc."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
Comment