Last Updated: September 09, 2019
·
1.61K
· tflander

Eclipse Productivity Tips for Java

Eclipse has lots of keyboard shortcuts that allow you to code faster. Take some time to learn them. If you do this, you will be able to focus more of your effort on solving problems, and less effort typing.

1) Use CTRL-space for code completion. Use it for Java keywords, variable names, and class names. For example, type fore[CRTL-space] to create a for-loop.

2) Use camel-case with CTRL-space for class names. For example, type IAE[CTRL-space] or IArE[CTRL-space] instead of typing IllegalArgumentException.

3) Learn the [ALT-SHIFT] refactoring short-cuts. For example, highlight an expression withing a complex statement and hit [ALT-SHIFT-L] to extract the expression to a local variable. Knowing how to refactor allows you to quickly clean ugly code. Once you are good at cleaning code, you can be comfortable writing ugly code quickly to spike functionality.

4) Know the following refactoring commands and use them often: Rename, extract method, inline method, introduce parameter.

5) Use [CRTL-1] to assign a statement to a new local variable or field. Write code from the bottom up. For example, instead of typing "StringBuilder sb = new StringBuilder", type new StringBuilder[CTRL-1]. Better yet, type new StBu[CTRL-SPACE][CTRL-1].

Keep learning and improving the craft.

1 Response
Add your response

Thank you very much. Useful tips.

over 1 year ago ·