为什么要学习Perl,Python和Ruby的,如果公司使用C ++,C#或Java作为应用程序的语言吗? [英] Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?

查看:165
本文介绍了为什么要学习Perl,Python和Ruby的,如果公司使用C ++,C#或Java作为应用程序的语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么会是C ++,C#,Java开发人员想要了解一种动态的语言?

I wonder why would a C++, C#, Java developer want to learn a dynamic language?

假设公司将不会从C切换其主要开发语言++ / C#/ Java的一个动态的有什么用有一个动态的语言吗?

Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language?

可以用动态语言的只有几天后,更快,更好做什么帮手任务学习比你已经使用了好几年静态语言?

What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years?

看到后先几份答复很显然,有两个问题。
我的主要兴趣是东西是合理的雇主为费用。
也就是说,我找理由为雇主资助的动态语言的学习。除了显而易见的员工将拥有更广阔的视野,在
雇主通常寻找一些真实的好处。

After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.

推荐答案

很多时候一些快速任务上来,是不是你正在开发的主要软件的一部分。有时,任务是一次性的,即比较这文件数据库,让我知道的差异。这是一个容易得多做在Perl / Ruby的/ Python的文本解析比在Java或C#(部分因为它是一个更容易使用正则表达式)。它可能会少走很多的时间使用Perl /拼音/ Python(或者甚至VBScript中的畏缩的解析文本文件,然后将其加载到数据库会比创建一个Java / C#程序做,或做手工了。

A lot of times some quick task comes up that isn't part of the main software you are developing. Sometimes the task is one off ie compare this file to the database and let me know the differences. It is a lot easier to do text parsing in Perl/Ruby/Python than it is in Java or C# (partially because it is a lot easier to use regular expressions). It will probably take a lot less time to parse the text file using Perl/Ruby/Python (or maybe even vbscript cringe and then load it into the database than it would to create a Java/C# program to do it or to do it by hand.

此外,由于在大多数的动态语言解析文本的难易程度,他们是伟大的代码生成。当然最终的项目必须是在C#/的Java /处理SQL但不是剪切和粘贴的100倍,发现错误,并切割和粘贴另一个100倍,常常(但不总是)更容易只是使用代码发生器。

Also, due to the ease at which most of the dynamic languages parse text, they are great for code generation. Sure your final project must be in C#/Java/Transact SQL but instead of cutting and pasting 100 times, finding errors, and cutting and pasting another 100 times it is often (but not always) easier just to use a code generator.

在工作中最近的一个例子是我们需要得到一个会计系统中的数据为我们的会计系统,该系统有一个导入的格式,但旧系统有一个完全不同的格式(固定宽度虽然有些东西必须匹配)的任务不是创建一个程序来一遍又一遍迁移数据。它是将数据推到我们的系统,然后保持在那里前进。因此,即使我们是一个C#和SQL Server店,我用Python来将数据转换成可以通过我们的应用程序导入的格式。最终不要紧,我用蟒蛇,它的事项,该数据是在系统中。我的老板是非常深刻的印象。

A recent example at work is we needed to get data from one accounting system into our accounting system. The system has an import format, but the old system had a completely different format (fixed width although some things had to be matched). The task is not to create a program to migrate the data over and over again. It is to shove the data into our system and then maintain it there going forward. So even though we are a C# and SQL Server shop, I used Python to convert the data into the format that could be imported by our application. Ultimately it doesn't matter that I used python, it matters that the data is in the system. My boss was pretty impressed.

在那里我经常看到用于动态语言的测试。这是很容易创建一个Python / Perl的/ Ruby程序链接到一个Web服务,并抛出反对它的一些数据比它是建立相应的Java程序。您也可以使用Python撞到命令行程序,生成一吨垃圾(但仍然有效)测试数据等很容易。

Where I often see the dynamic languages used for is testing. It is much easier to create a Python/Perl/Ruby program to link to a web service and throw some data against it than it is to create the equivalent Java program. You can also use python to hit against command line programs, generate a ton of garbage (but still valid) test data, etc.. quite easily.

其他的事情,动态语言上的代码生成大。创建C#/ C ++ / Java代码。下面是一些例子:

The other thing that dynamic languages are big on is code generation. Creating the C#/C++/Java code. Some examples follow:

第一个代码生成任务,我经常看到的是使用动态语言维护系统中的常量的人。相反,手动编码一束枚举的,动态语言可以用相当轻松地分析文本文件,并创建一个枚举在Java / C#代码。

