Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
12 rats tied together
Sep 7, 2006

Visions of Valerie posted:

code:
- it:
    - absolutely
- isn't
if relative indentation matters, it's not merely a presentation detail

what's your issue with this? you can indent `- absolutely` however many times you want, and it is equivalent.

the only weird part of this snippet is that the mapping value must be indented by >1 blank space character (normally >0 would be fine), but this is likely an artifact of you nesting a block mapping which is distinct from a block sequence and thus has different rules for indentation.

Adbot
ADBOT LOVES YOU

Visions of Valerie
Jun 18, 2023

Come this autumn, we'll be miles away...

12 rats tied together posted:

what's your issue with this? you can indent `- absolutely` however many times you want, and it is equivalent.

the only weird part of this snippet is that the mapping value must be indented by >1 blank space character (normally >0 would be fine), but this is likely an artifact of you nesting a block mapping which is distinct from a block sequence and thus has different rules for indentation.

I think semantically relevant whitespace is always a disaster waiting to happen

Cybernetic Vermin
Apr 18, 2005

i am pretty ok with significant whitespace. especially having newlines replace semicolons as a kind of default, which was always a thing (e.g. cpp) and has gotten more popular. but i am not really a fan of it in yaml.

but, i am tbh pretty relaxed overall. as far as i am concerned if things are xml, json, yaml, or ini derivatives like toml, i am largely fine with it. csv gets a special "ok" status too not as a standard thing but as basically simple enough that you'll figure out the system-specific limits as you go. more bespoke than that needs very deep motivation though.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

significant whitespace is great for files that (1) fit in one screen, and (2) will be read and written by hand

if (2) isn't true, just emit json instead of yaml

if (1) isn't true, either split it into smaller files or figure out how not to do (2)

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

akadajet posted:

and while we’re at it stop inventing new programming languages, ui frameworks and orms. we have enough

exactly, we already have the perfect language in the Lisp-1 known as prefix Dylan (which is just Scheme rebuilt atop a CLOS-style object system), just use that with an adapted CLIM and ORM

Shaggar
Apr 26, 2006

Visions of Valerie posted:

I think semantically relevant whitespace is always a disaster waiting to happen

yeah its extremely bad

Shaggar
Apr 26, 2006

Cybernetic Vermin posted:

having newlines replace semicolons as a kind of default

this is the worst idea of all, probably

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Shaggar posted:

this is the worst idea of all, probably

at least its one thing, unlike erlang where theres a bunch of different ways to terminate a line depending on context that could be trivially inferred

12 rats tied together
Sep 7, 2006

if you can't read a line break as a substitute closing brace or bracket you can just use one of the yaml flow styles which require them.

unfortunately examples in the wild are rare, and many tools will not emit them, because most people dont have this problem

Shaggar
Apr 26, 2006
most people who use yaml are brain damaged

Surprise T Rex
Apr 9, 2008

Dinosaur Gum
https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

I don’t think there’s a good config language tbh but if there is yaml doesn’t seem to be it

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
I mean we’re all adults here, we can all agree that the right (semi) human readable data language to use is the one that’s already in use in the code base, or that meshes the best with whatever languages it’s used by, and that they’re all fundamentally fungible, and that nothing beats binary TLVs

12 rats tied together
Sep 7, 2006

Surprise T Rex posted:

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

I don’t think there’s a good config language tbh but if there is yaml doesn’t seem to be it

this article is based on the yaml 1.1 spec which is from 2005.

12 rats tied together
Sep 7, 2006

pyyaml also ships with a schema + loader that loads the entire document without issue
Python code:
> ~ python
Python 3.10.4 (main, May  7 2022, 11:53:57) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> yaml.load("""server_config:
# snip
...     - 12.13""", Loader=yaml.BaseLoader)
{'server_config': {'port_mapping': ['22:22', '80:80', '443:443'], 'serve': ['/robots.txt', '/favicon.ico', '*.html', '*.png', '!.git'], 'geoblock_regions': ['dk', 'fi', 'is', 'no', 'se'], 'flush_cache': {'on': ['push', 'memory_pressure'], 'priority': 'background'}, 'allow_postgres_versions': ['9.5.25', '9.6.24', '10.23', '12.13']}}
i recommend reading the documentation for your tools instead of writing the n+1th screed

Shaggar
Apr 26, 2006

Surprise T Rex posted:

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

I don’t think there’s a good config language tbh but if there is yaml doesn’t seem to be it

there are atleast 2 good config languages:
  • ini
  • xml

Athas
Aug 6, 2007

fuck that joker

leper khan posted:

at least its one thing, unlike erlang where theres a bunch of different ways to terminate a line depending on context that could be trivially inferred

This is a relic of an old line of language design that used both comma, semicolons, and full stops as terminators, depending on what you were terminating (with the full stops usually for top level declarations like functions). I think Erlang is the most popular language that still works like that. It should be preserved as a living monument, like monarchy.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

Shaggar posted:

