Jump to page: 1 24  
Page
Thread overview
DUB: json or sdl?
Sep 22, 2021
Ki Rill
Sep 22, 2021
drug
Sep 22, 2021
deadalnix
Sep 22, 2021
bauss
Sep 22, 2021
Tobias Pankrath
Sep 22, 2021
russhy
Sep 23, 2021
Kagamin
Sep 23, 2021
Kagamin
Sep 22, 2021
jfondren
Sep 22, 2021
Mike Parker
Sep 22, 2021
Ki Rill
Sep 23, 2021
Mike Parker
Sep 23, 2021
Elronnd
Oct 01, 2021
guai
Sep 22, 2021
Ki Rill
Sep 23, 2021
bauss
Sep 22, 2021
JN
Sep 23, 2021
SealabJaster
Oct 01, 2021
guai
Sep 23, 2021
Guillaume Piolat
Sep 26, 2021
Mathias LANG
Sep 27, 2021
Meta
Sep 27, 2021
Adam D Ruppe
Oct 04, 2021
bauss
Sep 27, 2021
Tejas
Sep 27, 2021
Dga123
Sep 27, 2021
Dukc
Oct 06, 2021
Imperatorn
September 22, 2021

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

September 22, 2021
22.09.2021 13:19, Ki Rill пишет:
> Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?
> 
> For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library.
> 
> What's your reason?

My reason for sdl format using is its conciseness, human readability and possibility of comments.

P.S. I remember that very long negative thread about sdl format by default and how it was funny when the thread starter agreed later that sdl was much convenient that json.
September 22, 2021

On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:

>

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.

September 22, 2021

On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:

>

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

Reason to prefer JSON:

  1. dub is stricter about the format, and will complain about errors for SDL would result in values being silently ignored.

  2. you want something like a 2008 Perl install to be able to do something with your dub.json files, instead of writing a D program.

  3. you hope that a glacier of increasing dub.json files will eventually tear out the roots of dub having more than one config format

  4. you have a phobia about malicious comments getting injected into your dub.sdl files

  5. you used jq and liked it to the point of finding other formats intolerable

Reasons to prefer SDL:

  1. comments in dub.sdl files,

#! /usr/bin/env dub
/+ dub.json: {
   "dependencies": {
       "sumtype": "~>0.10.0",
    },
    "dflags": ["-betterC"],
}
+/

vs.

#! /usr/bin/env dub
/+ dub.sdl:
   dependency "sumtype" version="~>0.10.0"
   dflags "-betterC"
+/

dub converts SDL to JSON for ~/.packages/ , and the same code might be used to convert SDL documentation to JSON, so I think the main problem of multiple dub configuration formats (that it's more of a chore to talk about dub configuration) is not that bad.

>

On Wednesday, 22 September 2021 at 10:45:41 UTC, bauss wrote:
Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.

With JSON you do not have to remember what an array or a hash looks like, but that doesn't tell you that the "dflags" key has an array of strings rather than looking like "dflags": "-betterC",

You have to look up what dub expects either way, so the consistency fails to help with the most frustrating part of dub configurations, which is writing them in the first place.

September 22, 2021

On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:

>

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

SDL. It's much cleaner to me than JSON. And the fact that JSON is standard elsewhere matters not one iota to me.

September 22, 2021

On 9/22/21 6:19 AM, Ki Rill wrote:

>

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

I actually used to prefer sdl, but lately, I'm using json.

sdl is an ok format to write, but I always forget the way to write arrays or objects. With json I always know what I need to use.

I prefer a comment-allowing form, especially for config files, where comments can provide instructions on what directives do. Having dub init spit out a bunch of comments that describe how to configure dub, and how to add dependencies, configs, etc, would go a long way to making it not as bad a format.

-Steve

September 22, 2021
On Wednesday, 22 September 2021 at 10:29:58 UTC, drug wrote:
> My reason for sdl format using is its conciseness, human readability and possibility of comments.
>

And this is why I use json parser that accept comments :)

September 22, 2021

On Wednesday, 22 September 2021 at 13:22:33 UTC, Mike Parker wrote:

>

On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:

>

Out of curiosity, which one do you use in your dub projects and why do you prefer one over another?

For example, I use json. Simply because when I see sdl, I think of SDL2 graphics library.

What's your reason?

SDL. It's much cleaner to me than JSON. And the fact that JSON is standard elsewhere matters not one iota to me.

What do you think of Rust's toml format?

September 22, 2021

On Wednesday, 22 September 2021 at 14:15:43 UTC, Steven Schveighoffer wrote:

>

I prefer a comment-allowing form, especially for config files, where comments can provide instructions on what directives do. Having dub init spit out a bunch of comments that describe how to configure dub, and how to add dependencies, configs, etc, would go a long way to making it not as bad a format.

-Steve

I wish json would accept comments. I prefer to leave lots of comments for future me in case I forget what I did, important information about a package, etc...

September 22, 2021

On Wednesday, 22 September 2021 at 10:45:41 UTC, bauss wrote:

>

Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.

I use it on the job (not a D shop).

« First   ‹ Prev
1 2 3 4