Friday, April 06, 2007

IntelliJ IDEA is the "best HTML editor in the world"

Patrick Lightbody calls IntelliJ IDEA the "best HTML editor in the world". Strange. You would think that he meant best Java editor, or that he would have picked a dedicated HTML editor. But no, he is very clear:
This is not an understatement. Ruby-fanatics even admit their beloved TextMate has nothing on IDEA (right Dion?). Heck, at my company, our VP of Marketing (who gets hands-on w/ web design) now uses IDEA and swears by it. Why? Because it speaks fluent CSS, HTML, and JavaScript. And all those nice inspections work here too. It'll highlight unused CSS declarations. It'll help you find usages for JS functions and CSS classes. It'll even point out the fact that "0px" is redundant and can simply be "0"... and you don't have to delete "px"... remember, just press Alt-Enter!

In fact, he's right! And he's not the first to notice. This year, IntelliJ IDEA won a Jolt Productivity Award in a new category, under Web Development, at least in part due to its HTML-editing features. (Check out the Javascript and Ruby support as well....)

The trick is that IDEA is not just dedicated to Java, it has a code-centric architecture that can enhance any language in an intelligent way, including editing, refactoring, code search, navigation, inspections, code highlighting, and formatting. On top of this architecture is the Language API, which allows any language (e.g. Ruby, SQL, etc.) to be plugged in to benefit from these productivity features. Of course, the real beauty of web development with IDEA is the ability of all the languages to work together. Got a JSP page with embedded HTML, CSS, and Javascript? No problem! It all works.

The IntelliJ philosophy is this: Programmers spend most of their time working with code, so the IDE should be as intelligent about code as possible. That's why we have a dedicated code-centric architecture to handle any language a Java programmer might need to tackle. It is also why IntelliJ IDEA is not only the best Java editor, but the best HTML editor, too.

Monday, March 26, 2007

Rediscovering Refactorings

Michael Feathers wrote a blog listing some of the refactorings he would like to see in IDEs. Two refactorings in particular caught my eye, Extract Class and Introduce Parameter Object. In fact, these refactorings have been available for quite some time via a third-party plugin for IntelliJ IDEA called Refactor-J, from Sixth & Red River Software.

Introduce Parameter Object is great for simplifying a long parameter list by condensing several parameters into a single parameter object. This can be a great way to clean up your design to make it easier to use, easier to read and comprehend, and easier to maintain. Parameter objects can stay as simple value objects, or they can evolve into something more intelligent, as needed.

Michael's request also includes that any arbitrary group of variables (fields or local variables) could also be converted into aggregate objects. If it is possible to implement, I'd like to see this as well. It could potentially be a very useful refactoring, allowing you to quickly sketch out the collaborating classes your design may need. Just start with basic ints and Strings and build your object-oriented design from that.

If you regularly do complex refactorings, or if you just happen to want more power out of refactoring, I suggest looking into the Refactor-J plugin. It has about 20 extra refactorings in total. Also, for more 'personalized' refactorings, you can always use the built-in Structural Search & Replace feature of IDEA. It takes a little getting used to, and it cannot do all kinds of refactoring, but it is often the best way to make refactoring-like changes to your code that cannot already be made with existing refactorings.

At the end of his post, Michael asks for what he calls 'intelligent statement move'. Well, unfortunately what he's asking for is not likely to be seen for a while, but with a sufficient suite of unit tests, the basic Move Statement Up/Down editor command (Ctrl-Shift-Up/Down) is sufficient for most purposes. It can even move syntactically correct blocks of code (you can select sytactic blocks with Ctrl-W), or even whole methods.

Have you ever dreamed up any special refactorings you would like to see in your IDE?

Thursday, March 15, 2007

Productivity Talks at JHUG Tech Day

Last Saturday I gave a talk at the Java Hellenic User Group, and I found it interesting that all of the talks given there had an underlying motivation of increasing productivity.

