Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intellij IDEA: The Superior Code Editor

Intellij IDEA: The Superior Code Editor

An internal talk @SeatGeek given by @sddamico and @rickhanlonii

The gifs embedded in this talk do not work or function as intended, for more information on the slides without animations, consult the intellij documentation or the keybindings guides at the end. Thanks!

Stephen D'Amico

August 06, 2015
Tweet

More Decks by Stephen D'Amico

Other Decks in Programming

Transcript

  1. Intellij Idea: The Greatest Code Editor On The Planet @rickhanlonii

    @sddamico
  2. 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
  3. Why Intellij? Besides Rick and Stephen saying that it’s better

    than Sublime
  4. 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.
  5. Navigation is Easier The abstract syntax tree makes it all

    better
  6. 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”
  7. Navigate to Class

  8. Navigate to Symbol

  9. Navigate to Symbol In Class

  10. Navigate to Declaration/Implementation

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

  12. Editing is Faster Contextually aware autocompletion and more!

  13. 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:
  14. 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:
  15. 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:
  16. 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:
  17. 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:
  18. 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:
  19. Refactoring is Painless It shouldn’t be so hard and you

    should be doing it more
  20. Method Renaming

  21. Field Renaming

  22. Method Signature Change

  23. Implementation to Interface

  24. Extract Method

  25. Delegate Function

  26. Testing is Simple It’s proven: in applications where writing tests

    is easy, test coverage is higher
  27. Testing • Navigate to Test • Auto create - template

    class • Running test method/class/file
  28. Debugging is Powerful Inspect :allthethings: while debugging

  29. 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
  30. 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!
  31. Thanks for listening!

  32. 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