Boo vs C# vs Python?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1524609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Boo vs C# vs Python?
提问by PythEch
Compared to C#, Boo feels a bit more Pythonic but it's also compiled down to .NET MSIL. I liked its syntax, even more than C#'s syntax. But I couldn't find a single book teaching Boo.
与 C# 相比,Boo 感觉更像是 Pythonic,但它也被编译为 .NET MSIL。我喜欢它的语法,甚至超过 C# 的语法。但我找不到一本教布的书。
And I really don't know, if learning Boo is better than C# or learning C# is better than Boo. I just want to use some Python-like data types. Those are:
而且我真的不知道,是学习 Boo 比 C# 好还是学习 C# 比 Boo 好。我只想使用一些类似 Python 的数据类型。那些是:
{key1:value1, key2:value2}
→ dictionary[Value1,Value2,Value3]
→ List (can be edited/changed)(Value1,Value2,Value3)
→ Tuple (can't be edited/changed)
{key1:value1, key2:value2}
→ 字典[Value1,Value2,Value3]
→ 列表(可以编辑/更改)(Value1,Value2,Value3)
→ 元组(无法编辑/更改)
I use dictionaries more than list and tuples. I want to know, which one is better?
我使用字典而不是列表和元组。我想知道,哪个更好?
回答by PaulMcG
I have found Boo to be very useful in creating simple one-off scripts, while retaining my Pythonic source style. And since it compiles to runnable EXE or DLL, I can package up a single EXE with all the needed DLLs (including Boo.Lang.dll) using ILMerge, and then send that off to a client, usually for some kind of quick troubleshooting or system diagnosis.
我发现 Boo 在创建简单的一次性脚本方面非常有用,同时保留了我的 Pythonic 源代码风格。由于它编译为可运行的 EXE 或 DLL,我可以使用 ILMerge 将包含所有需要的 DLL(包括 Boo.Lang.dll)的单个 EXE 打包,然后将其发送给客户端,通常用于某种快速故障排除或系统诊断。
I also use Boo to support my C# development. I often fire up a Boo interpreter to try out variations of string or date formatting, then I can replicate the final version almost directly into C#.
我还使用 Boo 来支持我的 C# 开发。我经常启动一个 Boo 解释器来尝试字符串或日期格式的变体,然后我几乎可以直接将最终版本复制到 C# 中。
But it is darneddifficult to find docs for Boo. I had to Google quite a bit to find the syntax for generics, since they are a relatively new addition to Boo, and not yet mentioned in any tutorials, or even reference pages. And googling for "boo" generates quite a few unwanted hits, making the search even more difficult.
但该死很难找到文档的嘘声。我不得不在谷歌上搜索很多泛型的语法,因为它们是 Boo 的一个相对较新的补充,并且在任何教程甚至参考页面中都没有提到。谷歌搜索“boo”会产生很多不需要的点击,使搜索更加困难。
So in short, don't make this a choice between Boo and C# - they actually complement each other pretty well.
所以简而言之,不要在 Boo 和 C# 之间做出选择——它们实际上相互补充得很好。
回答by Jonas B
My general opinion is that it would be better to go for C# since it is from my point of view, easier to find resources, documentation and tutorials for C#.
我的一般意见是,最好选择 C#,因为从我的角度来看,它更容易找到 C# 的资源、文档和教程。
回答by Mark Heath
Knowing C# will be very useful to you if you want a career in .NET development. But learning Boo would allow you to use the Python-like features you are after in a .NET environment. You should probably also look into IronPython, which does have books available (Iron Python in Action)
如果您想从事 .NET 开发工作,了解 C# 将对您非常有用。但是学习 Boo 将允许您在 .NET 环境中使用您所追求的类似 Python 的功能。您可能还应该查看IronPython,它确实有可用的书籍(Iron Python in Action)
回答by Maximilian Mayerl
You have lists and dictionaries in .Net: System.Collections.Generic.List and System.collections.Generic.Dictionary.
您在 .Net 中有列表和字典:System.Collections.Generic.List 和 System.collections.Generic.Dictionary。
As for the language: Just learn the one that is more fun for you. The choice of language is most often religious. Expecially on the .Net platform, where each language has almost the same capabilities.
至于语言:只学习对你来说更有趣的语言。语言的选择通常是宗教性的。尤其是在 .Net 平台上,每种语言都具有几乎相同的功能。
回答by Will
I'm not sure what your end goal is, but before you give up on python please do check out the python/Qt combo for building a gui. You can build complex cross-platform guis and it's fairly easy to pick up. Qt, Python Bindings
我不确定您的最终目标是什么,但在您放弃 Python 之前,请务必查看用于构建 gui 的 Python/Qt 组合。您可以构建复杂的跨平台 gui,而且很容易上手。Qt, Python 绑定