Slide 1

Slide 1 text

Intellij Idea: The Greatest Code Editor On The Planet @rickhanlonii @sddamico

Slide 2

Slide 2 text

Learning [intellij] isn’t just important for your future; it’s important for our [company]’s future. – Barack Obama* Head of the Free World * he didn’t really say that

Slide 3

Slide 3 text

Why Intellij? Besides Rick and Stephen saying that it’s better than Sublime

Slide 4

Slide 4 text

When Your Editor Understands the Code You’re Writing… Navigation is Easier Navigate to class, method, symbol, declaration, etc. Editing is Faster Autocomplete, live templates, postfix completion, etc. Refactoring is Painless Extract methods, change method signatures, renames, etc. Testing is Simple Generate test classes, navigate to tests, Debugging is Powerful Breakpoints in code, tests, library sources, etc.

Slide 5

Slide 5 text

Navigation is Easier The abstract syntax tree makes it all better

Slide 6

Slide 6 text

Navigation • The editor is able to keep your code in memory and provide smarter navigation • Most editors have Find, Open, Jump to line, etc. to open specific classes or files, Intellij has that too • But when you have access to the AST… everything gets better • Intellij: Navigate to [class | symbol | symbol in class | line | declaration | implementation | super method | test for class | more and more ] • Key thing: camel case completion on everything: “SGTV” completes to “SeatGeekTextView”

Slide 7

Slide 7 text

Navigate to Class

Slide 8

Slide 8 text

Navigate to Symbol

Slide 9

Slide 9 text

Navigate to Symbol In Class

Slide 10

Slide 10 text

Navigate to Declaration/Implementation

Slide 11

Slide 11 text

shift + shift (I have no idea what I want)

Slide 12

Slide 12 text

Editing is Faster Contextually aware autocompletion and more!

Slide 13

Slide 13 text

Live Templates • A few characters tab out to common code • psfs = public static final String • fbc = findViewById() (with cast) • fori = new for(int i = 0; i < x; i++) {} block • sout = System.out.println() • Tons more + you can create your own! Examples:

Slide 14

Slide 14 text

Intent Actions • alt + enter • Auto-fix or perform common actions • Invert “if” condition • Select correct import • Inject language (more in a second!) • Bring variable into scope • Many more, can be expanded with plugins Examples:

Slide 15

Slide 15 text

Language injections • Declare a string contains a certain language • Gain syntax highlighting, autocomplete, etc. • JSON • XML • SQL • Any language you have installed via plugins! Examples:

Slide 16

Slide 16 text

Postfix Completion • Act like “fake” methods that autofill code • Improve speed and ease with common tasks • Creating a for loop over a collection (.for) • Making result of method call a local var (.var) • Casting a variable to another type (.cast) • More can be added by plugins! Examples:

Slide 17

Slide 17 text

Inspections • Built-in static analysis to catches problems/smells • Classes exposed beyond scope • Spelling errors (great for Stephen) • Unused methods/parameters/fields • Naming convention violations • Methods with too many parameters warnings • As with all of these, many, many more Examples:

Slide 18

Slide 18 text

AST Highlighting • Option Up / Down • Highlight increasing/decreasing scope • Highlight variable to rename • Highlight local block to extract method • Highlight method to extract method object • Highlight class to move to new location Examples:

Slide 19

Slide 19 text

Refactoring is Painless It shouldn’t be so hard and you should be doing it more

Slide 20

Slide 20 text

Method Renaming

Slide 21

Slide 21 text

Field Renaming

Slide 22

Slide 22 text

Method Signature Change

Slide 23

Slide 23 text

Implementation to Interface

Slide 24

Slide 24 text

Extract Method

Slide 25

Slide 25 text

Delegate Function

Slide 26

Slide 26 text

Testing is Simple It’s proven: in applications where writing tests is easy, test coverage is higher

Slide 27

Slide 27 text

Testing • Navigate to Test • Auto create - template class • Running test method/class/file

Slide 28

Slide 28 text

Debugging is Powerful Inspect :allthethings: while debugging

Slide 29

Slide 29 text

Debugging • Step through execution stack • See variable values next to their usages • Explore every value in entire stack call • Execute statements at position in stack

Slide 30

Slide 30 text

Plus! • The whole IDE is customizable • Themes • Plugins • Editor Tabs • Code Style • Run Configurations • Fonts/Tabs/File Headers/and more! • The IDE is open source, so if there’s a particular bug that impacts you, or a feature that you want, you can fix it/build it yourself!

Slide 31

Slide 31 text

Thanks for listening!

Slide 32

Slide 32 text

Links and More • JetBrains Official Site: jetbrains.com • CheatSheet (for keybindings): www.mediaatelier.com/CheatSheet/ • ShortcutFoo (more keybindings): www.shortcutfoo.com/app/dojos/intellij-idea-mac • Key Promoter Intellij: plugins.jetbrains.com/plugin/1003