Tag Archives: jetbrains

IntelliJ IDEA: the best IDE for programming Android?

Late last year the JetBrains team released IntelliJ IDEA 12, the latest version of its Java IDE.

Java today has many roles, but two dominate. One is server-side programming using one of many Java application servers, while the other is coding Android apps. IntelliJ IDEA has the former role well covered, though this is the first release with full support for Java 8, but Android development is less mature, though it seems to me that it has now come together.

The big new feature for Android is the inclusion of a visual user interface designer. Standard Android layouts are defined in XML, and the IntelliJ IDEA tool is a two-way designer that lets you flip between visual and code views. I found it to work well.

The starting point for an Android app is the New Project dialog. This hooks into the Android SDK installed on your machine. In this example I am using Android 4.1 “Jelly Bean”.

image

Next, you select a target device (actual or emulated) with the option to create a “Hello World” activity as a starting point. The project then opens in the IDE.

image

It is not obvious how to get from here to the new UI designer. The New dialog will not help you.

image

What you do is to hold down Control and click the word main in setContentView(R.layout.main).

image

The default layout is a LinearLayout. If you are making, for example, a calculator, you probably want a TableLayout or GridLayout. I found it useful to be able to flip between text and design views. The design view can save a lot of typing. The text view is excellent when you want to see the exact code and perform text operations like copy or search and replace.

image

I was surprised not to find an instant way to create an event handler (unless I missed it) but this is easily done in the editor. With IntelliJ IDEA, it is always worth pressing Alt-Enter as this will offer a prompt of potentially useful actions.

image

I hooked up an event listener and was able to set a breakpoint and debug my app:

image

Is this the best IDE for Android development? There is the mighty Eclipse of course; but while Eclipse can do most things, I am not surprised to see comments like this:

Usability: Intellij user experience is much easier to grasp. The learning curve in Intellij is by far faster. It seems using Intellij makes developing easier and more natural. Dropdowns, code completion, quick view, project wizards, etc, are all possible both in Eclipse and Intellij, but the experience in Intellij is much more satisfying.

That said, Eclipse is completely free, whereas the free Community Edition of IntelliJ IDEA has limitations – but as far as I can tell, Android support is included.

Review: JetBrains AppCode for Objective C

I have been trying out JetBrains AppCode, a new IDE for Apple’s Objective C. The company is best known for its IntelliJ IDE for Java, and AppCode essentially takes the same core IDE and reworks it for Objective C. AppCode is itself a Java application, but unless you have a religious objection to this I doubt you will find it a problem: I found it perfectly snappy and responsive on my machine, a 2.3 Ghz Core i5 with 8GB RAM.

Installation was a snap, as Mac users expect.

image

One thing I discovered immediately is that AppCode is not a replacement for Xcode, the official Apple IDE. The Apple SDKs are delivered with Xcode, and AppCode requires it. An AppCode project is also an Xcode project.

image

This is particularly important if you want to use Interface Builder, the Xcode visual designer, since AppCode has no equivalent. Double-click the .xib file and it opens in Xcode. This is a disorientating at first, but in practice I found it convenient to be able to switch between the two IDEs.

So why bother with AppCode, when Xcode is free? It is certainly not essential, but my view is that tools which save time or improve quality are worth the investment. Whether AppCode will do this for you will depend on how you work and whether you have any frustrations with Xcode, which improved considerably in version 4. Out of the box, Xcode has integrated Git or Subversion source code control, unit test integration, refactoring including Rename, Extract, and Encapsulate, the aforementioned Interface Builder, and a ton of other features. Sticking with Xcode is a safe choice.

That said, AppCode feels leaner and less cluttered than Xcode. It also has many additional productivity features in the editor. JetBrains’ IDEs are well known for refactoring, and while AppCode is not as rich as IntelliJ IDEA in this respect, it does have a more than Xcode.

Another strong feature is code generation. Press Command + n in the editor, and a context-sensitive Generate menu offers various time-saving options. I like the way I can type a new method in an implementation file, press Alt + Enter, and select Declare method in the interface to add it automatically to the interface file; or type it first in the interface and have it implemented automatically. It pays to learn the keyboard shortcuts

Live templates let you type an abbreviation and expand it to a block of code, which you then tab through to edit. Type for, select the template, press tab, and AppCode will create a for loop; press tab again to edit the variable name and the number of iterations. You can customise and create your own Live templates in the AppCode Preferences dialog.

image

There are also a ton of performance tools in AppCode [update: note these are links to Xcode tools].  Choose Profile from the Run menu and choose what you want to analyse:

image

then run your app

image

You can also do static analysis according to customisable rules.

There is a debugger which works as you would expect including stack trace and variable inspection.

The best thing I can say about AppCode is that it is a pleasure to use. It does not throw up unnecessary dialogs, it works logically, and the tools are easy to use and configure. I have not always found this to be the case with Xcode, and if you spend a significant amount of your time on Objective C development then I recommend grabbing the trial download to discover if it will speed your work.

Post sponsored by Monster for the best in IT Jobs.

ReSharper 6.0 arrives: intelligent editing and decompiling for Visual Studio

JetBrains has released ReSharper 6.0, an add-on for Visual Studio 2008 and 2010 that delivers a remarkable range of tools, mostly focused on code editing and static analysis. There is also a unit test runner and a source code decompiler.

The heart of ReSharper is refactoring, hence the name, and it adds a large number of refactoring options to Visual Studio. These are nicely integrated with the editor, not only as right-click menu options, but with light-bulb suggestions that appear automatically. Here, for example, ReSharper is telling me that I could use implicit type declaration, and offering to make the change for me, or alternatively to suppress this type of suggestion forever if I do not like it:

