Our last series was a big success and we decided to take it a step further with an Advanced Programming series, which will start in Dec. 2016. But for today I want to give you a quick tip for faster coding in IntelliJ IDEA!When you are coding, there are some constructs that you might type more than once. Let’s say the main-method. Each Java program needs one, or the System.out.println()-call, which might be a method you call very often. IntelliJ (as well as other IDEs) have handy features, so you do not have to write these constructs manually each time you need them. For example:
If you type in sout in a valid context (inside a method) and press enter immediately after entering it, IntelliJ will substitute “sout” with:
Look at this short video if you want to see this feature in action!
These keywords are called live templates in IntelliJ and you can list all available keywords with the Ctrl + J (Cmd + J on Mac) shortcut. You can read more about live templates in the official documentation.
And the best thing is: If you have a code snippet that you use often, you can define your own macros! Learn about that feature here.
Hopefully this tip helps you and speeds up your coding! Have a nice Monday!