News for hackers. Stuff that matters.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by thorum on Wednesday October 09, 2013 @07:51PM (#6524732)
> Similarly, I never type "for (int i = 0; i < blah; i++)." I type "cmd-J, fori, return." Etc....

As someone who didn't realize this existed in Intellij, I think you may have just changed my life :)

Re:If Java Is Dying, It Sure Looks Awfully Healthy by anoncowherd on Thursday October 10, 2013 @01:53AM (#6525887)
>> I type "cmd-J, fori, return."

There's no need for Cmd-J, just write a few characters and press TAB. Try "sout"<TAB>, "psvm"<TAB>, "iter"<TAB>, "itli"<TAB>, and so on.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by Zimahl on Wednesday October 09, 2013 @08:03PM (#6524787)
Back in college when I was interviewing for jobs sometimes interviewers would first ask you to write any executing Java class because some interviewees said they 'knew' Java and couldn't do even that simple task.

A couple years later when Eclipse came out I told a coworker this anecdote and he joked that it was 'main' + ctrl-spacebar followed by 'sysout' + ctrl-spacebar. I lol'd.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by acanby on Wednesday October 09, 2013 @08:02PM (#6524782)
You can shorten it even further to typing 'fori' then triggering the expansion by pressing tab.

Best shortcut that every IntelliJ user should know is "Find Action" (ctrl + shift + a on Win), press and start typing what you want to do. Will even present shortcuts in the list for next time.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by bhauer on Wednesday October 09, 2013 @08:12PM (#6524833)
Eclipse has something similar, which it calls "code templates." Features like these leave me wondering why "excessive typing" is often cited as a criticism of Java. As far as I can estimate on the fly, I type less than half of the characters that make up my Java code.

And as the article points out, for readability, verbosity is arguably a good thing. I sure believe it is, perhaps because I am more distracted by poor symbol selection and syntax than most programmers I know. Speaking of, I don't particularly like the C-lineage syntax, Java included. I don't like the braces and parentheses. I prefer a syntax with fewer symbols and more keywords. Crazy, I know.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by TimPC on Thursday October 10, 2013 @12:59AM (#6525732)
Excessive typing isn't the issue. The problem with verbose code is that code gets read way more than it gets written. In Java you're often reading 15 lines of code for something that could be 2-3 in other languages.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by danieldk on Thursday October 10, 2013 @02:30AM (#6526010)
And still, I have seen plenty of Java code which is perfectly readable and Haskell, Perl, or Ruby code (2-3 lines) that resembled line noise. And I am a Haskell fan :).

The worst offender in Java are IMO anonymous inner classes. But IntelliJ shows them abbreviated. E.g. IIRC Runnables are displayed in Java 8 lambda syntax.