First was Dr. Heinz Kabutz, the famous Java Champion and editor of the Java Specialist newsletter, who had a talk called Productive Coder. It was a good talk to start the day because he gets you thinking right away about seeing things from a productivitiy perspective. For instance, his first major point is that most programmers that he has met cannot even touch-type without looking at the keyboard. It seems like such a minor thing, but by learning the keyboard so well that it is intuitive, it's just more productive since you don't have to spend your awareness on the keyboard and can think of the task at hand instead. Heinz' talk included many similar small-but-important ideas about becoming a more productive coder.

He also showed a demo of IntelliJ IDEA, emphasizing learning the keyboard shortcuts for an IDE (even I learned a feature -- column editing mode, Alt-Shift-Insert). I think learning shortcut keys is in many ways like learning a new language. Once you've learned one useful language, it's frustrating to try to get to the same fluency in another, unless you put some effort into it. This can make switching IDEs painful. Heinz mentioned the IntelliJ IDEA keymap reference card you can print out and stand up on your desk to help you learn the shortcuts (see here). He also talked about object-oriented principles and how to tame a jungle of legacy code with refactorings like Encapsulate Fields, to make fields private.

Tom Baeyens of JBoss/RedHat did a talk on workflows and process languages. Part of the motivation there is to simplify and automate communication between the analyst and the programmer, an attempt to increase productivity in this area. Tom has a great sense of humour and I enjoyed his talk very much.

Patrick Linskey of BEA talked about JPA (Java Persistence API), and how a big motivation is to simplify object-relational mapping, automating it, so you can think in higher level concepts of objects rather than tables. Of course the flexibility is there to use tables if necessary, but the real power of the spec is in ease of use and testability that the object abstraction gives you. Patrick was extremely knowledgeable, as we could tell during the Q&A.

Finally, my talk was on Tools for Agile Teams, focusing on how IntelliJ IDEA and TeamCity support agile development methodologies by helping developers stay in flow longer and more often. Flow is the highly productive state of mind when you're focused on a task and outside distractions seem to melt away. Most people in the audience reported that they had experienced the state of flow and also that they have experienced being frustrated by tools that interfere with flow by annoying distractions and context switches. I demoed some of IntelliJ IDEA's productivity features and gave an overview demo of how the TeamCity continuous-integration server can help increase team-level productivity.

Thanks to Paris Apostolopoulos and Panos Konstantinidis of the JHUG for organizing the event. It went very well and was quite enjoyable.

Thursday, March 01, 2007

TheServerSide asks the right questions

Some IDE surveys are just simple popularity contests. Not this one. This survey from, has much smarter questions, and I'm really looking forward to the results!

For instance, instead of just asking which IDE you use, it splits it up into which IDE the organization uses as standard, and which IDE you personally use.

Some organizations impose a particular IDE on all the developers because of an 'organizational standard'. Such standards might be good for something like databases and servers, but I hardly think it makes sense to force a developer to use an IDE that he or she is not productive in. Developer productivity often trumps the relatively small cost-savings of standardization. If you save $1,000 a month by standardizing, but the IDE you choose makes your 10 programmers even 5% less productive, you're actually losing a big chunk of money there, since the lost productivity is closer to $5,000 per month.

Also, professional programmers like being productive and, given the choice, most of them would choose the one that makes them more productive rather than being forced to use an organizational standard. One of the interesting questions in the survey is "If you do not directly choose your IDE, which one would you prefer to use?" I definitely want to see the results there! I expect to see a lot of cases of organizations standardizing on a particular IDE, but some of their developers wishing they could use a different IDE. IDE choice is often a personal thing, and hopefully this survey will help people realize that.

Of course, the questions aren't perfect, although they are definitely a step in the right direction. One of the questions asks, "Which three features do you value most in an IDE?" While this is a good start, it completely ignores that things like 'productivity' and 'usability' are not features, but they can easily be the most important thing people value in an IDE. It is very common to hear fans of IntelliJ IDEA say things like, "There's no particular feature I can point to, it's just that all the features just seem to work better." I hope to see surveys in the future that tackle the importance of intangibles like usability, intelligence, and productivity.