image

Source code decompiling is also nicely done. In the above code, IClaimsIdentity is part of the .NET Framework so the source code is not normally available. With ReSharper though, I can navigate to decompiled source:

image

This could be legally sensitive, so I have to pass a Decompiler Legal Notice in which JetBrains attempts to disclaim liability.

image

Then I am in, though the results are not exciting in this instance:

image

If you only want the decompiler, you may find the free dotPeek is all you need.

The what’s new list in ReSharper 6.0 is long. It includes support for JavaScript, ASP.NET Razor, CSS and HTML, better XAML support including creating properties and dependency properties from usage, and macros for file headers which automates things like inserting current date and time.

The pricing is not excessive: in the UK it costs £148 for a personal license or £259 for a commercial license. If you think ReSharper will save you time and improve your code quality, which it likely will, it will soon pay for itself.

JetBrains announces IDE for Objective C to compete with Xcode

JetBrains, maker of the admired IntelliJ IDEA Java IDE, has announced CIDR, an IDE for Objective C.

The 10 facts in the initial post tell us that it will be Intel Mac only, will open and create Xcode projects, and integrates with the standard interface builder and with the iOS simulator.

Xcode is decent so what is the point? Mainly I guess because of the refactoring and productivity tools JetBrains builds into its tools. W are promised refactories, on the fly code analysis, and code completion.

I am sure it will be worth a look, though taking on Apple will not be easy; it is a bit like going up against Microsoft’s Visual Studio n Windows, except that Xcode is free.

That said, it does not take much in terms of added productivity to pay back the cost of an IDE.

JetBrains WebStorm 2.0 and PHPStorm 2.0 First Look

I respect JetBrains, an IDE company which survives despite intense competition from free tools such as Eclipse and NetBeans. It does so because developers like the products, especially the IntelliJ IDEA Java IDE. The tools are focused on coding; there are few visual designers but lots of coding help, such as code completion, refactoring, find usages, and fast navigation. The tools are also relatively lightweight, so start up quickly, and generally run on Windows, Mac OS X and Linux.

The latest from JetBrains is two related web development IDEs. WebStorm 2.0 is for general HTML/CSS/JavaScript work, and PHPStorm 2.0 is a superset of WebStorm which adds PHP editing and debugging. There is also some support for Adobe’s Flex and ActionScript code.

New in PHPStorm is PHP 5.3 support, Zend Debugger support, improved SQL editing, support for the Mercurial source code management system, and updates for HTML 5 and EcmaScript 5.

I am interested in these tools since HTML development is increasingly important. Browsers are getting increasingly powerful, with HTML 5 and fast JavaScript engines challenging plugins as rich application runtimes, and PHP is less well served by IDEs than you would expect considering its popularity.

My first impressions though are mixed. I noticed a lot to like, in particular the work JetBrains has done on supporting mixed languages: HTML, JavaScript, CSS, SQL,XML and so on. One of its features is that code completion works even within quotes. For example, if your PHP is outputting HTML to the browser, code completion still works. Most editors treat anything within quotes as plain text rather than as code.

image

The IDE is highly configurable and also supports plugins. Live templates let you expand abbreviations to code fragments. There is support for generating documentation with JSDoc, ASDoc and PHPDoc. Testing with PHPUnit is integrated. These are products that will appeal to developers who are code-oriented – are there any others? – and who like the ability to fine-tune their tools to improve productivity.

That said, I did not find it easy to get started with PHPStorm. The main challenge is configuring your PHP environment to support debugging. I have not yet succeeded, though I have not spent all that long on it. Difficulty getting PHP debugging working seems to be the biggest single topic on the support forums currently.

I know this is tricky and it took me a while to get it working with Eclipse. It is important though, and anything the tools vendors can do to make this easier to setup would be welcome. There is a case for simply installing a dedicated LAMP or WAMP server with the product so that developers get immediate and reliable support for PHP debugging, with the option to configure for their own PHP server later.

Another thing I found annoying was the over-zealous spell checker, which seems inclined to check variable names as well as being unaware of PHP extensions like mysqli:

image

I expect there is a way to fix both issues by configuring the product.

In general JetBrains does not seem to suffer from the “not invented here” syndrome and uses open source libraries and tools; in fact it depends on Firefox for JavaScript debugging, and automatically installs its own plugin to improve integration.

image

However I picked up a note of disapproval in the description on the Zen Coding site about the way JetBrains has chosen to implement Zen Coding abbreviations:

These plugins are developed by third-party and has their own ZC engine implementation, which leads to different feature set and abbreviation syntax. Zen Coding team has no relation to this projects

WebStorm is modestly priced at £54.00 for individual developers or £115 per concurrent user for organisations.  PHPStorm is £77 or £154 on the same basis. Free licenses are available for education or for open source projects, on application.

Competing products include the free Eclipse PDT and NetBeans, the commercial Zend Studio, and for a more designer-friendly approach to PHP, Adobe Dreamweaver CS5.

PyCharm: JetBRAINS IDE for Python and Django

JetBRAINS has released PyCharm, an IDE for Python and the Django web development framework.

The company is best known for the IntelliJ IDEA Java IDE, and indeed PyCharm is mostly written in Java, but now has other tools for languages including PHP and Ruby and Rails. It also does add-ins for .NET developrs working in Visual Studio.

PyCharm

PyCharm has a small number of refactorings, lots of code search and assistance features,  integrated support for CVS, Git, Mercurial and Subversion version control, unit testing with a graphical test runner, graphical debugger, built-in deployment to Google App Engine as well as error highlighting for GQL queries, and editing support for HTML, CSS and JavaScript as well as Python.