Category: SmartGo

My Path to Swift

After some experiments with Swift, I’ve been spending an increasing amount of time on a new project written completely in Swift. (Project to be revealed in due time.) Faster development, fewer bugs, and more fun — I’m hooked, and I don’t want to go back.

With the open source announcement of Swift delivering everything I wanted and more, there’s no reason to go back. Swift will be my main language for the next decade.

My programming language history

Most of my career has been focused on two large code bases, PowerPoint and SmartGo, and just a few programming languages. These languages have paved my path to Swift.

6502 assembler: After the TI-59 pocket calculator, my first real computer was a KIM-1. With a blistering speed of 1 MHz and a whole 1KB of RAM, that was an amazing machine. I squeezed my first Othello program into that computer, and learned a lot about performance and knowing every bit.

Modula-2: After some Pascal on Apple II, my time at ETH Zürich and UNC Chapel Hill was spent with Modula-2, first on the Lilith and then on the Mac. The original Smart Go Board for Macintosh was written in Modula-2. With the strong influence of Niklaus Wirth, I got drilled in the fundamentals of strong typing and modularity.

C++: When I started at Microsoft in 1991, most of the PowerPoint code was in C, with some Pascal in Mac-specific files (PowerPoint originally started as a Pascal program on the Mac). Over the next several releases, piece by piece, we successfully rewrote the whole program in C++, completely object-oriented. Both speed and memory usage were critical, and we learned how to use a subset of C++ to achieve high performance. (At one time, six of the twenty developers on PowerPoint had a connection to ETH Zürich — the Swiss influence was strong on that team. Still is.)

Once I left Microsoft in 1999 to work on SmartGo, C++ on Windows was the natural choice. C++ worked really well for Go, from fast low-level bitset operations to object-oriented UI code. But Vista pushed me over the edge and back to the Mac.

Objective-C: The Mac version of SmartGo got interrupted when Apple opened the iPhone for development. Keeping the base code in C++, I added the UI for SmartGo on iOS as I learned Objective-C. Seven years later, I’ve written a lot of Objective-C code, but it’s not my language of choice. The lack of type safety, the convenience of nil objects hiding potential errors, the need to avoid dynamic allocations and message passing in tight loops: these all worked against my nature. And having to interface with Go-specific code in C++ kept me from taking advantage of the full power of Objective-C.

Swift: With just a few months of Swift experience, it’s already clear that it gives me the building blocks for writing fast, high-quality software for the game of Go. It has strong typing and performance rivaling C++. It supports operator overloading (useful for bitset operations in Go) and generics (useful for arrays indexed by .Black and .White). Unicode string handling is a godsend for a game that originated in the Far East. Value semantics. Returning tuples. No crazy block syntax. Functional programming. And good riddance to semicolons.

I’m still in the early stages of learning Swift, and I’m already writing code better and faster than with the subset of C++ I had been using for 20 years. Did I mention it’s more fun too? So to me, it’s a clear choice.

Moving forward

I know where I’m going: my apps are transitioning to Swift. I know the first step: a separate Swift project to help me master the language and build up some base modules. After that? It will take me a while, but I will figure it out.

Transitioning a large code base is risky and never easy. I have no illusions that this will be simple. (Moving PowerPoint to C++ was good practice, but also a warning.) The fact that Swift doesn’t interoperate with C++ makes it harder. And it all has to be done while keeping the existing apps healthy and customers happy and dealing with any other curve balls Apple throws my way.

Yes, this will slow down development on my Go apps for the next years. It’s a risk I have to take: I’ve worked on these apps for fifteen years, and plan to work on them for many more. As an indie developer, I need to invest in my apps and in myself.

Quick Actions and Side Matching

SmartGo Kifu now supports split view on the newest iPads running iOS 9, so you can run it next to Safari, Notes, or even Go Books. And in addition to numerous UI refinements, there are two new features.

Quick Actions

On an iPhone 6S or 6S Plus, deep press on the app icon to see two Quick Actions:

Blog quick actions

  • Empty Board: Creates a new game in My Games. You can then quickly enter a position or analyze joseki, for example.
  • Random Game: Goes to a random game in the library of 84,000 pro games. Just one more click and you’re watching a pro game on auto-replay while waiting in line.

Side Matching

Joseki matching has been extended with the ability to match a whole side of the board.

Blog side matching

