Blog sobre desenvolvimento de software (Java, muito Java!), inovação tecnológica e cotidiano do Universo de TI. Acesse notícias, tutoriais, material de cursos e eventos, código, desafios, soluções, opiniões, pensamentos, divagações, balbuciações e abobrinhas diversas. Deixe seu comentário!

terça-feira, 8 de outubro de 2013

Java IDES - One shortcut to rule them all

"Three IDES for the Java-kings under the sky,
Seven were once famous in their halls of stone,
Plenty of others for Mortal Men doomed to die,
One shortcut to the Productivity Lord on his dark throne
In the Land of Java where the Shadows lie.
One shortcut to rule them all, One shortcut to find them,
One setting to bring them all and in the darkness bind them
In the Land of Java where the Shadows lie."
- J. R. R. Tolkien, The Lord of the Rings (slightly hacked)

I've been a polyglot programmer and multi-IDE user for several years... And as any all-arounder, I am not the most productive expert on any of them. IDES are huge beasts! It takes time to learn and to allow all of its functionality to sink in and it takes even more time to learn how to do things efficiently. 

Memorizing highly specific keyboards shortcuts of each IDE is one of the many actives that can become tedious or even completely unachievable if you switch between IDES frequently. Still, all in all I do prefer this road, since every IDE has its unique qualities. I'm a huge believer of the motto "Use the right tool for the job." Quoting the amazing Abraham H. Maslow's Psychology of Science: "I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail." Please avoid temptation!

So let's check out how to cheat and increase productivity by learning "Tool tamer" shortcuts for the most popular IDES in Javaland.

The idea behind this article is that if you can learn how to find desired functionality in the sea of options that one IDE has to offer, then you can teach yourself to be more productive with it. If you can configure all of your IDES to use the same shortcut to access the desired functionality then congratulations, you have just created a shortcut to rule them all.


If you make a living out of Java, chances are that you have spent some time with Eclipse, either because you love it or because that's what everyone else in your company uses! Eclipse is the only IDE that an entire army of (not that enthusiastic) Java Developers have ever learned how to use: it often offers the only best third-party plugins for a certain software stack. Eclipse is the most popular IDE in Javaland. Developed by an impressive foundation - backed by a giant group of technology companies and fueled by a vibrant community - the extremely customizable SWT-based IDE conceived by IBM isn't going away anytime soon.

If you don't know how to do something in Eclipse, just resort to the handy Quick Access functionality (Ctrl+3) and type the desired action (say, "Extract Variable").

If you don't like Ctrl+3 just bind the Quick Access command to some other key combination. In order to do this follow these steps:
  1. Navigate to Windows Preferences
  2. In the right menu open General → Keys
  3. Locate and select Quick Access
  4. Change its binding to the desired key combination
  5. Click on Apply and OK


"The only IDE you need" was the Netbeans motto back when Sun shined. It is intriguing to observe how  a lot of my colleagues dismiss this very crafty IDE as "slow"... This might have been true once upon a time when Netbeans hadn't yet reached its fourth release, the VMs were not optimized for Swing Applications, and computers were shipped with way less memory and very poor graphic cards. Nowadays Netbeans is a very responsive IDE with amazing UI Design Tools (JavaFX anyone?), a great out-of the-box experience for Java SE and Java EE, out-of-the-box support for a variety of Java tools and frameworks, plus a surprisingly competent out-of-the-box support for other programming languages (such as PHP, Groovy and C/C++). Netbeans surely lives up to its motto, and does this with a clean, hassle-free philosophy which makes it the perfect IDE to use in classroom.

Much in the same fashion of Eclipse, Netbeans exposes a Quick Find command which can be triggered with Ctrl+l. Although unlike Eclipse, Netbeans tries to find a lot of things by default (Types, Symbols, Help references, Maven artifacts and so on). So if your goal is to find an IDE functionality it is advisable to narrow the search category (accessible with Shift+F10 when the cursor is on the search bar) to Action.

I have never really liked Ctrl+l as a shortcut to Quick Find. So Thanks Sun for shortcut customization. To change your keymap, do the following:
  1. Navigate to Tools Options
  2. Click twice on the Keymap button located at the top Toolbar
  3. Look for "Quick search"
  4. Click in the Shortcut cell (or on the small ellipsis button) to edit
  5. Type your new key combination
  6. Click on OK

IntelliJ IDEA

