17

I'm not an English speaker, and I'm not very good at English. I'm self thought. I have not worked together with others on a common codebase. I don't have any friends who program. I don't work with other programmers (at least nobody who cares about these things).

I guess this might explain some of my problems in finding good unambiguous class names. I have tried to find some sort of "Programmers dictionary" containing words often used and their meanings. When reading others code I have to look up words quite often, and as many use abbreviations this poses an additional challenge.

My very limited vocabulary "forces" me to use bad class names like xxManager, xxProvider, xxWhatever. It's usually less problematic choosing variable and method names.

Other non English people out here: How have you managed to cope with this? Have you studied English so well it's not a problem? Or have you read so much code naming comes natural? Or discussed a lot with English speakers? Found any good websites, articles or other publications? As I've never read anything regarding programming in my own language, I often have more problems trying to find the words in my language...

PS: All other posts I've found was regarding mixing native tongue and English... And I understand this might be a bit off topic and might be closed.

Edit: Some resources from the answers and other stuff I use:

5
  • 15
    Your written English is better than most English and non-English speaking people on this site.
    – Ed B
    Jun 24, 2010 at 21:20
  • Perhaps better than many non-English speakers, but this is because I've read quite a lot English. The main problem is limited vocabulary. I guess the best solution is "Read a bunchload of code", but I would have loved a shortcut or some tips that might require less time.
    – simendsjo
    Jun 24, 2010 at 21:26
  • @Support :) Norwegian, but most know English better than me too - I didn't even finish high school... Couldn't quite get a grip on what your website is supposed to be.
    – simendsjo
    Jun 24, 2010 at 21:44
  • P Well that's a paradoxical, it is supposed to vote to have an StackOverflow.com for non-english speakers :P Is not doing very well though :(
    – OscarRyz
    Jun 24, 2010 at 21:57
  • jargon is very old and covers modern programming rather poorly. I use m-w.com, synonyms, thesaurus, wiktionary, wikipedia and google. And sometimes use other languages to work around reserved words, e.g. variable "klass" when python reserves "class." Jun 12, 2012 at 11:19

9 Answers 9

3

The Jargon file will help with the more obscure references people will give in the industry.
http://catb.org/jargon/html/go01.html

Other than that..finding good names for your variables/classes/etc is hard. Often times, it's harder than actually solving the problem. Here's a good resource for some common design pattern names people like to use: http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29

Examples:
AbcFactory
XyzBridge