This lets you match popular openings like the low Chinese opening or the sanrensei. It also gives you more context to see how pros handle a joseki in relation to another corner.

As with joseki matching, tap on the matching stats to see a list of the games matching that position, then explore how those games typically develop from that position.

Side matching is also supported in the Mac version.

SmartGo for Macintosh

It’s been a long road. But today you can download an early beta version of SmartGo for Macintosh.

I know a lot of you doubted this day would ever come. I’ve been promising a Mac version since practically forever, and it kept not happening. Sorry about that. Some history is in order.

Smart Go Board for the Macintosh was released in 1987, with frequent updates until I joined Microsoft in 1991, where I worked on PowerPoint until 1999. SmartGo for Windows was released in 2002; Windows Vista finally pushed me over the edge and I switched back to the Mac in 2007.

So in early 2008 I had made good progress on the Mac version, but was running into issues with the cross-platform approach I had started with (using wxWidgets). When Apple announced the iPhone SDK, it seemed like a great way to gain experience with Objective-C development before getting back to building a fully native Mac version. I knew I wanted thousands of pro games in my pocket, and figured other Go players would too; I had no clue it was going to take off as it did.

So in 2009 I added computer play, and more games, and then had some time to work on the Mac version again. And what does Apple do in 2010? They announce the iPad. SmartGo Kifu was born, available on day one. A big success, but that first iPad version demanded a lot of rethinking and refinement.

The iPad also inspired a new way to visualize annotated games: book view. That gave me this crazy idea of putting Go books on the iPad. Basically, I wanted to read “Invincible” on the iPad; I had no clue that a few years later I would end up with a new file format and 100 Go books. (And no time to work on the Mac version.)

Turned out it made sense to split off Go Books for the Mac as a separate app, and that actually shipped a few months ago. Which finally left some time to make significant progress on SmartGo for Macintosh.

So is the Mac version done yet? No. But it has gotten to the point where it’s useful to me. Getting it to a 1.0 release will take time, as there are many big and lots of small issues to work on, and I still need to keep updating the iOS versions as well as Go Books. Meanwhile, I want to give you the opportunity to use what I have so far.

As promised, the Mac version is free if you already own the Windows version. The two platforms are bundled: buy one, get both. So if you’re already using SmartGo for Windows, and now have access to a Mac, just download the Mac version and start using it. (If your email has changed, let me know.) If you’re new to SmartGo, take the 15-day free trial for a spin.

The Mac version inherits the GoGoD game collection and the problem collection from SmartGo for Windows and SmartGo Kifu. It inherits the tree view and joseki matching from SmartGo Kifu. It adds built-in access to Kogo’s Joseki Dictionary. However, there are still significant holes; for example, there’s not even a way to edit game info yet. Over time, those holes will be filled, and more of the advanced functions from the Windows version will make their way to the Mac. (Some, like playing on IGS, will remain Windows-only.)

It’s still a long road ahead. But now you can join me for the rest of the journey.

Minutes for Go

One of your New Year’s resolutions may be to study more Go. If you can sit down for hours with a board, perfect. More likely, you’ll just have minutes here and there. Take advantage of SmartGo Kifu to use those moments for Go.

Replay pro games

  • Pick a random pro game. (Tap the Go to Game icon at the top left of the game list, choose Random Game.)
  • Turn on automatic replay, maybe 3 seconds per move.
  • Pause replay as necessary to think about what’s going on.

Guess next move

  • Pick a random pro game (see above). Maybe filter games by your favorite pro first.
  • Turn on Guess Next Move. (Tap the Tools button in the lower left of the board, choose Guess.)
  • Try to figure out where you would play. SmartGo Kifu will give you feedback: right move, right move but wrong timing, right area, or not even close.

Study problems

  • Pick a set of Go problems at your level.
  • Start working through them.

Study joseki

  • Pick one of your recent games in My Games. Replay to a corner position you’re wondering about.
  • Turn on joseki analysis for that corner. (Tap the Tools button in the lower left of the board, choose Joseki.)
  • Check out what moves professionals have played in that position.
  • Explore how games with that joseki typically develop from there. (Tap on the joseki stats at the bottom to see the list of games matching that joseki.)

Study fuseki

  • Tap on the New Game button above the My Games list, choose New Empty Board.
  • Turn on fuseki analysis. (Tap the Tools button in the lower left of the board, choose Fuseki.)
  • Explore your favorite opening.

