I have a Java class that handles import and export of data. It started out as a simple

private void export() {
private void import() {

Of course, I wrote the export first, committed it, and then went on to write the import. But import is a keyword in Java - I can't use that as a function name. So I go back and rename both methods. I usually end up with

private void doExport() {
private void doImport() {

which is both ugly and feels contrived. What do you think of these names? Got any better suggestions?

Note: I'm asking now, because it's now happened thrice and that keyword is getting quite annoying.

closed as primarily opinion-based by user40980, GlenH7, Ampt, gnat, jwenting Aug 6 '14 at 7:09

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I realize this method is quite subjective. I hope it's not off-topic here. – configurator Sep 29 '10 at 23:48
  • This might be subjective, but it's still directly programming related, so I'd argue it belongs on StackOverflow and not here. – Peter Boughton Sep 29 '10 at 23:56
  • 2
    I don't think SO would appreciate this kind of question. – configurator Sep 30 '10 at 0:01
  • See meta.programmers.stackexchange.com/questions/350/…. You could change your question to match 1, your question might meet 2, I guess it will meet 3; it meets 4, 5 and 6... – Tamara Wijsman Sep 30 '10 at 1:03

I would prefer something like this:

private void importData(){}
private void exportData(){}

If you now would use this Class as an API you can do something like this:


With the CodeCompletion of the IDE, the differences are more visible if this methods wouldn't start the same way.

  • I agree, this is much better than doImport/doExport for most cases. Good answer! – configurator Oct 5 '10 at 23:28

This is the same problem as with all keywords in programming languages. But the problem is easy, just chose another name.

How about this?

private void dataExport() {
private void dataImport() {

Not the answer you're looking for? Browse other questions tagged or ask your own question.