(no title)
dalemyers | 4 years ago
> There is no other data in this object. Its only reason for existing, as far as I can tell, is to point to the actual PBXFileReference object which contains the filesystem path.
Now, that statement is true most of the time. But not always. Let's say you have a file in two targets (targets ~= binaries). In one of those targets, you need to set a build flag, but not the other, how do you do it? Well, you set it on the PBXBuildFile, rather than the PBXFileReference. In otherwords, you can have 2 different PBXBuildFile's, with 2 different sets of flags, pointing at the same actual file on disk.
Whether that's a good design or not is definitely up for debate, but I wanted to clarify that there are reasons behind everything.
Going further:
> Since everything has a unique ID, a reasonable expectation would be that a) it would be unique per object and b) you would use that ID to refer to the target. Neither of these are true. For example let's define a single build target, which in Xcode/CMake parlance is a PBXNativeTarget. Since plist has a native array type, the target's sources could be listed in an array of unique ids of the files. Instead the array contains a reference to a PBXSourcesBuildPhase object that has a few keys which are useless and always the same and an array of unique ids.
Let's take a sub-statement here first: > Since everything has a unique ID, a reasonable expectation would be that a) it would be unique per object
The author claims this is false, but I've never seen a case where this hasn't held up. Numerous libraries depend on this fact.
> you would use that ID to refer to the target
Also claimed as false, but you do. The argument the author makes talks about the build file stuff I mentioned above, so they may just be misunderstanding or have mis-spoken/written.
Just to re-iterate, I'm not a fan of this format at all. I'm actually in the middle of converting a million line project to use XcodeGen just so I can get away from it. But everything does have a reason.
xbar|4 years ago
Xcode 12 UX is an example where Apple seemed willing to invest. There may be reasons pbxformat is bad, but there is no reason Xcode 13 or 14 couldn't address them. After all, it's only software.
ASalazarMX|4 years ago
dalemyers|4 years ago
reaperducer|4 years ago
90% of the tech rant blog spam on HN is people who don't fully understand the tool they're using.
Something doesn't work the way they expect for their particular project or their specific need, and they blather on about how bad it is.
When the reality is that these things are often done for a reason, but the author's myopia prevents him from understanding that there are other people doing other things in the world.
Apocryphon|4 years ago
dalemyers|4 years ago
I'd like to see more assumption of positive intent on here, but it's definitely a hard task. I hope I didn't offend the original author here. I tried to ensure that I explained without chastising.
Cloudef|4 years ago