Comments (22)
Agreed. Json is serialization, not text. The fact that Json is a text (as opposed to binary) format is irrelevant.
from corefxlab.
Where should it be? i.e. what namespace do you suggest?
from corefxlab.
@KrzysztofCwalina depends. How expansive are we expecting the number of JSON support objects to be? As expansive as XML? Then why not System.Json
(akin to System.Xml
)? Otherwise, System.Runtime.Serialization
seems like the logical choice.
Thoughts?
from corefxlab.
System.Json is already taken: https://msdn.microsoft.com/en-us/library/system.json.aspx
from corefxlab.
System.Json is already taken: https://msdn.microsoft.com/en-us/library/system.json.aspx
And we're not welcome to expand/improve upon it?
from corefxlab.
You are more than welcome to expand/improve upon it. But I would not mix two alternative APIs in one namespace.
from corefxlab.
Existence to two API is going to be confusing. There really is no good answer here but I assert that System.Runtime.Serialization1 is more correct than
System.Text` for JSON serialization code.
from corefxlab.
@KrzysztofCwalina has the System.Json you're linking above actually shipped anywhere outside Silverlight? If not, would it make sense to just create a new set of APIs in that namespace for .NET Core? the namespace is just too good to waste it 😄
from corefxlab.
Such namespace reuse has the potential to create confusion. For example, people who search for it might be taken to the irrelevant documentation, samples, blog posts, etc.
Also, I did not mention it in the past, but this library in corefxlab is probably not super suited for non-textural JSON representations.
from corefxlab.
Such namespace reuse has the potential to create confusion. For example, people who search for it might be taken to the irrelevant documentation, samples, blog posts, etc.
I've actually seen plenty of confusion around that specific library, since it once shipped in a preview of .NET Framework, so yeah 😄
Also, I did not mention it in the past, but this library in corefxlab is probably not super suited for non-textural JSON representations.
What's "non-textural JSON"?
from corefxlab.
What's "non-textural JSON"?
I was just trying to replay to the concern in the first two comments stating that JSON is not tied to text. I probably misunderstood the comments. I thought they implied that JSON could conceivably be non-textual. Now I re-read the comments and they are more conceptual than implying any actual non-textual JSON formats.
from corefxlab.
they are more conceptual than implying any actual non-textual JSON formats.
Correct - at least wrt my comments. JSON is a serialization format and it should be treated as such. Like XML, INI, and other formats it also varyingly human readable, but it is not just text. Editing JSON in a program like Word sounds awful (put possible). 😏
from corefxlab.
@whoisj, I hear you and I agree. It's just I need a good proposal for a namespace to make your observation actionable.
from corefxlab.
I submit System.Runtime.Serialization.Json
from corefxlab.
This library has nothing to do with serialization, i.e. you cannot pass objects to be converted to JSON. It's more similar to BinaryWriter, XmlWriter, and such.
from corefxlab.
But both BinaryWriter and XmlWriter are serializing data. I'm confused.
Is this more of a System.IO.Json
thing then? That makes relatively little sense - sadly.
from corefxlab.
I don't think we have the same definition for "serializing". The writers are not serializing anything by my definition. As I said above, to me serailization would mean you can pass objects in to get them converted to transmittable data that can be round tripped back to object. These APIs won't let you write our arbitrary (or even POCO) objects automatically.
System.IO.Json would be very strange. I agree.
from corefxlab.
I think I need to take a fresh look at what we're naming. 😉
Looking at the code explicitly, @KrzysztofCwalina is right. This is not serialization but a text formatter. This is far more akin to System.Text.StringBuilder
than to serialization. The correct location for this is likely in System.Json
. Since there's concern about name confusion, then perhaps right in System.Text
makse the most sense; unless we expect there to readers, writer, and validators. In which case System.Text.Json
does make some sense - but once we're writing, reading, and validating we're getting very close to serializing and deserializing.
All one would need to do that would be an attribute or two and class that could reflect and serialized marked up objects.
I'm torn.
from corefxlab.
closing this till there is a proposal for a better namespace
from corefxlab.
How about something like System.Text.IO.Json
- given that json is 'implemented' as a text format and readers and writers are about i/o, this would indicate that the classes perform json related i/o on textual data.. or something like that.
from corefxlab.
I am not convinced that the addition namespace node ("IO") adds a lot of value.
from corefxlab.
Yeah I'm not either. Really stretching on this one.
from corefxlab.
Related Issues (20)
- unable to get header row HOT 5
- Adding `Microsoft.Data.Analysis` 0.2 to .NET Framework 4.7.1 project adds lots of packages
- Update Spark after 0.3.0 is released HOT 2
- support for skipRows or skipRowPattern
- Support for crosstabs
- "Long to wide" and "wide to long" helper functions
- Passing in DataTypes to DataFrame.LoadCsv loses column name information
- DataFrame.LoadCsv doesn't handle `null` values when it attempts to guess the column types
- Writing dataframe to txt doesn't work properly HOT 7
- Column name indexing removed in .4? HOT 15
- DataFrame status HOT 1
- Nuget Package Query (System.IO.FileSystem.Watcher.Polling)
- Question: What is the status of System.Reflection.TypeLoader? HOT 1
- Question about supported platforms in polling watcher HOT 6
- Suggestion - Add constructor for MultiDictionary that takes IEnumerable of KeyValuePair
- A tsv file wouldn't load properly HOT 4
- [DataFrame] Add a LoadCsv overload or other method that takes CSV content directly HOT 1
- dataframe row escape characters HOT 2
- CoreFxLab is now archived! See dotnet/machinelearning and dotnet/runtimelab instead!
- OrderedDictionary indexer conflict HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corefxlab.