Xcode Packaging

Speaking of packaging, a thing I hated in Xcode, which made me wish to be filled with nuclear fire, transformed into Godzilla, and stomp thru 1 Infinite Loop, was the package structure:

foo/
    foo/
        foo-Info.plist
        foo-Prefix.pch
        foo.entitlements
        all source, images, and config files in a single giant mess, regardless of "groups"
    foo.xcodeproj/
        foo.xcodeproj/
            project.pbxproj
        project.xcworkspace/
            contents.xcworkspacedata
            xcshareddata/
                foo.xccheckout
            xcuserdata/
                mdh.xcuserdatad/
                    UserInterfaceState.xcuserstate
                    WorkspaceSettings.xcsettings
                    xcschemes/
                        xcschememanagement.plist
        xcuserdata/
            mdh.xcuserdatad/
                xcdebugger/
                    Breakpoints_v2.xcbkptlist
                xcschemes/
                    foo debug.xcscheme
                    foo release.xcscheme
                    xcschememanagement.plist
    fooTests/
        more sources

Are you fucking kidding me?

Groups aren't folders, they're just keywords grouped together until Xcode decides to fuck you over and disorganize them. To fight the project dump dir, I'd make a group, then add a subfolder, edit the group to reference the folder, and then I could create files in their own nicely-organized subfolder. There is of course no automatic name sorting, because that's a developer convenience and Xcode hates developers.

Test code couldn't be in the same folder as the code it was testing. So you'd edit a file, then edit a test file WAY over in a different tree. Good luck knowing how much coverage you had.

I especially love how foo.xcodeproj/xcuserdata/ and foo.xcodeproj/project.xcworkspace/xcuserdata/ have duplicate structures for develop & run/debug modes, because obviously the runtime and debug teams are separate and hate each other.

Icon Composer

In their ongoing efforts to break Mac development tools, Apple disabled and destroyed the rather nice Icon Composer.app because there's nobody left in-house who could figure out how to generate @2x images (protip: you use double size and rename it!), and now you have to use command-line iconutil with a set of magic filenames and no help.

So I wrote a little shell util, icontool.zsh:

#!/bin/zsh
if [[ $# -ne 2 ]]; then
    echo "Usage: icontool INIMAGE.png OUTFILE.icns"
    exit 1
fi
WORKDIR=$TMP/icontool.iconset
rm -rf "$WORKDIR"
mkdir "$WORKDIR"
sips "$1" --resampleHeightWidth 1024 1024 --out "$WORKDIR/icon_512x512@2x.png"
sips "$1" --resampleHeightWidth 512 512 --out "$WORKDIR/icon_512x512.png"
cp "$WORKDIR/icon_512x512.png" "$WORKDIR/icon_256x256@2x.png"
sips "$1" --resampleHeightWidth 256 256 --out "$WORKDIR/icon_256x256.png"
cp "$WORKDIR/icon_256x256.png" "$WORKDIR/icon_128x128@2x.png"
sips "$1" --resampleHeightWidth 128 128 --out "$WORKDIR/icon_128x128.png"
sips "$1" --resampleHeightWidth 64 64 --out "$WORKDIR/icon_32x32@2x.png"
sips "$1" --resampleHeightWidth 32 32 --out "$WORKDIR/icon_32x32.png"
cp "$WORKDIR/icon_32x32.png" "$WORKDIR/icon_16x16@2x.png"
sips "$1" --resampleHeightWidth 16 16 --out "$WORKDIR/icon_16x16.png"
iconutil --convert icns "$WORKDIR" --output "$2"

Preferably feed it a 1024x1024 input image, it'll resize all the others; the small sizes might be blurry but it's good enough for most uses, and you can edit the contents of WORKDIR and run the iconutil line again if you need to.

Non-Apple Development: Does It Exist?

By no means the first time I've seen this sentiment:

Still interesting to see people talking passionately about the Open Web and how bad silos are (which is good)
whilst simultaneously linking only to Apple things and app-locked things in general; the web is still here and
it damned sure isn’t exclusive to Apple and your phone.
@simonwoods

The thing is, Android, Linux, & Windows devs don't step up and produce good apps or attractive web sites, so what else would anyone link to?

I presume most of the non-Microsoft-employed Windows devs are in enterprise, doing something awful with SAP or Excel or Outlook; I'm not really familiar with their universe, but they certainly don't make a lot of nice end-user software, and they don't hang out on any obvious nerd sites. Are they ashamed to admit what they do? Do they not have Internet access? That 95% of the desktop computer market has a nearly invisible developer population is weird. There's some Windows game bros, eating C++ bugs and mostly being dicks to everyone, but they're not making end-user software (Coming soon: Call of Duty: Mind Mapping Edition!)

Linux devs do sometimes make end-user software, but it's unspeakably awful, like GIMP. Server-side, sure, there's plenty of systems, though I think not many people live and develop on it. My bias is admitted: I loathe Linux as though I were Edmond Dantès himself and Linux had imprisoned me (which in effect it did), and I have sworn eternal vengeance. But my impression is that most server software devs work on Macs, or rarely Windows, and use git or Docker uploads to get everything on Linux.

Android software is almost always made after a web or iOS prototype, and generally as an afterthought; nobody makes Android-first apps except basic system utilities like wallpaper-changers.

There is web-first stuff, including now cross-platform web tech, which could in theory be built on Linux or Windows; yet it seems that most end-user web devs making anything nice are, again, Mac users. If you have any aesthetic sense at all, if you want a nice UNIX environment but don't just work in emacs, it's the least terrible option.

There's an old joke,

"Never ask someone if they use a Mac. If they don't, don't embarrass them; if they do, they'll tell you."

This might be more true than it seems, maybe Mac nerds just talk about it constantly? But why don't others?

If you make end-user software for other platforms, I'd like to hear how, and why, and why it's so invisible?

Apple Music Feedback

Just sent in the following feedback, feel free to copy & send this, too:

Currently for songs and albums, you can mark them as "Disliked", but you can't mark an entire artist as Blocked, only Follow.

I want to extinguish ThWknd, Drake, and a bunch of other terrible "artists" from existence, never see them in my For You page, never be recommended them in any page.

Ideally once I Block an artist, they wouldn't even show up in searches or in your curated playlists.

Marzipan and Electron

Chris is missing the point of both technologies. And I'm sure not a brat Millennial.

Marzipan (candy frosting) is a legacy porting technology: Existing iOS apps can cost more to port to AppKit than they're worth, but may be worth something as a cheap Marzipan port. Nobody ports their iOS apps to tvOS or watchOS because it's not profitable, and everyone (in the first world with money) has an iPhone already.

I loved my UNIX® workstation Macs after suffering with Linux for a decade+, but Timmy Cook's Apple abandoned the Mac after Steve's death and Scott Forstall's firing. Anyone making new native Mac apps is in an abusive relationship: Apple does not love you, and does not care about the Mac.

I'd rather eat broken glass than run Linux again, and I have never and will never be a Windows weenie, but I'm not relying on Apple to support desktop developers ever again.

Apple's Mac apps have generally been shit for years now, because they won't spend the resources to develop & support their own stuff. iTunes is a bloated pile of crap, half-broken because it has to run on Windows, too; you don't like hybrid web apps? Everything except your library is web or XML rendering. Pages and Numbers were fast, minimally useful apps that got rewritten based on the iOS versions, and are just about useful for a memo or a chart, but not real work. Mail's a clusterfuck and not half as useful as when it supported more scripting and addons.

The new Mac commercials, first in years, show the broken-keyboard laptops and models they no longer make, nobody coding Mac apps, no desktop Macs. Where's that shiny "new" iMac Pro from last winter? Isn't that what a real musician would use? A near-blind photographer squints at a tiny Mac laptop instead of a giant 27" retina display?

This is how technical, developer-oriented Apple ads were in 2002:
apple_unix_ad-s

Electron and Node are the future (along with Elixir, Go, Rust, maybe others?). It's 100x faster and more fun (attach the FunMeter™ somewhere fun) to code in than Swift, you can use any good editor instead of fucking Xcode, do layout with HTML/CSS instead of the rotting corpse of Interface Builder trapped inside Xcode. And it's cross-platform; 95% of the users (even in the first world with money) don't run Mac, because Apple never updates the Macs, they failed utterly to follow-through with Macs behind iPhones. There's 20x bigger market potential.

The future is certainly not banging your head against the Swift and Xcode walls, just to make a pure Mac app nobody will see. You can't make fun of Electron's runtime, which needs Node and Chromium, if you use Swift, which has a giant runtime turd because their amateur hour C++ compiler nerds can't make a stable ABI. The Mac's only future source of native apps is Marzipan ports.

There can be performance problems in Electron, but Slack's an outlier at 196MB binary and devouring 1.2GB RAM(!!!); it's the bloated WalMart-shopping fat-ass of Electron apps. Discord is also Electron, it has a 136MB binary and uses 360MB RAM, and does more, faster and better than Slack. Atom is the original Electron, has a 541MB binary, and uses 600MB RAM, for an entire editor/IDE.

My game currently has a 139MB binary, and uses 200-300MB RAM when running. Comparing to a random casual game from my Steam library, Chainsaw Warrior (well, "casual"; I've only beaten it once on Easy). It's based on Unity (another VM!), has a 249MB binary, and uses 200MB RAM when running, plus Steam itself uses 130MB RAM (I may yet integrate Steam into mine, so that may even out). It doesn't seem excessive.

I can't compare my Swift game prototype from 3 years ago, because it was written in a version of Swift that doesn't compile in any Xcode that runs on current hardware & OS, and Xcode "helpfully" deleted the built binary; who needs working binaries, right? I might have an old Xcode on my old laptop? Maybe I could waste a couple days fixing the code by hand in current Xcode, if I hated myself or loved Timmy Cook's Apple that much?

New languages evolve fast, but I can run 20-year-old Javascript and it'll run thousands of times faster than it did in the '90s, because the language was improved with forwards-compatibility in mind, hardware caught up, and the newer VMs compile & run it faster. I can compile 30-year-old Objective-C, and it'll run.

We had something similar to web tech 20 years ago with desktop Java, but the convicted criminal organization Microsoft sabotaged it and made a shitty single-platform ripoff called C#. Viruses became a problem for applets, which had nothing to do with desktop Java, but killed Java deployment even before Oracle bought & ruined SUN. Android runs on another Java ripoff, but their dev tools and APIs are even shittier than Xcode or C#, and the users are poor, so why make anything for them? Server-side development in Java, Clojure, or Scala, running on the Java VM, is hidden away in a back room, and made as boring as possible.

So now we have to reinvent the runtime, this time with Node & Chromium. OK with me.

WWDC Prediction Gumbo

(I like gumbo more than claim chowdah, Ivar's on the Seattle waterfront is good but I prefer their fish & chips)

  • Predictions
  • iDeath: Dark Mode on the Mac. ✅
  • Item 0: Apple's best year ever: Shockingly silent. ❌
  • Item 1: Apple announces the end of mechanical keyboards: No hardware. Look for this later this year. ❌
  • Item 2: Apple announces the end of C, C++, Objective-C, AppleScript, Javascript, and Swift, in favor of a new cross-platform language: Workflow: Now called Shortcuts. ✅
  • Item 3: New Macs: No hardware. ❌
  • Item 4: Apple announces all-new game development tools: ARKit 2.0. ✅
  • streaming from a home server or iCloud Games server: No streaming. ❌
  • OpenGL is deprecated and then unsupported: Called it! Apple deprecates OpenGL and OpenCL. ✅
  • HomePod Hi-Fi: No hardware. ❌

Score: 4/9, which at least puts me in range of any pundit.

Fucking seriously, killing OpenGL is a pain in the ass. Unity and such will adapt easily enough, but MMOs and a lot of indie stuff uses OpenGL, and Metal may be too big a rewrite.

WWDC 2018 Predictions

Opening Video: Emotional music. Mortuary full of coffins. Crying mourners. THEN! Light shines from one casket after another: iDeath! The iPhone app that live-streams to and from inside your casket so your loved ones never have to let you go! SOMBER!

Item 0: Apple's best year ever, look at this literal mountain of cash and gold they can swim in like Scrooge McDuck, at the new Apple spaceship campus! KA-CHING!

Item 1: Apple announces the end of mechanical keyboards. If you filthy heathens in non-sterile, non-white-void rooms can't take care not to spill Coke (or coke), crumbs, hair, or microscopic dust particles into Jony IVE-1138's perfect butterfly switches, jamming them up, and then have the audacity to sue, then you just don't deserve them. All replacement and new-issue keyboards will be sealed-in, membrane keyboards like the Atari 400. COURAGE!

Item 2: Apple announces the end of C, C++, Objective-C, AppleScript, Javascript, and Swift, in favor of a new cross-platform language: Workflow, acquired last year. Kids and junior developers alike will love learning to code with easy visual blocks. Expert developers can eat shit and die use remote APIs to implement code on their own web server. SWEET!

Sub-Item: Apple is responding to Developer's Union by hiring the Pinkerton Agency. There will be no trials of any kind. BEATINGS FOR ALL!

Item 3: New Macs! Finally, the new Mac-itecture is here: ARM, iOS, with an Intel emulator that runs up to 20% as fast as a real Intel chip in this rigged demo. Available 2019 or 2020, they really want to get this right, so all existing Macs are EOL today. POWER!

Item 4: Apple announces all-new game development tools, streaming from a home server or iCloud Games server, just like Steam Link but, you know, for the children!, with Apple's 30% cut and no expensive $9.99 games, only "free" IAP games allowed. Obsolete native iOS games will be phased out over the next 6 weeks as OpenGL is deprecated and then unsupported, and Metal only supported on MacTruck platforms. BEEP BOOP (nobody at Apple has ever played a videogame, so this presentation's kind of awkward).

One More Thing: HomePod now supports stereo, a mere 87 years after radio, records, and movies went stereo. Surprise announcements of vinyl LP and 8-track addons for the HomePod Hi-Fi shipping this Fall, and another U2 album in your iTunes library today! ROCKIN'!

Quite a lineup you got there, Timmy Cook! Don't ask how Steve would run the company, you do it your way!

Engineering has determined that your bug report is a duplicate of another issue and will be closed

Filed a Radar (bug report) about Safari on Feb 28. They respond with the stock request for a sysdiagnose report. 10 weeks later, Apple sends the stock response that it's a dupe.

Apparently this mechanical conversation is under NDA, but I'll risk their wrath by saying I ended my bug report with:

Hi, Radar, it's been a long time since we talked, and it wasn't great last time, but I'm giving you another chance. Does anyone at Apple actually use Safari like real people use Safari, with multiple windows full of tabs? Maybe there's nobody left on the Mac/Safari teams, and I'm talking to the ether here.

The entirely automated responses don't disabuse me of this notion. Everyone in Apple may be WestWorld-style robot duplicates by now, for all I know.

Almost every other big company has a public bug-tracker; sometimes under NDA, sometimes "fuck it, we're doing it live!". I don't see how this wall of fear and ignorance Apple uses helps anyone; every Android sweatshop just copies the superficial elements of iPhones; Chrome is an awful, unusable pile of shit good only for playing Flash, but Google already copied and forked the open-source WebKit engine, there's no secrecy to be had!

Xcode is Flawed

"So, yes, Xcode is flawed. But is it fundamentally flawed? Is there some core concept — its multi-paned single window UI, its scriptable build system, the nature of app bundles and code signing — that makes it impossible for Xcode to ever be good? I don’t believe anyone is making this argument. The closest you get to this is storyboard haters who build their UIs in code. I disagree with that camp, but even if I didn’t, that alone is not enough to relegate all of Xcode to junk status."
Chris Adamson about his new book, Xcode Treasures

I like @invalidname, but wow do we ever not agree about this. I diatribed a bit yesterday, but let's look at just these claims.

The build system is basically a shell script but with a custom editor that's harder to use than typing. Did you know that most programmers are pretty good at typing? Most of my projects, in fact, just had a shell script "phase", and then I'd write everything in bash (I hadn't switched to zsh yet). It is no better than an old-fashioned Makefile or nmake, and for many projects a build shell script is enough. But, sure, this isn't the worst thing in Xcode.

Code signing is Hell, and Xcode's original version on iPhone SDK launch was appallingly hard, but it worked. Now they've automated it, which means you have 512 bogus auto-generated configurations on your ADC profile, and if the signing server is down (which happens… well, it's not even two 9s of uptime…), you can't do anything until some hours later when Apple plugs the server back in. Entitlements and services you turn on/off can permanently burden your app's configuration, until you go to the website and houseclean all the junk configurations and make a new one with just what you need. And that'll get replaced with an auto-generated configuration again.

Xcode does have a dozen or so color themes now, but you can't change the UI chrome from generic Mac gray, so it'll always be unpleasant to view dark-background themes, you can't choose different icons, can't script the goddamned thing. Meanwhile, here's Atom's 7556 packages including 2579 themes, and you can just hack on all of the editor in JS & CSS, live-updating your own tools.

I quit using storyboards except for nearly-blank launch screens, and XIBs (NIBs! We called them NIBs!) except as maximized view holders, because the corpse of Interface Builder trapped in Xcode's belly punishes you for using them; if you touch anything, your autolayout constraints go crazy. And you can't delete constraints in the view where you edit them, only in the tree view which isn't even visible normally, and is organized totally differently from the editor on the right. After a few versions, Xcode just can't edit an old project's XIBs anymore, and then you're FUCKED. Have fun recreating that entire UI, OR you can put it in code. And if you're writing code, why not just leave the walled garden and write HTML/CSS/JS like I do?

The one-window thing doesn't bother me, but the lack of functioning tabs is infuriating and stupid. Open three files. In BBEdit, all three appear in the sidebar, and you can switch with the top-left file selector or the bottom-left list of "Currently Open Documents", or other navigations; I prefer tabs, but it's entirely acceptable. In Atom or AppCode, all three appear as tabs at the top of the editor pane, and you can drag to reorder the tabs as you like; each tab is a unique single view into that file. In Xcode, you can open them in separate windows, or in separate "tabs", but the same file can be open in multiple places, but if you close it in one, it closes in all of them. WHY WOULD YOU DO THAT? If you click a file in the tree view, it replaces the contents of the current tab/window, it doesn't just open it in a new tab. So the process is click, double-click to get a window, then on the first view hit back and hope it goes to the right file. Flames on the side of my face!

Snippets. OH NO, I had a PTSD flashback to Xcode's Snippets. You write a piece of text you want to reuse. Select the text and drag it onto the Snippet area; you can't right-click or menu it there. No, you clicked on the background, now it's deselected. You have to reselect, click on the stroke of a letter in the text. Maybe zoom the screen in with ctrl-mousewheel, now you must grab a SINGLE MOTHERFUCKING PIXEL!!! Calm, deep breaths… and drag it to the Snippet area. 😡🔪🔪🔪 In Atom, you either copy-paste it into a config file, or install snippet-generator-plus, select text and hit a key.

Xcode isn't just accidentally hateful and awful. It must be the work of a malevolent intelligence to be this horrible. I've found a recording of the original design meeting for Xcode.

Spend a few days working in an IDE that doesn't hate you like AM hates Humans, and you'd kill anyone who tried taking you back.