Skip to content

Use YAML for project files instead of JSON? #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ejsmith opened this issue Jun 1, 2014 · 6 comments
Closed

Use YAML for project files instead of JSON? #60

ejsmith opened this issue Jun 1, 2014 · 6 comments

Comments

@ejsmith
Copy link
Contributor

ejsmith commented Jun 1, 2014

Why not use a more human readable and editable format like YAML instead of using the more verbose project.json format? I know that JSON is a more popular format, but YAML is pretty popular as well and is so dead simple and clean that it seems like it would make a nice clean new project system even cleaner and simpler.

Here is a sample in both JSON and YAML format. Judge for yourself.
https://gist.github.com/ejsmith/f8ff96a10675845d4293

@davidfowl
Copy link
Member

This really is a never ending debate but we chose JSON for a few reasons:

  • Easy to read and author without tooling support
  • Abundance of parsers available on multiple platforms, plus the one that we already use in most of our frameworks JSON.NET
  • We were already investing in a JSON editor for VS (So we could do cool things like use JSON schema to show project.json intellisense and also things like querying for nuget packages)

Aside, why not Xaml 😄
http://forums.asp.net/t/1989814.aspx?Why+Not+Xaml+

@ejsmith
Copy link
Contributor Author

ejsmith commented Jun 2, 2014

I understand the reasoning, but IMO it would be worth it. Your XAML arguments are that JSON is clean and tighter than XAML, but YAML makes JSON look ugly. It seems like project.json files are meant to be hand edited in this new world and to me having a cleaner syntax would be worth some extra effort. Especially since this is a long term architectural change. You know how tight and simple it would be to have a nice project.yaml and config.yaml sitting in your project?? :-) You know you want that. LOL

Maybe the system could support both? I can see where you wouldn't want to make the whole thing pluggable and have a bunch of unknown formats that other editors would need to be able to read and understand, but I would say that you could have a single system that looks for either a project.yaml or project.json file and reads them. Hrmm... now that I think about that... it seems like that would be a bad idea too. I guess it's an all or nothing thing.

@davidfowl
Copy link
Member

JSON has been chosen and I don't see us supporting multiple project formats. The ecosystem needs to be consistent and I'm not a fan of supporting more than one format for the project file (maybe in another 10 years 😉).

Config files are more forgiving and I could see a yaml source but the project format is wayyyy different and has more implications.

BTW "Right Click -> Add Reference" is not dead. We want to have it all:

  • The ability to edit the file
  • The ability to have tooling like VS completely light up the e2e experience with ui that is familiar to people

@ejsmith
Copy link
Contributor Author

ejsmith commented Jun 2, 2014

Yeah, I agree that supporting more than one format would be a bad idea. Also, I guess if you are a C# dev, then you already live in the world of curly braces. Sigh. :-)

@ejsmith ejsmith closed this as completed Jun 2, 2014
@alfredorevilla
Copy link

alfredorevilla commented Jan 6, 2017

Besides Swagger, I've not used YAML extensively BUT I find it terrible. JSON looks and works better for me, at least under Visual Studio.

@aL3891
Copy link

aL3891 commented Jan 8, 2017

I fooled around with ways of using different formats over here https://github.com/aL3891/CustomPackageReferences

ryanbrandenburg pushed a commit that referenced this issue Nov 21, 2018
Using 'nameof' operator instead of magic strings
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants