[txmt-dev] Re: Not relaunch TM after a build
Jacob Carlborg
doob at me.com
Mon Apr 14 18:32:44 UTC 2014
On 2014-04-14 00:15, Allan Odgaard wrote:
> I have conventions about how to format my code because it makes it
> easier to read. Allowing to work with the code using simple text
> utilities is a bonus.
Of course, I do that as well. I have very strict guide lines. But not
because want to be able to use tools on the text.
> And making a tool (based on a language parser) that can answer the
> “questions” I have about my source code is infeasible, yet search works
> amazingly well, and can be applied to revision history as well, say I
> want to ask things like, “was this function ever called outside module
> X”?
I'm not saying that isn't useful.
> For me, asking where a thing is defined or called from is a subset
> of what I ask, hence why I never felt the need for a dedicated tool to
> answer that single question, as it would come with a different
> workflows, and while I may start by asking “where is this called”, I may
> extend it to “where is it called with ‘true’ as second argument” or
> similiar.
The tool should obviously be able to handle a lot more. Here's a list of
useful features that Xcode has based on libclang:
* Syntax highlighting. I'm not sure if Xcode does this but other IDE's
like Eclipse for Java does semantic syntax highlighting. That is, it can
highlight an instance variable differently compared to a an other variable
* Refactoring. Xcode only has renaming so far but other IDE's support
more features
* Go to definition. Finds the correct definition even for overloaded
methods, handle macros as well. I can't stress enough how useful this is
for a code base you basically know nothing about
* Autocomplete. Knows the context and take advantage of that. That is,
it will only show method available for the object of that particular
type. It can also sort (not sure if Xcode does this) based on the return
value:
int foo = object.ba|
Sort methods starting with "ba" and which returns "int" first. The
autocomplete list also shows the documentation rendered for each
completion suggestion. This is also a very useful feature for unfamiliar
code bases. I basically learned the Java API's with the autocomplete in
Eclipse
* Inline errors/warnings
* Fix-it. For simple errors Xcode can show suggestions how to fix the
errors. Clang does this on the command line as well but when it's
integrated in to Xcode it makes it very convenient by just clicking a button
* The same library is used by both the IDE and the compiler, meaning
they'll always be in sync
Not related to Clang but:
* Inline git blame and history
* A nice split view for comparison of the history
And a lot more. You should really try Xcode, just to see what the
competition has to offer. Actually, in general, I think it's almost
irresponsible to not know ones competitors.
> I’d also like to point out that a lot of things rely on naming or
> formatting conventions without people calling it a tooling failure
> (often the opposite). Take something like ARC, it relies on Cocoa
> methods starting with ‘init’ or ‘new’ to return retained objects.
I think Objective-C has many flaws. This particular case would probably
have been better with some form of annotation or attribute attached to
these methods.
> I would be happy to learn about better workflows, that is why I asked
> you why you felt Xcode was better for working with the TextMate source
> code (as a non-Xcode user myself).
Ok, cool. In general I do prefer TextMate when it comes to text editing
and source control. But in this case Xcode has some really useful
features that I miss in TextMate. Since I don't work so much on this
code base I prefer to use TextMate. Most of the time is spent on reading
source code and exploring.
At work, where I'm using Ruby eight hours per day, I use TextMate and
could probably not use anything else. I have tried RubyMine, an IDE with
many features mentioned above. I liked the accurate autocomplete and go
to definition, I was even surprised that they work so well for Ruby. But
I couldn't stand the rest of the editor. The snippets, commands and
other stuff in TextMate is hard to beat.
--
/Jacob Carlborg
More information about the textmate-dev
mailing list