为什么没有更多的应用程序编写的多国语言? [英] Why aren't more applications written in multiple languages?

查看:91
本文介绍了为什么没有更多的应用程序编写的多国语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

甚至二十年前,它是可以调用code编写的一种语言叫写在另一code;在学校里,我们称之为装配图形程序从阿达code内一类的任务。值得注意的例外是从脚本中运行编译code或编译code中执行系统命令;但我们很少写C ++库在我们的Java应用程序使用。当Java的第一次出现,它仍然缓慢,出现了用Java编写的应用程序主要和移动瓶颈code到一些C / C ++动态链接库使用JNI调用的选项。

Even 2 decades ago, it was possible to call code written in one language to call code written in another; in school we called assembly graphics routines from within Ada code for one class assignment. Notable exceptions are running compiled code from within scripts or executing a system command from within compiled code; but rarely do we write a library in C++ to use in our Java app. When Java first appeared and it was still slow, there was the option of writing the main app in Java and moving the bottleneck code into some C/C++ dll to be called using JNI.

所以,毕竟这些年来,是什么让我们从编写多语言应用程序吗?主要的场景我心目中是当语言被认为是一个不错的选择,如果不是因为某些性能瓶颈(如在earlly的Java天),所以它不是使用两种语言的混合完全用C语言编写。

So, after all these years, what keeps us from writing multi-language apps? The primary scenario I have in mind is when a language is considered a good choice if it weren't for some performance bottleneck (like in the earlly Java days) so it's written entirely in C instead using a mix of the two languages.

我是从架构的角度,以及语言的设计感兴趣。你有什么很好的例子,成功的故事,或报价?

I'm interested in this from an architecture perspective as well as language-design. Do you have any good examples, success stories, or quotes?


其中的最好的例子是对Java中的反弹,因为它的性能低下早期。虽然JIT编译已经解决了这个问题,我的问题是关于始终在这使得它更容易编写,阅读和维护语言编写软件。如果存在一个瓶颈,写在汇编语言或C例程只是为瓶颈。这样,你应该得到两全其美的,至少在理论上。

One of the best examples of this was the backlash against Java because of it's slow performance early on. Even though JIT compilers have addressed the issue, my question was always about writing software in a language that makes it easier to write, read, and maintain. If there is a bottleneck, write a routine in assembly or C just for the bottleneck. That way you should get the best of both worlds, at least theoretically.

推荐答案

这是我看到的是,因为它需要对球队每个人都非常不同(见乔恩斯基特的答案)最大的问题。如果你有一队十人三知道C#的非常好,一些VB.NET,三知道VB.NET非常好,非常小的C#和其他四个知道C ++非常好,但仅在C#或VB没关系。净,你能想象什么样的程序,他们会写是多语言?它可能会变成还好,但如果你失去了一对夫妇的团队成员,时间的本质,并说这是你的C ++的家伙,现在谁去解决这个问题code?肯定不是.NET的家伙谁不是在C ++不同。这可能会导致很多问题。

The biggest problem that I see is because it requires everyone on the team to be very diverse (see Jon Skeet's answer). If you have a team of ten people and three know C# very well and some VB.NET, three know VB.NET very well and very little C#, and the other four know C++ very well, but are only okay on C# or VB.Net, can you imagine what kind of program they would write being multilanguage? It may turn out okay, but what if you lose a couple team members, time is of the essence, and say it was your C++ guys, now who is going to fix that code? Surely not the .NET guys who are not diverse in C++. This can cause a lot of problems.

我明白为什么今天的应用大多是单一语言的第二个原因是因为当你达到一个较高的数量code的线条,这是非常好的,能够按照同样的流程,模式和看到的一样整个系统code类型。你的大脑并不一定语言之间进行切换到想办法的,因为你已经在思C#为例。

The second reason I see why applications are mostly single-language today is because when you reach a high number of lines of code, it's very nice to be able to follow the same flow, patterns, and see the same type of code throughout the system. Your brain does not have to switch between languages to figure something out, because you're already "thinking C#" for example.

我有一个朋友,谁在VB.Net编写了用户界面,和他的后台code,他总是在DLL在C#商店。这是正常的,VB.NET和C#的工作真的很好在一起,但说他需要外包给别人修理code的细分市场,一个bug是无论是在VB.NET和C#code,以及,他为需要外购两名开发人员,一是精通VB.NET,和其他在C#。这增加了成本2倍,以及开销的时候,他可能只是做了一个。

I have a friend who writes his user interfaces in VB.Net, and his backend code which he always stores in DLL's in C#. This is okay, VB.NET and C# work really well together, but say he needed to outsource it to someone to fix a segment of code where a bug was both in the VB.NET and C# code, well, he made to need to outsource two developers, one fluent in VB.NET, and the other in C#. This increases costs two-fold, as well as overhead when he could have just done it in one.

不过我完全同意有关可能使用C ++性能的关键部分的应用程序。有次,其中根本.NET可能不是code的性能的关键环节一个不错的选择。这种code混合绝对是好的。

I however, completely agree about applications that may use C++ for performance critical sections. There are times, where simply .NET may not be a good choice for a performance critical segment of code. This kind of code mixing is absolutely okay.

在从长远来看,code混合是不是一件坏事。它可以是一件好事,因为它会帮助你作为一个开发者变得更加多样化,改变你的思维方式,并帮助你作为一个开发商。但是,你必须是更多的开销,可能是成本,甚至沿途有些无奈prepared。

In the long run, code mixing is not a bad thing. It can be good because it will help you as a developer become more diverse, change the way you think, and help you as a developer. But you must be prepared for more overhead, possibly costs, and maybe even some frustration along the way.

也许一个好主意,你(如果你正在寻找这种类型的答案)是选择每种技术的语言。我个人写在VB.NET我所有的Web应用程序(asp.net等)。这是快写,很容易阅读和易于维护。而对于网络,这正是你想要的。我所有的桌面应用程序但将被推到C#,因为它在某些方面较强的语言,并提供了一​​些东西VB.NET没有。说真的,在这里,这是所有个人preference,但你的想法。

Maybe a good idea for you, (if you're looking for this type of answer) would be to choose the language per technology. I personally write all my web apps (asp.net etc) in VB.NET. It's fast to write, it's easy to read and easy to maintain. And for the web, that's exactly what you want. All my desktop applications however get pushed into C#, because it's a stronger language in some aspects, and offers a few things VB.NET does not. Really, here this is all personal preference, but you get the idea.

这篇关于为什么没有更多的应用程序编写的多国语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