editor.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package setup
  2. /* Editors pursuit productivity in a wrong way.
  3. To maximize productivity, editors provide a lot of keyboard shortcuts.
  4. However, keyboards have limited numbers of keys.
  5. And editors have three choices:
  6. Mode Switch
  7. Keyboard shortcuts of Vi is easy to type.
  8. However, the mental cost of mode switch is high.
  9. Two-Step Shortcuts
  10. Emacs uses two-step keyboard shortcuts to avoid the hassle of mode switch.
  11. However, they are slow to type.
  12. More Than Two Keys
  13. Shortcuts like `ctrl+alt+x` and `ctrl+alt+shift+y` are hard to type.
  14. All Are Hard to Remember
  15. All three choices above have a common disadvantage:
  16. they are difficult to remember.
  17. The Alternative Way
  18. Just like typing speed should not be the bottleneck of programming,
  19. keyboard shortcuts should not be the bottleneck of programming productivity too.
  20. It is navigation, completion, and refactoring
  21. that boost programming productivity mostly,
  22. not keyboard shortcuts.
  23. Forget about keyboard shortcuts, replace the editor with an IDE,
  24. or configure the editor with a language framework
  25. which provides assistant with navigation, completion, and refactoring of code.
  26. The Only Keyboard Shortcut to Remember
  27. IntelliJ introduces "Find Action" (`ctrl+shift+a`) in 2007,
  28. and Sublime Text introduces a similar feature called "Command Palette" (`ctrl+shift+p`) in 2011,
  29. which inherited by Atom and VS Code.
  30. For editors and IDEs provideing such a feature,
  31. it is the only keyboard shortcut need to remember.
  32. If I find out that I am using an action so frequently
  33. that I can afford the cost of remembering an additional keyboard shortcut,
  34. I can always bind the action to a keyboard shortcut.
  35. Since there won't be too many such keyboard shortcuts,
  36. none of mode switch, two-step shortcuts, and more-than-two-key shortcuts is necessary.
  37. */
  38. func EditorsSuck() {}