非母语程序员词典/词典
我不是一个说英语的人,而且我的英语也不是很好。我自以为是。我还没有与其他人在共同的代码库上合作过。我没有任何编程的朋友。我不与其他程序员一起工作(至少没有人关心这些事情)。
我想这可能可以解释我在寻找良好的明确类名时遇到的一些问题。我试图找到某种“程序员词典”,其中包含常用的单词及其含义。当阅读其他代码时,我必须经常查找单词,并且由于许多人使用缩写,这带来了额外的挑战。
我非常有限的词汇量“迫使”我使用不好的类名,如 xxManager、xxProvider、xxWhatever。选择变量和方法名称通常问题不大。
这里的其他非英国人:你是如何应对这个问题的?你英语学得这么好,没问题吗?或者你读了这么多代码,命名变得很自然吗?或者与说英语的人讨论了很多?发现任何好的网站、文章或其他出版物吗?由于我从未读过任何有关用我自己的语言进行编程的内容,因此在尝试查找我的语言中的单词时经常会遇到更多问题...
PS:我发现的所有其他帖子都是关于混合母语和英语...并且我知道这可能有点偏离主题,可能会被关闭。
编辑:来自答案和我使用的其他内容的一些资源:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
行话文件将有助于人们在行业中提供更晦涩的参考。
http://catb.org/jargon/html/go01.html
除此之外..为变量/类/等找到好的名称很难。很多时候,这比实际解决问题更困难。这是人们喜欢使用的一些常见设计模式名称的好资源:http://en .wikipedia.org/wiki/Design_pattern_%28computer_science%29
示例:
AbcFactory
XYZ桥
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
可能是一个非正统的建议,但我建议更深入地学习英语(我也是非母语人士)。
尽可能多地接触英语!看电影、读英语小说、听技术播客。
请注意,如果您真的想加深英语知识,那么观看“变形金刚”可能不会学到很多东西。另一方面,深入研究《尤利西斯》可能也不是一个好的策略。
如果您喜欢冒险,您可以随时订阅《纽约客》杂志。它会对你做一些事情——是的,这就是煽动。 :P
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
代码中良好的命名很重要。使用英语是首选,但如果您不太懂英语,结果可能会适得其反。
我有一个朋友,他只是猜测正确的名字是什么,结果很糟糕。即
英语的问题是,它的发音不像书面的那样(法语有这个小... ehrm 特征)其他语言,如西班牙语、德语、荷兰语等,会键入并发音单词中的每个字母。
当您编码的内容是业务规则或业务模型时,这一点变得特别重要。在这种情况下,最好使用您的母语。
好多了,特别是当你与他人一起工作时。
是的,没有其他办法,需要大量练习。
不过,您可以像学习编程语言一样学习英语。你可以有一位老师,去教室,每天学习一小时。或者(我所做的)你可以抓住一些你感兴趣的东西并尝试理解它。例如,你有一个小文档描述你关心的事情,你阅读博客或在 StackOverflow 上阅读内容,你翻译一首你喜欢的歌曲等等。
所有这些都是学习形式。没有其他办法,你不会有一天醒来说:“...我懂功夫”我的意思是,然后说:...“我懂英语”
也有帮助,但如果你不理解代码的含义,你......那么就不会取得任何进展。
你将学习编程语言,这将帮助你更好地理解英语,但不会帮助你学习英语。这是因为当我们编程时,我们学习编程语言而不是母语。
Eerhh..nope。如果你有机会继续下去,它会提高你的听力和口语,但不一定会提高你的写作。
提高英语词汇量和语法的最有效方法是阅读(用你的母语阅读也可以提高你自己的语言)
所以,我想说,尽可能多地阅读。使用您的母语,同时获得更多信心并继续学习。
英语会随着时间的推移而出现。
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
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.
Way much better, specially when you work with others.
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"
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.
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.
如果您找不到所需的“程序员词典”,请启动一本。发布一个新问题:“英语作为第二语言程序员词典中缺少哪些条目?”并用您已经发现的 10 或 20 个单词/定义作为种子。一旦发帖者提出了足够的补充建议,请将其移至维基百科的某个地方并继续接受贡献。您最终可能会创造出宝贵的资源。
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.
用像上面的问题这样的优秀散文来记录你的代码将会大有帮助!
如果您坚持使用您正在使用的语言、平台和架构所特有的常见设计模式,其他工程师应该相当容易理解您的术语。
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.
如果您担心为自己的对象命名,只需想想您的母语单词是什么来表示您想要做的事情,然后去找一本英文翻译词典,并使用英文版本。
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.
使用您的母语怎么样?
当然(就像我作为一个奥地利人一样)有些字母可能是不允许的 - 但谁在乎类名中是否有 Mörder 或 Moerder(谋杀):)
或者(就像我一样)使用像 dict.cc 这样的字典或其他东西别的。
我确实 - 想想这个类的作用 - 它管理游戏会话(例如),因此它将成为 GameSessionManager 。
缩写是(至少对我来说)一个问题 - 但我从其他代码中了解到 - 事件母语人士使用不同的缩写。
如果类被称为 GameSessionMgr 或 GameSessionMngr 并没有什么区别。
你写的不是拼写、语法和……很重要的书或某种“英语诗”。
您编写代码 - 如果您遵循“您的特殊规则” - 您和其他人将(一段时间后)能够理解您的代码和类名。
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.
它会随着时间和经验的推移而到来。最重要的是尝试(就像 @Mike A 所说的)记录事情,直到代码变得更清晰并尝试保持一致。
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.
即使作为一个以英语为母语的人,这也是我遇到的一个问题。作为一名程序员,我经常发现我需要为类、变量、函数等找到一个描述性的单词。我经常发现自己问朋友或同事他们会用什么措辞来解释我的想法,小心地排除我自己的任何单词已考虑作为类/函数/变量名称的可能选择,以免抑制他们的创造力。
在我看来,英语语言和语言Area51 上的使用站点提案是提出此类问题的好地方,例如“您会如何称呼执行此、此和那操作并具有属性 x、y 和 z 的类(或事物)?
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?