The first code generation task I often see is people using dynamic languages to maintain constants in the system. Instead of hand coding a bunch of enums, a dynamic language can be used to fairly easily parse a text file and create the Java/C# code with the enums.

SQL是一个整体的其他球赛但是常常被截获得更好的性能和粘贴100倍,而不是试图做一个功能(由于执行计划,或将复杂的逻辑函数中的缓存造成你按行而不是在一组走行)。事实上,它是使用表定义自动创建某些存储过程非常有用的。

SQL is a whole other ball game but often you get better performance by cut and pasting 100 times instead of trying to do a function (due to caching of execution plans or putting complicated logic in a function causing you to go row by row instead of in a set). In fact it is quite useful to use the table definition to create certain stored procedures automatically.

它始终是更好地得到买一个代码生成器。但是,即使你不这样做,是不是更多的乐趣,花时间切割/粘贴或者是更多的乐趣,一次创建一个Perl / Python的/ Ruby脚本,然后有一个生成的代码?如果需要您的时间把代码的东西,但更短的时间来创建一个代码生成器,那么,即使你使用它一旦你节省了时间和金钱,因此。如果它需要你的时间比它需要手工编写一次,但你知道你将不得不更新代码不止一次创建一个代码生成器,它可能仍然是有意义的。如果您需要2个小时的手代码,4个小时做了发电机,但你知道你得把代码相当于工作另一个5或6倍,这显然是最好创建发电机。

It is always better to get buy in for a code generator. But even if you don't, is it more fun to spend time cutting/pasting or is it more fun to create a Perl/Python/Ruby script once and then have that generate the code? If it takes you hours to hand code something but less time to create a code generator, then even if you use it once you have saved time and hence money. If it takes you longer to create a code generator than it takes to hand code once but you know you will have to update the code more than once, it may still make sense. If it takes you 2 hours to hand code, 4 hours to do the generator but you know you'll have to hand code equivalent work another 5 or 6 times than it is obviously better to create the generator.

还有些东西是用比Java / C#/ C / C ++动态语言更加容易。特别是正则表达式浮现在脑海中。如果你开始在Perl中使用正则表达式,并实现自己的价值,你可能突然开始利用了Java正则表达式库,如果你之前还没有。如果你有那么有可能是别的东西。

Also some things are easier with dynamic languages than Java/C#/C/C++. In particular regular expressions come to mind. If you start using regular expressions in Perl and realize their value, you may suddenly start making use of the Java regular expression library if you haven't before. If you have then there may be something else.

我会离开你,将有一个动态语言是伟大任务的最后一个例子。我的工作伴侣不得不采取一个目录文件的完整和它们刻录到光盘各个公司不同客户。有几个客户,但大量的文件,你不得不看着他们,看看他们是什么。他做手工这项任务....一个Java / C#程序会保存时间,但一次,并与所有发展开销是不值得的。然而拍打的东西一起在Perl / Python的/ Ruby的很可能会是值得的。他花了几个小时做。它会采取不到一个创建Python脚本来检查每个它去哪个客户档案,比赛,然后将文件移动到合适的位置.....再次,不是标准作业的一部分。但任务上来为一次性。它是更好地做自己,花费的时间量较大使Java / C#做任务,或者花的时间少得多在Python / Perl的/红宝石做。如果您正在使用C或C ++的一点是更为显着,由于C或C ++编程的额外关注(指针,没有数组边界检查,等等)。

I will leave you with one last example of a task that would have been great for a dynamic language. My work mate had to take a directory full of files and burn them to various cd's for various customers. There were a few customers but a lot of files and you had to look in them to see what they were. He did this task by hand....A Java/C# program would have saved time, but for one time and with all the development overhead it isn't worth it. However slapping something together in Perl/Python/Ruby probably would have been worth it. He spent several hours doing it. It would have taken less than one to create the Python script to inspect each file, match which customer it goes to, and then move the file to the appropriate place.....Again, not part of the standard job. But the task came up as a one off. Is it better to do it yourself, spend the larger amount of time to make Java/C# do the task, or spend a much smaller amount of time doing it in Python/Perl/Ruby. If you are using C or C++ the point is even more dramatic due to the extra concerns of programming in C or C++ (pointers, no array bounds checking, etc.).

这篇关于为什么要学习Perl,Python和Ruby的,如果公司使用C ++,C#或Java作为应用程序的语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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