• Hungry Backspace

    How often do you press backspace multiple times to get rid of all whitespace characters that are before your cursor?

    IntelliJ IDEA has interesting and highly-undocumented editor action called “Hungry Backspace” that allows you to perform that action with just a one key press.

    Michal Kordas on Nov 17, 2016
  • Do Not Catch Exception When Not Necessary

    Catching Excetption in Java is widely discouraged practice. Checkstyle, PMD, FindBugs - all of these tools have rules complaining on every attempt to catch Exception. While this practice might be useful to do some generic action for all exceptions like logging and rethrowing with more context, but generally we should stay alert whether it is really necessary.

    Michal Kordas on Sep 13, 2016
  • Empty Array Constants

    In Java empty arrays (of zero length) are fully immutable and safe to be shared across entire classloader. This means that if we invoke e.g. new int[0] more that once that’s just waste of memory (very small waste, but still).

    Michal Kordas on Sep 10, 2016
  • The power of CTRL + SHIFT + N in IntelliJ IDEA

    IntelliJ IDEA has many useful navigation features. Every competent user already knows, that in order to navigate to any file in the project it’s enough to press CTLR + SHIFT + N and type file name or its part. Nevertheless, we usually use this functionality in very limited way.

    Michal Kordas on Aug 2, 2016
  • The Real Meaning of TDD

    As with majority of conceptions in software development, their original meaning gets obscured pretty fast. I have impression that it happened even to as simple idea as TDD…

    Michal Kordas on Aug 1, 2016
  • Your Bugfix Pull Request Should Have Multiple Commits

    When a code that you wrote is not committed to a repository, it effectively doesn’t exist, as it is not visible to anyone besides you. Moreover, Git doesn’t take care of uncommitted files and they may irrecoverably get lost. If we commit often it’s easy to go back to previous state when anything fails. We can share changes on regular basis and receive timely feedback about our ideas and architecture of a solution. Other people know what is going on. There are less merge conflicts and less duplicated work. Exact statuses are shared even before stand-up meetings. All of the above are the basic continuous integration principles and we cannot say we have proper CI when people have uncommitted changes hanging out for days.

    Michal Kordas on Jul 26, 2016
  • The Quickest Way to Introduce Variable in IntelliJ IDEA

    Many coders consider themselves as smart when they have learnt how to use CTLR + SPACE. When they need to declare variable

    final List<Object> list = new ArrayList<>();

    they press CTRL + SPACE to complete each word separately, which gives about 5-6 autocompletions and decent amount of typing for the above.

    Let me teach you the trick that would save you thousands of keypresses in your life. Just type new ArLi, press CTRL + ALT + V and… you are done!

    Michal Kordas on Jul 11, 2016

subscribe via RSS