3
  • I haven't seen the jargon site in years and had totally forgotten about it. It might serve as a good reference at least
    – simendsjo
    Jun 24, 2010 at 21:48
  • 3
    Good one. I'll start naming all my classes foo and bar. Ending in a number of course.
    – simendsjo
    Jun 24, 2010 at 21:59
  • 1
    On the off chance that last bit wasn't sarcasm..please don't. :-(
    – Caladain
    Jun 25, 2010 at 2:47
2

Could be an unorthodox suggestion, but I would recommend studying English more deeply (I am also a non-native speaker).

Expose yourself to as much English as possible! Watch movies, read English fiction, listen to technical podcasts.

Mind you, if you really want to deepen your knowledge of English, you're probably not going to learn a lot watching "Transformers". On the other hand, diving into Ulysses probably is not a good strategy either.

If you're feeling adventurous, you could always get a subscription to the New Yorker magazine. It'll do things to you - yes this is flamebaiting. :P

2

Other non English people out here:

How have you managed to cope with this?

Good naming in code matters. Using English is the preferred, but if you don't know English very well the result could be counterproductive.

I had a friend who just guessed what the correct name would be and the result was horrible. ie

String employiiNeim; // employeeName
int  eich;           // age

The problem with English, is that is not pronounced as written ( french have this minor ... ehrm characteristic ) Other languages like Spanish, German, Dutch, and others, do type and pronounce every letter in the word.

This becomes particular relevant when what you are coding are business rules or business models. In this case it is much better to use your native language.

String nombreEmpleado;
int edad;

Way much better, specially when you work with others.

Have you studied English so well it's not a problem?

Yeap, there is no other way, and a lot of practice.

You can study English the same way you study programming languages though. You can have a teacher and attend to a class room and study an hour a day. Or ( what I did ) you can just grab something that is interesting to you and try to understand it. For instance, you have a small document describing something you care, you read blogs or read content here at StackOverflow, you translate a song you like, etc. etc.

All these are study forms. There is no other way, you won't wake up one day and say: "...I know kung fu" I mean, and say: ..."I know English"

Or have you read so much code naming comes natural?

Also helps, but if you don't understand what the code means, you ... well won't make any progress.

You'll learn the programming language, and that will help you to understand English bit better, but won't help you to learn it. That's because when we program we learn the programming language not the native language.

Or discussed a lot with English speakers?

Eerhh..nope. If you have that chance go ahead, it will improve your listening and speaking, but not necessarily your writting.

The most effective way to improve your English vocabulary and grammar is by READING ( reading in your native language also improves your own language btw )

So, I would say, read as much as you can. Use your native language while you gain more confidence, and keep studying.

The English will come with time.

2

If you can't find the "Programmer's Dictionary" you're looking for, start one. Post a new question: "What entries are missing from this Dictionary for English-as-a-Second-Language-Programmers?" and seed it with 10 or 20 words/definitions you've already discovered. Once posters have suggested enough additions, move it to a a wiki somewhere and keep accepting contributions. You might end up creating a valuable resource.

1

Documenting your code with excellent prose like your question above will go a long way!

If you stick to common design patterns endemic to the language, platform, and architecture for which you're working with, other engineers should understand your nomenclature fairly easily.

2
  • I try to use design patterns where applicable, but there is plenty of more code. You used difficult words just on fun, didn't you? Endemic = very specific to the language? Nomenclature = the domain specific language?
    – simendsjo
    Jun 24, 2010 at 21:32
  • 1
    Yes, I did that for fun ;) Endemic = something that only belongs to one thing and nothing else. Nomenclature = system for giving names to things. It sounds like you're already well on your way to writing clear code that other engineers would be able to understand.
    – Mike Atlas
    Jun 24, 2010 at 21:35
1

If you are worried about it in terms of naming your own objects, just think of what your native word is for what you want to do, then go get an english language translation dictionary, and use the english language version.

0

How about using your native language? Of course (like for me as an Austrian) some letters may not be allowed - but who cares if there is Mörder or Moerder (Murder) in the class name :)

Or (as I do) use a dictionary like dict.cc or something else. I do - think what the class does - it manages game session (for an example) so it will become GameSessionManager.

Abbreviations are (at least for me) a problem - but what I've learned from other code - event native speakers use different abbreviations. And if the class is called GameSessionMgr or GameSessionMngr doesn't make a difference.

Your are not writing books or some kind of "english poem" where spelling, grammar and... counts.

You write code - and if you follow "your sepcial rules" - you and others will (after some time) be able to understand you code and class names.

1
  • This was an abbreviation - stolen from S. King's shining - redrum :)
    – ManniAT
    Jun 26, 2010 at 19:14
0

It will come with time and experience. Above all attempt to (like @Mike A says) document things until the code becomes clearer and try to be consistent.

0

This is an issue that I run into as well, even as a native English speaker. As a programmer, I often find that I need to find a descriptive word for a class, variable, function, etc. I often find myself asking a friend or coworker what verbage they would use by explaining my idea, carefully excluding any words I myself have considered as a possible choice for the class/function/variable name so as not to inhibit their creativity.

It seems to me that the English Language & Usage site proposal over at Area51 is a good place to ask such questions as "What would you call a class (or thing) that does this, this and that, and has properties x, y, and z?

2
  • Ah. This is the site Oscar Reyes was hinting about. I didn't know anything about the Area51 place. It seems like a good initiative. Seems many people forget that most people doesn't have English as their native tongue :)
    – simendsjo
    Jun 24, 2010 at 22:27
  • A bit trigger happy... Not the same site.. It seems your site is more for the serious grammar enthusiasts, and not people that doesn't know much English.
    – simendsjo
    Jun 24, 2010 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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