Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The thing I have missed the most with Objective C is the lack of a code tidy/formatting tool. All Xcode can do is alter the indent on each line which isn't useful. Regular indent etc do not support the language. There is an uncrustify tool in various SO answers but it is a good example of how not to do things (eg by default it does nothing - there are no presets, it is very flaky).

I wish Google provided tidy tools with their style guides, or Apple did something with Xcode.



Have you tried JetBrains's AppCode? http://www.jetbrains.com/objc/

(I haven't but their RoR-tailored IDE RubyMine is the only IDE I've enjoyed using after it for less than a week.)


I haven't but I did look at the page as it was linked in the article. I never saw any mention of code formatting. An example of what I expect is like the Eclipse Source > Format option which will go in and make everything consistent including making lines less than 80 chars, adding space around operators (I never put in spaces which goes against almost every style guide), ensuring the arms of if/else always have braces etc.

I actually do most of my iOS development by running emacs on my Linux box and using sshfs to access the files on the Mac. I use command line tools for compilation/running/debug. I did originally start out using Xcode but it gets in the way of the coding. (My work involves a library that functions in the background and has no user interface.)

AppCode hasn't seemed worth the effort to investigate and $200 is rather a lot to spend on a code reformatter. (Also only running on MacOS makes it significantly less useful to me.)


AppCode does exactly the kind of source cleanup you describe. It also manages #imports for you, has better code completion, provides a more useful debugger, and gives you refactoring tools almost as good as those available for Java.

You can only do iOS dev on a Mac so I don't understand why you consider that an AppCode negative.

Considering how much my time is worth as an iOS dev the $99 I spent for a personal license is probably the best software purchase I've ever made.


I'm doing development at a startup which means minimal funding and a $200 license. My main development system is running Linux and I do development of client side Android and iOS, plus server side (mostly Python), web, database etc. AppCode only helps for one of those, and would be more valuable to me if it ran on non-Mac platforms even just as a better Objective C editor.

Note that I do do iOS dev on a Mac but I use a combination of emacs on my Linux box using sshfs and command line tools over ssh, plus Xcode when necessary. The product is a library with no user interface so this is actually more productive.

In any event it looks like I should try AppCode. Hopefully it won't have the flaw that stopped me with Sublime Text 2. SL2 didn't detect when a file had been modified outside the editor (eg by vcs or different editor) and happily overwrote the modifications!

I had briefly tried Xcode refactoring before giving up and using search/replace in emacs. One of the curses of multiple languages, client and server etc is that names sometimes end up wrong and need fixing to match local conventions.


FWIW, RubyMine does notice when a file has been modified on disk. If you have unsaved changes in RubyMine, it pops up an alert that lets you pick which to keep or to diff the two; if you don't have changes it just refreshes and shows the version on disk.


You sound like a busy guy!

In any event, AppCode is very good at picking up external modifications because that's how it integrates with XCode.


AppCode is $100.

$200 is you purchase a company license, which means anyone at the company can use it. If you are the only person using it, you only have to pay $100.


AppCode is $100 if you make the purchase using your own money and are not reimbursed in any way by the company. I try to keep work and personal stuff very separate and have no personal need for AppCode. $100/200 is still pretty steep for a code reformatting tool!

"If you, as an individual, are purchasing a product license using your own funds, then the personal license is right for you.

Personal licenses are not available to companies in any way or form. Transfer of personal licenses to any third party and/or reimbursement for personal license purchase by a company are prohibited by the Personal License Agreement."


Yes, I'm aware of this. I was simply clarifying the pricing is not $200, but $100 for a single-person license. There has been confusion in the past regarding this, people assuming that if you use one of their products for business, you must purchase a company license. Even if you only use AppCode for work stuff, you do not need to purchase a company license.


Late correction, I know, but Apple does not offer a $200 iOS developer program. Depending on which of their 4 iOS programs you choose, the costs can be free, $99, or $299. See https://developer.apple.com/programs/which-program/ for specifics. Most of the confusion I have seen is around the Developer Program (Company) and the Enterprise Developer Program.


We were talking about the costs of AppCode not any program offered by Apple.


AppCode is brilliant. Best $99 I ever spent on a development tool. It's worth it for the refactoring and #import management alone.


> It's worth it for the refactoring and #import management alone.

That is something Eclipse does out of the box! Apple really disappointed me with Xcode - it is actually less usable than Eclipse in my experience. This is not praise of Eclipse - it has many issues!


Xcode has refactoring support.


In my experience, it's extremely basic. Yes, it can rename a function or variable, but that doesn't compare to AppCode.

AppCode can do both of those. Want to add a new parameter to a function? AppCode can do that, and put in a default value for you everywhere. Signature modifications are a snap. Plus it searches for possible references to the function you're modifying and can suggest fixes for them too. That alone is with the $99.


I am totally satisfied with Uncrustify, and this is my Uncrustify's config for Objective C, in case you find it useful (Allman style): https://gist.github.com/940977


It took me about an hour to get uncrustify to actually work. Without a config file it makes no changes which is silly. I wanted it to modify the files inplace, and kept finding it creating numerous extra files but not actually making changes. Or sometimes it did but not again. I prefer my tools to be trustworthy, just work and not require babysitting.


You can use the Xcode "Run Script" build phases to automate the code format if you really need it (with Uncrustify's --no-backup option).

I agree Xcode should have this feature by default, but speaking for Uncrustify - it is reliable and always produce consistent output format. Anyway, it also took me more than an hour to configure it :)


Actually running uncrustify isn't a problem - I intended to make a shell script. What I wanted to do and have just work (HN won't let me use a literal asterisk so I used STAR):

uncrustify --inplace STAR.h STAR.m

I ended up having to download configs, deal with differences between the versions of uncrustify and configs, work out how to do inplace, get confused when it did it sometimes and not others, go "holy cow" when git showed all these extra files appearing (uncrustify does some sort of hashing scheme to avoid processing files seen before), trying to work out which files I could get rid of, finding it had put reformatted output in files with different extensions, trying to figure out what had happened, finding out that it doesn't autodetect headers as objc etc. And suspecting it may have problems if directories/files have spaces in their names.

I know it can work. I just don't trust that it will always work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: