Archive for August 1, 2017

Tuesday, August 1, 2017

NSProgress Shortcomings and CSProgress

Charles Srstka:

Unfortunately, the performance of NSProgress is simply terrible. While performance is not a major concern for many Cocoa classes, the purpose of NSProgress—tracking progress for operations that take a long time—naturally lends itself to being used in performance-critical code.

[…]

Furthermore, there’s no atomic way to increment the change count. To do so, one first has to get the current completedUnitCount, then add something to it, and then finally send that back to completedUnitCount’s setter, resulting in the lock being taken twice for one operation.

[…]

All of NSProgress’s reporting is done via KVO. That’s slick, right? You can just bind your UI elements, like NSProgressIndicator, directly to its fractionCompleted property and set it up with no glue code. Right? Well, no, because most classes in the UI layer need to be accessed on the main thread only, and NSProgress sends all its KVO notifications on the current thread. Hrm.

[…]

So instead of the main benefit of KVO—being able to bind UI elements to the model without glue code—we have more and much weirder glue code than we’d see in a typical blocks-based approach.

Overall, it seems like a terrific idea, but it’s unnecessarily difficult to use it well. His solution is a complete reimplementation, CSProgress, which bridges to NSProgress.

Moom 3.2.9

Many Tricks:

Moom now uses the entire display as the grid. You can still specify your grid dimensions, but you’ll be selecting regions of the entire display, instead of on a slanted hexagonal window. One advantage of this approach—besides not dealing with hexagons—is that you can drag a grid on any connected display, not just the display where the window currently resides.

I have been using the keyboard to summon Moom and then the arrow keys to move between displays and select the region for the window. But this new method is cool because you can just directly draw where you want the window to go.

Previously: Moom vs. the Rectangular Grid Patent.

Counterparts Lite 1.5

Michel Fortin:

Find & Replace lets you quickly change a word or phrases everywhere in a document. It shows you a nice preview of the changes. You can choose whether to apply the change or not for each row. And there’s a useful checkbox to automatically capitalize the first letter of your replacement text when the text it replaces begins with a capital.

Looks good.

Your Favorite Mac Markdown Editors

Josh Centers and Adam C. Engst:

In “Vote for Your Favorite Mac Markdown Editor” (20 July 2017), we asked you to rate the Mac text editors that you’ve used to write in the Markdown text markup language. Over 400 TidBITS readers responded to our survey of 42 apps, submitting nearly 2200 votes. As we thought might happen, BBEdit racked up by far the most votes and tied for the highest rating. But many other apps did well too, showing that the category has numerous entrants worth your time.

Markdown seems to be everywhere now.