I Tried AppCode so You Wouldn’t Have To

Posted 8 years, 21 weeks ago.

Today’s episode of Mobile Couch is basically the story of my experience using JetBrains’s AppCode in the last few weeks. I had so many notes for the episode (which seriously never happens, I’m lucky to have half this on a normal episode). So I figured, hey, why not throw this up on my blog?

And here we are.

This is by no means a COMPLETE review. I tested under my typical working conditions, as part of my “normal” workflow, which differs from person to person. If any of these features sound enticing, I suggest downloading the trial yourself and using it for at least a week. Your experience might be different!

Oh lord, it looks like Eclipse. SPOILER ALERT: If I could have some of these additional features from AppCode in Xcode, I’d choose the latter in a heartbeat based on looks alone.

The editor itself is super-customisable. You can:

  • Font and syntax highlighting colours -If you like your syntax highlighting theme in Xcode, you can quite easily import it.
    • Preferences > Editor > Colors & Fonts > Import From Xcode
  • Anti-aliasing type (sub-pixel, greyscale or none)
  • Code style rules that get enforced
  • Documentation browser used (browser, Dash or Ingredients)

Some of these are project-independent, which is awesome if you need that, but careful that you don’t apply a change thinking it’ll be changed everywhere when it isn’t.

Overall, I love this aspect of AppCode, as it means I can get the editor to exactly the way I like it.

Inspections in AppCode are basically a series of linter-type rules, or an extension to Xcode’s static analyser.

Inspection errors show up down the right-hand scrollbar (intermingled with version control notes), and as squiggly red underlines and yellow highlighting. None of these stop from building or debugging (build errors and warnings don’t seem to be reflected in the editor at all, but instead show as lines in a panel at the bottom).

Inspections are really useful when they are accurate. When they’re not, they have a tendency to obfuscate real issues in code, like trying to find a needle in a box of pins.

My first-run experience on the GIFwrapped codebase was a nightmare because of inaccurate “inspections”.

  • Strings “missing” from localisation (which is “unknown”, apparently)
    • Highlighted in yellow
    • Solved in the latest update.
  • Not being able to resolve headers or modules (which are fine, UGH)
    • Red, dotted underline
    • Sometimes shows an error, sometimes
  • Classes, protocols, and methods not visible (particularly frustrating, clutters everything up)
  • Suggestions to use shorthand for arrays and dictionaries (Reasonable)
    • Highlighted in yellow.

This got the best of me, so I ended up moving back to Xcode to complete the task I was actually supposed to be working on.

Made another attempt using my open source Melissa project, which is FAR simpler in regards to dependencies and code base.

  • Swift.
  • 6 classes total.
  • A single OSS dependency (StaticTables).
  • No CocoaPods.

By this time, JetBrains had released an update which solved at least one of the issues I’d encountered (missing localisations). Many of the others are side stepped because the project is potentially set up differently (no issues with classes or methods not being visible).

  • Code folding is unavailable now (no handles in the gutter, keyboard shortcuts and menu items don’t work).
  • External library classes still seem to be invisible, but are simply not highlighted now.

The good thing about this is that AppCode is obviously being worked on really hard, and people are paying a lot of attention to it. The issue tracker is essentially an open forum, so you can go looking for your issue, and if you do file something, the support team will link you to any existing/related issues.

The problem is that these issues mess up my workflow just enough to make me unproductive (I spend my time fixated on bugs instead of writing code), and it seems to keep happening to me, which doesn’t make for a fruitful trial period.

It also adds a seed of doubt in my mind. If I’m struggling to figure out something (like some things I’ll highlight later), I don’t know if it’s a limitation, or a bug, or maybe I just haven’t figured it out yet? This sort of thing gradually goes away, but it’s disconcerting, and can be a barrier to really feeling comfortable in the new environment.

Nevertheless, let’s try and set this aside so we can get to the good stuff.

A few cool tricks while writing code:

  • Swift refactoring
    • This still seems less robust than with Obj-C, but can at the very least do the basics (unlike Xcode)
  • Code style can be adjusted in Settings, then applied to a file with Code > Reformat Code
    • Also configure and preview with a selection of code in the editor using lightbulb menu
    • Pretty sweet, I do wish Xcode had this (properly, I mean)
    • Still somewhat limited, but who’s counting?
      • I personally like “if condition return”
      • Function parameters show on new line, i.e. (action) in
  • Click+drag on left gutter to select lines. This is so simple, but I miss it so much in Xcode.
  • If your class conforms to a protocol, you don’t have to type all the method implementations out by hand: Code > Implement Methods…
  • Similarly for subclasses, you can generate method overrides: Code > Override Methods…
  • External documentation for a selected method/class/etc. can be triggered with a keyboard command (default is Control + Option + Command + /)
    • Smart enough to detect the init method you’re invoking, etc.
    • Unrelated, but annoying: this keeps triggering my loupe (normally active when Control and Option are held)

Running on-device or in the simulator is a different experience:

  • Run is basically “run sans-debugger”. Like if you simply launched the app normally.
  • Debug is a seperate button (Xcode just calls this “Run”)
    • Debug tools show at the bottom in a panel that pops up. It’s laid out differently to Xcode’s, but is the same concept.
  • When execution is paused (like with breakpoints), property values are displayed (in a greyed out state) in-editor alongside property declaration, which is actually really handy (I know you can hover to get values in Xcode, but this reduces the steps for doing so).
  • You can totally use the Reveal plugin (which is basically offered when you install AppCode) to inject the reveal library on launch! OMG! No need to manually add it to your project.

You’ll still need Xcode to fill in the gaps, and JetBrains all but recommends having them open side-by-side.

  • Debugging extensions doesn’t appear to be a thing with AppCode.
    • Just launches the app.
    • You can theoretically configure AppCode with an alternate executable.
  • Anything to do with project settings is way easier in Xcode.
    • Capabilities? Resource Tags? Build phases? I couldn’t find any of these.
  • Toggling header visibility (i.e. Private, Public, Project)?

It takes a really long time to get fully situated within a new IDE (I still don’t know all the ins and outs after roughly a week of use). You spend so much time in one that it’s not unlike moving house. Switching is a commitment, and you almost need to know that you’re going to prefer it before you actually make the move.

Moving to a “non-standard” IDE has the added weight that you’re potentially alone. It’s comparatively easy to Google issues with Xcode (things like how to set things up, how to adjust this or that), but this seems more difficult with Appcode. This sounds like a con, and it can be looked at that way, but it’s more of a general note: making the switch will probably require actual effort.

Overall, AppCode is a positive experience. There are certainly parts I like: code style/formatting, the extent you can customise the editor (OMG anti-aliasing!), some of the additional refactoring abilities. That said, I’m not sure I’d move to it full-time at this point: using it on GIFwrapped is completely untenable, and the issues I encountered make it feel like it’s still immature. Maybe I can revisit it in a few months, and see how it measures up.

Licenses are subscription based, $89/71/53 for individuals, or $199/159/119 per user for businesses (steps represent successive years, 3rd is ongoing).

  • Can be licensed monthly for 10% of the first year’s cost per month.
  • License variations are available. Check the site for more.