Chapter 19. Don’t hIDE Your Tools

Gail Ollis

What is the one essential tool every Java programmer needs? Eclipse? IntelliJ IDEA? NetBeans? No. It’s javac. Without it, all you have is files of weird-looking text. It is possible to do the job without integrated development environments (IDEs)—ask people like me who programmed in the olden days. It is not possible to program without essential development tools.

Given that they are central to the task, it’s surprising how rarely people use tools like javac directly. While knowing how to make effective use of an IDE is important, understanding what it is doing, and how, is crucial.

Once upon a time, I worked on a project with two subsystems, one in C++ and the other in Java. C++ programmers worked with their editor of choice and the command line. Java programmers used an IDE. One day, the incantation to interact with the version control system changed. It was a simple command-line change for the C++ programmers, who went on their way without delay. The Java team spent the whole morning wrestling with their Eclipse configuration. They finally got back to productive work in the afternoon.

This unfortunate story doesn’t reflect well on the Java team’s mastery of their chosen tools. But it also illustrates how distanced they were in their day-to-day work from the essential tools of their trade by working exclusively in an IDE. Information hiding is a great principle for enabling focus on a useful abstraction rather than a mass of detail, for sure. But it implies a choice to delve into details only when relevant, not ignorance of the details.

Relying solely on an IDE can undermine a programmer’s mastery of their tools because the IDE purposely hides the nuts and bolts. The configuration—often just a case of following someone else’s instructions—can be forgotten as soon as it’s done. There are many advantages to also knowing how to use the essential tools directly:

  • “It works on my machine” scenarios are less likely and simpler to resolve if you understand the relationships among tools, source code, other resources, and generated files. It also helps with knowing what to package for installation.

  • It’s extraordinarily quick and easy to set different options. Start with commands like javac --help so you can see what those options are.

  • Familiarity with the essential tools is valuable when helping people who use a different environment. It also helps when something goes wrong; it’s hard to troubleshoot when integrated tools are not working. Visibility is better on the command line and you can isolate parts of the process, just as you would when debugging code. 

  • You have access to a richer tool set. You can integrate any combination of tools that have a command-line interface (for example, scripts or Linux commands), not just those supported in the IDE.

  • End users will not run your code in an IDE! In the interest of good user experience, test from the start by running the code as it will be run on a user’s machine.

None of this denies the benefits of an IDE. But to be truly skilled at your craft, understand your essential tools and don’t let them get rusty.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.13.255