问题描述
现在我主要使用 C/C++ 进行开发,但我用 Python 编写了一些小实用程序来自动化一些任务,我真的很喜欢它作为语言(尤其是生产力).
除了性能(这个问题有时可以通过 Python 与 C 模块的轻松接口来解决),您认为它是否适合用于开发独立复杂应用程序的生产用途(例如想文字处理器或图形工具)?
您会推荐什么 IDE?在我看来,Python 提供的 IDLE 甚至对于小型项目也是不够的.
有两种方法可能对您没有用处:-)
- 我们使用的是 IronPython,而不是更常见的 CPython.这为我们提供了能够使用 .NET 类库的巨大优势.我可能在这里为自己准备好了,但我会说我从来没有真正见过看起来专业"的 CPython 应用程序 - 所以能够访问 WinForms 小部件集对我们来说是一个巨大的胜利.IronPython 还为我们提供了一个优势,即如果我们需要提高性能,我们可以轻松地使用 C#.(虽然说实话,我们从来没有需要这样做.迄今为止,我们所有的性能问题都是因为我们选择了愚蠢的算法,而不是因为语言很慢.)从 IP 使用 C# 要容易得多而不是为 CPython 编写 C 扩展.
- 我们是一家极限编程公司,因此我们在编写代码之前先编写测试.如果不先编写测试,我不会用动态语言编写生产代码;缺少编译步骤需要被某些东西覆盖,正如其他人所指出的那样,没有它的重构可能会很困难.(Greg Hewgill 的回答表明他遇到了同样的问题.另一方面,如果不先编写测试,我认为这些天我不会用 任何 语言编写 - 或者特别是重构 - 生产代码 - 但是YMMV.)
Re:IDE - 我们对每个人都使用他们最喜欢的文本编辑器非常满意;如果您更喜欢重量级的东西,那么 WingIDE 非常受欢迎.
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity).
Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)?
What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
We've used IronPython to build our flagship spreadsheet application (40kloc production code - and it's Python, which IMO means loc per feature is low) at Resolver Systems, so I'd definitely say it's ready for production use of complex apps.
There are two ways in which this might not be a useful answer to you :-)
- We're using IronPython, not the more usual CPython. This gives us the huge advantage of being able to use .NET class libraries. I may be setting myself up for flaming here, but I would say that I've never really seen a CPython application that looked "professional" - so having access to the WinForms widget set was a huge win for us. IronPython also gives us the advantage of being able to easily drop into C# if we need a performance boost. (Though to be honest we have never needed to do that. All of our performance problems to date have been because we chose dumb algorithms rather than because the language was slow.) Using C# from IP is much easier than writing a C Extension for CPython.
- We're an Extreme Programming shop, so we write tests before we write code. I would not write production code in a dynamic language without writing the tests first; the lack of a compile step needs to be covered by something, and as other people have pointed out, refactoring without it can be tough. (Greg Hewgill's answer suggests he's had the same problem. On the other hand, I don't think I would write - or especially refactor - production code in any language these days without writing the tests first - but YMMV.)
Re: the IDE - we've been pretty much fine with each person using their favourite text editor; if you prefer something a bit more heavyweight then WingIDE is pretty well-regarded.
这篇关于Python 适合大型软件项目(不是基于 Web 的)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!