务实的跨平台(并且非常快地使其 - 实际上 - 工作)“一次性”代码:哪种语言/工具?
我的开发风格让我编写了很多丢弃的“辅助”代码,
无论是自动生成代码部分、半自动测试,还是通常构建虚拟模型、原型或临时“陪练伙伴” ” 为主要开发; 我知道我不是唯一的人...
因为我经常在 Windows 和 Unicies 下工作,所以我想非完全专注于单一的“瑞士军刀”< /strong> 工具可以在两种环境中工作,差异有限,这将允许我做一些常见的事情,比如文本解析、数据库访问、套接字、重要的文件系统和进程操作,
直到现在在unix下我'我用过一点perl 和大量的 shell 脚本,但后者有点有限,而且 perl...尽管它非常有能力并且拥有用于一系列令人难以置信的职责的模块,但真诚地我发现它对我来说太“敌对” 对于超过 100 行代码的内容。
你有什么建议?
脚本不是必需的,使用更多静态风格的语言是可以的,如果它能让开发更快(让程序真正完成他们的工作并且可能处于人类可读的状态)以及如果处理错误/异常并适应动态环境不会变得噩梦(例如,我不喜欢硬连线数据我的代码中的 /db 表结构,尤其是 手)。
我对python、ruby很感兴趣,但也许groovy(它能够访问庞大的类库和紧凑的语法)或者其他更适合的东西,
非常感谢!
(同时,在一个完全不同的方面,scala 看起来真的很诱人,只是因为它的干净,但这 - 可能 - 一个完全不同的故事,除非你告诉我相反的......?)
my development style brings me to write a lot of throw-away "assisting" code,
whether for automatic generation of code parts, semi-automated testing, and generally to build dummies, prototypes or temporary "sparring partners" for the main development; I know I'm not the only one...
since I frequently work both under windows and Unicies, I'd like to non-exclusively focus on a single "swiss army knife" tool that can work in both the environments with limited differences, that would allow me to do usual stuff like text parsing, db access, sockets, nontrivial filesystem and process manipulation
until now under unix I've used a bit of perl and massive amounts of shell scripts, but the latter are a bit limited and perl... despite being very capable and having modules for an incredible array of duties, sincerely I find it too "hostile" for me for something that goes beyond 100 lines of code.
what would you suggest?
scripting is not a requirement, it would be ok to use more static-styled languages IF it makes development faster (getting programs to actually do their work and possibly in a human readable state) and if it doesn't become nightmarish to handle errors/exception and to adapt to dynamic environments (e.g. I don't like to hardwire data /db table structure in my code, especially by hand).
I've been intrigued by python, ruby, but maybe groovy (with its ability to access the huge class library and his compact syntax) or something else is better suited
thanks a lot in advance!
(meanwhile, on a completely different note, scala looks really tempting just for the cleanliness of it, but that's - probably - a completely different story, unless you tell me the opposite...?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Python 可以说是最好的选择之一。它最大的好处是它有一个巨大的内置库可以做各种各样的事情。它也很成熟,非常跨平台,积极开发,并且有许多支持选项(邮件列表,新闻组等)。
此外,它还有一个内置的 GUI 工具包 (tkinter),适合您需要编写快速 GUI 来获取用户输入或显示正在运行的进程的输出的情况。如果您不喜欢 tkinter,还有其他跨平台 GUI 工具包可用。
Python is arguably one of the best choices. Its biggest benefit is that it has a huge built-in library for doing all sorts of stuff. It is also mature, very cross-platform, actively developed, and has many support options (mailing lists, newsgroups, etc).
In addition, it has a built-in GUI toolkit (tkinter) for those times when you need to write a quick GUI to get input from a user or display output from a running process. And if you don't like tkinter, there are other cross-platform GUI toolkits available.
我建议使用Python。
对我来说,它具有良好的库、文档、社区、跨平台功能以及易于编写/阅读的优点。
它填补了与 Perl 类似的空白,但如果您发现 Perl 对较长的脚本“敌对”,您可能会喜欢 Python,尤其是与 Ruby 相比,恕我直言,Ruby 感觉更像 Perl-y。
顺便说一句,所有这些都很容易尝试 - 为什么不这样做呢?
然后您可以自己决定,而不是相信在线论坛的可疑智慧(:
I suggest Python.
For me it has a sweet spot of good libraries, documentation, community, cross-platform functionality, and ease of writing/reading.
It fills a similar niche to Perl's, but if you find Perl to be 'hostile' for longer scripts, you will probably like Python, especially when compared to Ruby, which feels more Perl-y, IMHO.
As an aside, all of these are quite easy to just try out - why not do that?
Then you can decide for yourself instead of trusting the questionable wisdom of an online forum (:
我认为 Python 和 Ruby 是你最好的选择,具体取决于你如何思考和编码。
我个人认为 Python 非常可读,而且它的语法非常直观。我听说 Python 被描述为“伪代码加冒号”。
另一方面,一旦你克服了 Ruby 稍微奇怪的语法,Ruby 就可以实现高速开发。它是围绕 DRY 原则和配置前约定构建的,这对于快速原型设计非常有用。
还有其他语言——尤其是 Haskell 和 Lisp 方言——可以实现超快速的原型设计,但它们没有那么大的支持社区,因此库和讨论供应短缺。
I think that Python and Ruby are your best bets, depending on exactly how you think and code.
I personally find Python EXTREMELY readable and its syntax is highly intuitive. I've heard Python described as "pseudo-code plus colons."
On the other hand, once you get around its slightly bizarre syntax, Ruby makes for high-speed development. It's built around DRY principles and convention-before-configuration, which is great for rapid prototyping.
There are other languages--especially Haskell and the Lisp dialects--that can make for super-rapid prototyping, but they don't have as large a supportive community, so there's a shortage in library and discussion supply.