Hacker News new | ask | show | jobs
by Kiala 899 days ago

  <key>AutoJoin</key>
  <true/>
  <key>CaptiveBypass</key>
  <false/>
  <key>EncryptionType</key>
  <string>None</string>
A whole bunch of key-value pairs at the same level? What kind of cursed XML is this?
10 comments

I'm not sure how old you are but congratulations on living this long without encoutering the unmitigated hell of Apple plist files.

I remember seeing when I first started using OSX 10.0 about two decades ago and my reaction was about the same as yours. At least now `plutil` can output (and read) JSON, along with lots of other enhancements to make it slightly less insane to use.

Also can be edited using plutil and defaults in command line.
Not entirely unfamiliar from <dt>/<dd> HTML elements. [1][2]

   <dt>term1</dt><dd>definition1</dd>
   <dt>term2</dt><dd>definition2</dd>
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl...

[2] https://www.w3.org/TR/2011/WD-html5-author-20110809/the-dl-e...

Here's a large example with nested arrays and dicts, integers, strings, etc:

https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/...

Sweet Jesus.

I'm filing a human rights complaint at The Hague.

Oh it's not that bad, plus it's just an on-disk serialization format. You use it like you would Python's pickle by dumping/loading from NSDictionary/NSArray.

It's ordered, typed, can be validated by schema, and just takes the format you would write naturally and removes the boilerplate because your primitive collections in plist world aren't trees they're dicts and arrays just like in JSON.

    <dict>
      <entry>
        <key>Greeting</key>
        <value type="string">Hello World</value>
      </entry>
    </dict>

    <dict>
      <key>Greeting</key>
      <string>Hello World</string>
    </dict>
It's not intended to be written by hand. It's also like 30 years old.
I kinda like it. About as succinct you can make an ordered map with XML, given a predefined set of element names (= easy validation)
Now imagine that the workspace/project format for the defacto IDE for all Apple related stuff uses this exact same format, mixed with some random binary blobs and it keeps track of all project settings and file structure. Now imagine merging that in your VCS of choice whenever another team member makes any change to any of the aforementioned things.

Good news! You don't have to imagine! You can live this fever dream yourself by using Xcode.

How a company with that much money can unironically produce such dumpster fire garbage of a so-called IDE is beyond my comprehension.

> Now imagine that the workspace/project format for the defacto IDE for all Apple related stuff uses this exact same format

It doesn’t. Xcode project files are something that look a bit like a cross between JSON and an INI file. This is unofficial documentation showing what it looks like:

http://www.monobjc.net/xcode-project-file-format.html

That isn’t a property list; it’s something inherited from Project Builder from NeXTSTEP, which Xcode was originally based upon. Xcode project files would be a lot easier to deal with if they were property list files, because they are a standard, documented format with official tools to work with them. The Xcode project file format isn’t officially documented and doesn’t have generic manipulation tools like plutil.

Maybe you are mixing the project file up with the Info.plist file? That is a property list file, but its purpose is to tell the operating system about the application. It’s not the Xcode project file.

This is the original ASCII plist file format from NeXTSTEP. Foundation still supports reading these but not writing them.
What binary blobs? It's a text file?
This is one of the unexpected externalities of Apple’s walled garden. You may not deal with Xcode directly if you use Xamarin et al. then some poor soul somewhere has to sacrifice their first born every year when Xcode received an update.

If Apple allowed other App Stores, they would have to make Xcode not suck.

Worse than an .ini file
Congratulations, you’ve found example #78332 that even the world’s best engineers can have bad ideas.
Jeez yeah do not like this