Read biographies of pro players

  • Tap on the Players icon above the list of pro games.
  • Tap on a player name.
  • Read John Fairbairn’s mini-biography for that player. (You can also see these biographies by clicking on a player name above the board.)

And Go Books adds many more opportunities to study on the go, both problems and games.

Happy New Year!

SmartGo Pro: End of the Line

In the continuing saga of SmartGo Kifu (universal) and SmartGo Pro (iPhone only), it’s time to terminate SmartGo Pro — again. The timeline so far:

Experience with upgrade bundle

In a sense, the upgrade bundle is working. Over the last two months, upgrades have increased slowly, with income from the upgrade bundle now averaging 40% of Kifu income. It gives users a fair price to upgrade from the iPhone-only to the universal version. Upgrades so far are less than 1% of the installed base of SmartGo Pro, so there are still many users who could benefit from this upgrade, and I’d love to keep this going.

However, the number of returns has increased dramatically, indicating that people are confused and buy the wrong version by mistake. With only Kifu in the store, the return rate was 0.5%. After adding back Pro earlier this year, the return rate was 1% for Kifu and 5% for Pro, already an indication that separate iPhone and universal versions are not ideal. After adding the upgrade bundle, the return rate for Kifu shot up to 8%, and for Pro it’s at 66%! That’s terrible. I created the bundle to give existing users a fair way to upgrade, but it’s adding too much confusion for everybody.

With the iPhone 6 Plus blurring the line between phone and tablet, and Apple giving a solid clue with the introduction of size classes in iOS 8, it’s time to focus on universal apps going forward.

If Apple at some point allows upgrade bundles without having to keep the original app in the App Store, I’d be happy to bring back the upgrade. But at this point, I can’t recommend bundles as a workable solution for upgrades.

Last chance to upgrade

Before I take SmartGo Pro and the upgrade bundle off the store, I want to give you a last chance to upgrade. For the next week, the upgrade bundle will be $16 — if you bought Pro at $13, you can upgrade for just $3. And SmartGo Kifu will be on sale for $15 (25% off). Grab this chance before it’s gone.

Upgrade from Pro to Kifu

Apple has approved a bundle that contains SmartGo Kifu, a universal app, and SmartGo Pro, the iPhone-only version of SmartGo Kifu. This is great news, as it finally gives users an upgrade path from iPhone-only to universal. (See my reasons for reviving SmartGo Pro earlier this year.)

Users can start with the cheaper iPhone-only version, and if they later decide to get an iPad, they can upgrade for $10 instead of paying full price:

  • SmartGo Pro: $12 (iPhone-only)
  • SmartGo Kifu: $20 (iPhone & iPad)
  • Bundle Pro & Kifu: $22 ($10 to upgrade)

I’m very encouraged that Apple allowed this bundling of an iPhone-only and a universal version of essentially the same app. The bundle is clearly marked as an upgrade from Pro to Kifu, so I hope it’s an indication that this is an officially approved way of doing things. In particular, it gives developers who currently have separate iPhone and iPad versions a way forward: make the iPad version universal, and give users a bundle to upgrade from iPhone-only to universal.

On the other hand, if this bundle had been rejected, it would have been hard to not see it as an indication that iPhone-only apps were strongly discouraged, and that there was not going to be support from Apple to help users transition to a universal app. I would likely have killed SmartGo Pro rather than have more users stuck in a dead end.

Thanks to Apple for approving this kind of bundle: a win for customers, and more options for developers.

Go Congress 2014 in New York City

At the Go Congress, I played and recorded my tournament game in the morning, got it analyzed after lunch, then entered the analysis and comments, and finally tweeted the result. Of course, all this using SmartGo apps on iPad and Mac: a great opportunity to find bugs and identify rough edges. Here are the games:

I’m happy with the final score of four wins and two losses; not always happy with my play, but I learned a lot. Getting the games analyzed by professionals (including SmartGo user Xie He 9 dan) is a valuable benefit of the Go Congress: no matter your strength, they will deconstruct your games and make your mistakes painfully obvious.

The Go Congress was also a great opportunity to meet many SmartGo users, including Ben Hong (@bengozen) and Nate Eagle (@neagle) who I had only known on Twitter before. I got lots of good feedback on how you were using the apps and what issues you run into.

I hope to see many of you at the Cotsen Open (October 25-26) in Los Angeles!