Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as primarily opinion-based by MichaelT, 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
I don't think SO would appreciate this kind of question. – configurator Sep 30 '10 at 0:01
See…. 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... – Tom Wijsman Sep 30 '10 at 1:03
up vote 3 down vote accepted

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.

share|improve this answer
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() {
share|improve this answer

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