Check out the survey here.

Tuesday, February 27, 2007

BDD and the Power of Metaphor

I read an interesting article by "Uncle" Bob Martin talking about Behaviour Driven Development (BDD). Since I hadn't heard of it before, I decided to scratch the surface and see what I could find. One of the nuggets I found was a PDF by Dave Astels expressing his frustration about how no one seems to get Test Driven Development (TDD) right:
"Everyone who's doing TDD is fully understanding it and getting the full benefit, right? Fat Chance! Too few people I talk to really understand what it's really about. That means that many people who practice TDD are not getting the full benefit from it."
"The thing is, when the evolution to TDD happened what we ended up with was a different kind of animal... not just a slight tweak on the original."
"So, there you have it. A fabulous idea... wrapped in packaging that causes people to think from a testing point of view."
"So if it's not about testing, what's it about? It's about figuring out what you are trying to do before you run off half-cocked to try to do it."
Digging a little deeper, it turns out that Dan North has been having these ideas for a while and he writes a nice introduction to behaviour-driven development. I recommend it highly, as it clearly lays out the motivation for BDD. This introduction to BDD is also a good place to start.
Basically, BDD is taking TDD closer to specifications rather than tests. Well, executable specifications, so they remain tests, just look and sound more like specifications. In essence, it's not really a new technique per se, but a new way of thinking about, designing, and organizing tests.

What I find interesting is that one of the main motivations is 'getting the words right', which is exactly what I was thinking when I wrote a blog called "Why Are Continuations So Confusing, and What Do They Really Do?". My gripe was that the word 'continuation' doesn't actually help you to understand what a continuation really is, and I proposed thinking instead in terms of 'execution sites'. For me, that metaphor works much better, just as the metaphor of specifying behaviour is better than the metaphor of unit testing.

Metaphor and analogy are powerful tools of understanding and insight, if you can find a useful connection. Earlier this week I blogged about the connection shared by TDD and continuous integration (CI), showing that they are both part of the same agile trend towards faster and faster feedback on quality (TDD at the programmer-level and CI at the team-level). Now with this whole BDD thing, I wonder what kinds of insights and connections BDD can bring to CI and vice versa. Maybe part of the job of developing TeamCity will be to develop a new vocabulary for continuous integration.

Friday, February 23, 2007

Why IntelliJ IDEA Customers Keep Coming Back

Brian Pontarelli has a passion for the keyboard and makes some good points about usability and support in regards to Java IDEs, specifically IntelliJ IDEA and Eclipse. The comments after the main post are especially interesting, such as where some commenters argue over whether a reported issue counts as either a severe bug or a missing feature. I mean, come on. Does it really matter? The point is that it interferes with Brian's experience of usability and productivity. I've been saying it for a while: It's not about feature lists, it's about usability and productivity. You won't find usability or productivity on a feature list, but it can easily be the most important deciding factor on whether or not to choose one piece of software over another. JBuilder was marketed on the length of its feature list, and look where it got them.

Wednesday, February 21, 2007

JDJ Readers' Choice Awards

Just a reminder for folks to join in the voting at the Java Developers’ Journal Readers’ Choice Awards. JetBrains has entries in several categories for IntelliJ IDEA and TeamCity:

Best IDE - IntelliJ IDEA 6.0
Best Web Development Tool - IntelliJ IDEA 6.0
Best Java Application - IntelliJ IDEA 6.0
Best Java Debugging Tool - IntelliJ IDEA 6.0
Best Java EE App Dev. Framework - IntelliJ IDEA 6.0
Best Java IDE Environment - IntelliJ IDEA 6.0
Best Java Project Build Tool - TeamCity 1.0
Best Team Development Tool - "IntelliJ IDEA 6.0 / TeamCity 1.0" Pack
Best Tool for Rich Internet Applications - IntelliJ IDEA 6.0
Most Innovative Java Product - TeamCity 1.0