there are atleast 2 good config languages:
  • ini
  • xml

plists are just xml so once again apple is good

abraham linksys
Sep 6, 2010

:darksouls:

DELETE CASCADE posted:

plists are just xml so once again apple is good

ok but when someone says "xml is fine you just need to use a better IDE" i think of the plist interface in xcode and wonder what the hell an actually good XML interface would look like because it sure as poo poo isnt that

akadajet
Sep 14, 2003

Shaggar posted:

most people who use yaml are brain damaged

never by choice. but you're right

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

abraham linksys posted:

ok but when someone says "xml is fine you just need to use a better IDE" i think of the plist interface in xcode and wonder what the hell an actually good XML interface would look like because it sure as poo poo isnt that

idk I like the gambling high from guessing what’s gonna happen when I press the return key in a text field

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

abraham linksys posted:

ok but when someone says "xml is fine you just need to use a better IDE" i think of the plist interface in xcode and wonder what the hell an actually good XML interface would look like because it sure as poo poo isnt that
xcode isn't a good anything so im not surprised it doesn't work for xml either

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
what if you took your xml and when presented it stripped out the end tags and replaced first one with something like 'foo:' and then for nested fields you just indent to make it clear what is part of which tag. you could do attributes as like 'foo(a: "blah", b: 123, c: "hi"):'. if you have a series of things you could prefix the entries with a dash or something

Visions of Valerie
Jun 18, 2023

Come this autumn, we'll be miles away...

Sweeper posted:

what if you took your xml and when presented it stripped out the end tags and replaced first one with something like 'foo:' and then for nested fields you just indent to make it clear what is part of which tag. you could do attributes as like 'foo(a: "blah", b: 123, c: "hi"):'. if you have a series of things you could prefix the entries with a dash or something

yeah so the thing is: that sucks

Shaggar
Apr 26, 2006

Sweeper posted:

what if you took your xml and when presented it stripped out the end tags and replaced first one with something like 'foo:' and then for nested fields you just indent to make it clear what is part of which tag. you could do attributes as like 'foo(a: "blah", b: 123, c: "hi"):'. if you have a series of things you could prefix the entries with a dash or something

why would you do that? just use it as is

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
things must change

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
sounds like you’ve got an xyml problem

akadajet
Sep 14, 2003

Sagacity posted:

xcode isn't a good anything so im not surprised it doesn't work for xml either

when steve jobs said that apple thinks different he was talking about plists

FlapYoJacks
Feb 12, 2009
Apple should license the IDE work out to Jetbrains and have them make Xcode.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
swing and a miss

Bloody
Mar 3, 2013

simply do not configure your software. just write your software. need to save user preferences? we have a place for that. it’s called hkcu

mystes
May 31, 2006

Bloody posted:

simply do not configure your software. just write your software. need to save user preferences? we have a place for that. it’s called hkcu
Did you just tell me to hkcu myself?

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
need to save user preferences?

no, you don't

if their preferences were really that strong they could patch the program and recompile it

Bloody
Mar 3, 2013

that implies that you provide source code which suggests it may be open source which is as we all know “bad” see also rotors manifesto . therefore use the registry

Visions of Valerie
Jun 18, 2023

Come this autumn, we'll be miles away...

Internet Janitor posted:

need to save user preferences?

no, you don't

redleader
Aug 18, 2005

Engage according to operational parameters

Internet Janitor posted:

need to save user preferences?

no, you don't

if their preferences were really that strong they could patch the program and recompile it

pseudorandom name
May 6, 2007

Internet Janitor posted:

need to save user preferences?

no, you don't

if their preferences were really that strong they could patch the program

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Internet Janitor posted:

need to save user preferences?

no, you don't

if their preferences were really that strong they could patch the program and recompile it

Bloody posted:

that implies that you provide source code which suggests it may be open source which is as we all know “bad” see also rotors manifesto . therefore use the registry

:hmmyes: if they care enough they can binary patch it. no need for recompiling, providing source, or using the registry.

Athas
Aug 6, 2007

fuck that joker
Do not cater to users who do not have the entire build infrastructure on their system (which is exactly a C89 compiler and nothing more).

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
I see you also use suckless applications

Adbot
ADBOT LOVES YOU

Ocean of Milk
Jun 25, 2018

oh yeah
You beat me to it

https://st.suckless.org posted:

Configuration
Configuration is done with config.h. Read the comments in the generated config.h to edit it according to your needs. Defaults are stored in config.def.h.

https://dwm.suckless.org posted:

- dwm is customized through editing its source code, which makes it extremely fast and secure - it does not process any input data which isn't known at compile time, except window titles and status text read from the root window's name. You don't have to learn Lua/sh/ruby or some weird configuration file format (like X resource files), beside C, to customize it for your needs: you only have to learn C (at least in order to edit the header file).
- Because dwm is customized through editing its source code, it's pointless to make binary packages of it. This keeps its userbase small and elitist.

The elite of... people who willingly choose C as their config file format.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply