Tag: Xcode

A Month with Mac Pro

I’ve now enjoyed my Mac Pro for over a month. Why did I decide on that computer, and how is it working out?

iMac

My late-2014 5K iMac was five years old: it still worked, but was increasingly limiting. The internal 500 GB SSD was too small, and even with the external 1 TB SSD I kept bumping into limits, wasting time cleaning out cruft. Ports were another issue: no USB-C ports, not enough ports in general, and I have yet to find a 100% reliable USB hub. The retina screen is still perfect, and my wife will likely get many more years out of this computer, but as a daily developer workhorse, it was getting long in the tooth.

I was sorely tempted to upgrade to an iMac Pro two years ago. However, while the current iMac Pro might be a great choice for many developers, for me it had a few drawbacks:

  • GPU not upgradable: I’d have to decide up front how much to invest in this rapidly evolving technology.
  • No way to drive the non-XDR 6K monitor that Apple is surely going to release any year now.
  • Ports not future proof: Thunderbolt 3 / USB-C will remain relevant for many years to come, but new standards will surely emerge in the next decade.

My apps

I’m a developer, not a video professional, so the case for a Mac Pro is not as clear-cut. My main work right now is on the all-new version of SmartGo, about 70k lines of Swift and growing. The shipping version of SmartGo for Windows is 166k lines of C++; SmartGo Kifu is a mix of C++, Objective-C, and Swift. So while there are other tasks that benefit from a multi-core CPU (e.g. running Go or Othello simulations overnight, or converting 140 Go books to ePub), speeding up Xcode builds is the main benefit.

Modern Go programs are based on neural nets, which benefit a lot from a powerful GPU. However, my current development focus is on user interface, not on stronger play, so with GPUs still improving rapidly, I want to delay investment in a powerful GPU until I really need it.

Specs

Basically, I maxed out SSD and CPU (within halfway reasonable budget constraints), and plan to upgrade memory and GPU as needed.

  • 3.2 GHz 16-core Xeon W, turbo boost to 4.4 GHz: Slightly slower than the 12-core, but turbo-boost speed is the same.
  • 48 GB RAM DDR4 ECC at 2933 MHz: I figured this would be plenty for a while, and so far memory has not been an issue.
  • 4 TB SSD: I don’t want to keep bumping against that limit.
  • Base GPU: More than powerful enough for what I need now.

In addition, the expandability of the Mac Pro may lead me to:

  • Add more ports: If I need more USB ports, or some other port comes along that is helpful, I can just add a card for that.
  • Add internal SSD: I currently have a 2 TB SSD hanging off the internal USB port (for nightly backups); when I need more, I can add a PCI card with extra SSD storage.
  • If/when Apple switches to ARM, it’s conceivable that Apple would create a card with an ARM processor for the Mac Pro.
  • The unknown: Having PCI Express card slots available keeps options open for the future.

I expect the Mac Pro to be reliable for many years, and if something goes wrong, it will be easier to repair than a computer crammed behind a large screen.

Monitor

I’m used to dual monitors: a 4K monitor next to the 5K iMac (a Dell P2415Q 24-inch 4K monitor, which is surprisingly good). I’d love a 6K monitor, but the 6K Pro XDR is not for me. The iMac is overdue for an SSD-only update and visual refresh, and at that point it would make a lot of sense to also release standalone screens in the same form factor. However, Apple’s timing is famously unpredictable, so I decided to go with the LG 5K for now to avoid being dependent on Apple’s plans. If they do release a 6K monitor for mere mortals, I’d be happy to replace the 4K by a 6K screen.

Performance

For developers, staying in the zone is crucial, and being able to reduce the build-run-debug cycle has really helped. Compared to my old iMac, build and run speed has improved by a factor of 2 to 3, and build times have become much more predictable. For my 70k lines of Swift, launching on an iOS device (connected by USB) after a small change takes 6-7 seconds, and a full build takes less than 30 seconds, more than good enough. I feel like I’ve gotten a lot more done this last month than in prior months.

Price

Yes, it was a very expensive machine, but I do expect to get at least 7 to 8 years out of it. (I got 7 good years out of my 2006 Mac Pro.) The 6% cash back when buying with the Apple Card before December 31 helped; also, if you’re in the market for a Mac Pro, make sure you talk to the business rep at your local Apple Store to see if you can get a discount.

Summary

A month in, the Mac Pro has been everything it was supposed to be: fast, reliable, silent, unflappable. It looks gorgeous, but I hardly even notice it – it just sits quietly below my desk helping me focus on my work.

Multi-Cursor Editing in Xcode 10

Multiple selection support in Xcode 10 is amazing. In previous versions, you could hold down the Option key to select a column of text, but you couldn’t do much with it. In Xcode 10, typing in such a multi-selection finally does the right thing: your text goes into each selection, so you can update multiple places at once. This alone really speeds up editing. But until recently, I had missed that multi-selection support goes far deeper:

  • Shift-Control to add selection: Hold down Shift and Control while clicking or dragging to add a new selection. So if you need to make the same edit in multiple places, just select each one, then start typing and make all the edits at the same time.
  • Option-Command-E to add the next occurrence of the current selection: If you already have something selected that you were going to type over, use Option-Command-E as needed to add selections at other places where this occurs, and edit just once.
  • Move multiple selections: As you’re editing, use the arrow keys to move multiple selections in unison; use Option to move by words, use Control to move by subWordsLikeThis (you may need to turn off System Preferences > Keyboard > Shortcuts > Mission Control > Move left/right a space).
  • Copy/paste: Create multiple selections, Copy, set multiple insertion points, Paste. Works like magic.
  • Use Find to create selections: Look in the Find menu for more tools. For example, Select All Find Matches and Select Find Matches in Selection let you set up multiple selections based on your search text.

This can all be accomplished by other means, but multiple selections fit naturally with the way I work, and don’t require extra mental effort or a context shift. This feature has been invaluable in moving some code from C++ to Swift. Thanks to the Xcode team for getting this right.

Happy editing!