How does a company make money out of a Java IDE when programmers can just download very good IDES such as Eclipse and Netbeans for free? Easy, you make the best tool on the market! And that's exactly what JetBrains did with IntellliJ IDEA. But don't take my word for it: just read what Martin Fowler has to say about IntelliJ (in its way, Martin Fowler is the IT version of Tom Hanks, we can always borrow its credibility). While there is a free Community Edition (which is good enough to run the amazing Scala Plugin, light years ahead of the competition) the good stuff comes with a price tag.
Is it worth it? Sure! I think that IntelliJ is indeed the Best Java and Polyglot IDE there is. I feel that developing with IntelliJ is a pleasure. Yes, I think that it can read my mind. And yes, I'm sold. But no, I'm not on commission, although if someone at Jetbrains ever reads this article and feel like donating a lifetime IntelliJ license, I'm all for it!

God is in the detail!  And IntelliJ Find Actions command has a very different (and, in my option, way better) approach for searching actions than Eclipse and Netbeans top right corner search boxes... Ctrl+Shift+a makes IntelliJ pop up a contextual menu right in the middle of your code. Easy, fast and to the point.

If Ctrl+Shift+a stresses your fingers (or your brain), no problem - here is the receipt to change it:
  1. Navigate to File → Settings
  2. At the left menu click on Keymap
  3. Look for "Find action"
  4. Click twice on it to customize the shortcuts
  5. Click on Apply and OK

And that's all: you've learned how to find your actions and teach yourself new shortcuts using three of the most popular Java IDES. Plus you have mastered how to customize key bindings according to your desires. Now come on, don't be a Hobbit (or eight Hobbits, also know as a Hobbyte)! Use the precious shortcut... Rule them all!

terça-feira, 1 de outubro de 2013



Quem leu meu artigo "POSCOMP 2010" sabe que o POSCOMP é um exame de múltipla escolha com 70 questões, exigido pelos melhores programas de pós-graduação em Ciências da Computação / Engenharia da Computação / Engenharia de Sistemas / Sistemas de Informação / Informática e áreas correlatas no Brasil.

Se você pretende entrar em programas de mestrado / doutorado em computação na USP, UNICAMP, UFSCar, UNIFESP, PUC-Rio, UFRJ, UFMG, UNB, UFPE, UFPR, IME–RJ, UFRGS, UFSC, etc é recomendável prestar o exame. Esses programas geralmente usam o POSCOMP tanto na seleção de mestrandos e doutorandos quanto como critério para distribuição de bolsas.

O exame é divido em três grandes áreas: Matemática, Fundamentos da Computação (que contém a maior parte das questões) e Tecnologia da Computação.

O objetivo dos candidatos buscando vagas em programas de excelência é ficar acima da média geral. Essa é historicamente baixa. A média de acertos entre 2002 e 2011 foi de aproximadamente 25 questões (~35%). Isso mostra o nível de exigência do exame.

Eu prestei o exame em 2010. Com os resultados do exame garanti vagas em bons programas de pós-graduação, incluindo o Programa de Engenharia de Sistemas e Computação na COPPE / UFRJ e no Departamento de Informática da PUC-Rio, ambos conhecidos pela excelente produção científica e pelo conceito máximo na avaliação da CAPES.

É claro que esses programas levam em consideração muitas outras coisas além do POSCOMP. Dentre elas: histórico acadêmico, cartas de recomendação, envolvimento com atividades de pesquisa (Iniciação Científica e publicações), currículo, etc. Um fator importante é buscar uma área de pesquisa de seu interesse e, dentro dessa área, orientadores que possam guiá-lo em suas atividades de pesquisa (é costumeiro que alunos de pós-graduação sigam a linha de pesquisa de seus orientadores).

Nesse domingo (29/09/2013) voltei ao IME-USP para prestar o POSCOMP pela segunda vez. Segue a prova com gabarito oficial

Para candidatos interessados em prestar o POSCOMP em 2014, tomei a liberdade de fazer upload dos 4 últimos exames para o Scribd (extraídos do site da SBC). 

Boa sorte a todos que estão aguardando os resultados oficiais!

PS: Se você prestou o POSCOMP por favor deixe um comentário com suas impressões sobre o exame.


  1. Criei uma planilha no Google para estimarmos a média de 2013.
    Link: Média POSCOMP 2013
  2. Gabarito provisório substituído pelo definitivo.
  3. Planilha para correção da prova conforme gabarito definitivo.
    Link: Correção POSCOMP 2013