Subscribe

Share

Developer Productivity

Use a Pencil, Be a Better Java Developer

Java Champion Mani Sarkar minimizes distractions, chooses tools, and learns about learning Java. 

By Alexa Weber-Morales

May/June 2019

When Java Champion Mani Sarkar talks about technology, you think, “I’ll have what he’s having.” The prolific writer, speaker, and Java and JVM-based developer is a vibrant member of the London Java Community (LJC) as well as a passionate backer of open source projects such as Adopt OpenJDK. Although his day job focuses on strengthening teams, his interests include improving code quality and performance, implementing DevOps and machine learning, and more.

Talking to Sarkar about productivity means tapping into the mother lode. Here is just a sampling of the many ways he suggests improving your Java code and learning new technology more effectively.

Deep Work

“These days I take a lot of inspiration from the book Deep Work by Cal Newport,” says Sarkar. “Getting into the flow of working or coding isn’t hard at all. The idea is to shut yourself off from the outside world and distractions, timebox your tasks, take breaks, and be disciplined about not breaking this discipline. Cal Newport has a lot to say about how to do this. He calls it deep work, as opposed to the shallow work we all are used to doing. Developers must aim for and do deep work as much as possible.”

Read more code, write more code, think in code!”—Mani Sarkar, Java Champion

Sarkar tries to avoid time sinks, such as the kind of “unnecessary, nonpractical chatter about what’s right and wrong that’s often found in various forms of social media, ranging from Twitter and Slack to Reddit and Quora.” Instead, he recommends communicating via coding: “Read more code, write more code, think in code!” Two ways to do that, he adds, are by sharing Java code gists, which are snippets of code, and GitHub repos, which are more-fleshed-out projects and documentation.

Choose Your Tools

“No digital tool is good enough,” Sarkar says. “I strongly suggest using paper and pencil (or pen) a lot more. We are able to remember a lot more and help drive our thoughts and express our creativity a lot more via our hands when we write or draw.” WET (Write Everything Twice), rhizo-mapping, and mind-mapping are three ways Sarkar tries to propel his pencil and come up with new ideas. “Such a practice helps build muscle memory,” he explains. “As the urban saying goes, ‘Your fingers are your memory.’”

Developer Productivity figure 1 Key Promoter keeps track of how often you reach for menu options instead of typing equivalent keyboard shortcuts.

Figure 1: Key Promoter keeps track of how often you reach for menu options instead of typing equivalent keyboard shortcuts.

As any good programmer knows, you also improve productivity—and prevent ergonomic strain—when you memorize keyboard shortcuts instead of clutching at the mouse or clawing the trackpad. Sarkar recommends using an IntelliJ plugin called Key Promoter (see Figure 1) to keep track of how often you reach for menu options instead of typing equivalent keyboard shortcuts. “You can configure the plugin to keep track of how often you use the mouse to select the menu option, and if you cross that limit, it will nag you each time,” he says. “It also helps you create a shortcut for menu options if there isn’t one already.”

Sarkar has several favorite productivity-enhancing tools:

Learning Java

Sarkar is passionate about the future of cloud native Java and is currently exploring serverless computing and systems for containerized deployment, including Docker, Apache Mesos, CoreOS rkt, and SmartOS containers. “The JVM language Clojure is a great example of simplicity and compactness,” he says. “In fact, functional programming language concepts tout simplicity all the time.”

But what if you’re still learning Java or learning to be a better Java developer? Sarkar recommends attempting to solve katas, a concept that developers have enthusiastically borrowed from the Japanese martial arts world. The Gilded Rose refactoring kata, for example, has become an extremely popular exercise that hones the skill of writing more-elegant problem-solving code.

The most contagious aspect of Sarkar’s approach is how, in a fashion befitting a programmer, Sarkar has taken a step back from the problem of learning Java to contemplate what learning means. “Your brain indexes knowledge when you are resting,” he says, “so sleep and rest let the brain index away. Don’t overload. Instead, interleave: Fill the gaps, and learn incrementally and iteratively.”

Next Steps

FOLLOW the Oracle Developers blog.

LEARN about the Java Champions.

SUBSCRIBE to Java Magazine.

Photography by John Blythe