我应该首先学习Perl 5 OO还是Moose? [英] Should I learn Perl 5 OO or Moose first?

查看:100
本文介绍了我应该首先学习Perl 5 OO还是Moose?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Perl编程还比较陌生,但是我知道Perl 5 OO的工作原理.但是,我从来没有使用Perl 5 OO创建任何项目,所以我很确定我会遇到很多陷阱.

I'm still relatively new to Perl Programming, but I know how Perl 5 OO basically works. However, I have never created any project with Perl 5 OO, so I'm quite sure I will run into many pitfalls.

最近,我发现了有关 Moose 模块的炒作.我检查了一些有关CPAN的文档,发现它非常有趣,并为我作为开发人员提供了很多帮助.此外,它似乎非常稳定和可靠.

Recently I discovered the hype about the Moose module. I checked out some documentation on CPAN and I found it to be quite interesting and helping me as a developer a lot. Additionally, it seems to be very stable and reliable.

我应该加强使用Perl 5 OO的基本语法,直到我对它非常熟悉(知道各个阶段发生了什么),或者您认为我应该直接着手使用Moose开发应用程序吗?还是我应该给Mouse试试?

Should I rather intensify working with the basic Perl 5 OO syntax until I feel very familiar with it (to know what's going on behind the stages), or do you think I should rather go ahead and directly start developing applications using Moose? Or should I even give Mouse a try?

对此的任何想法和经验都将受到赞赏.

Any thoughts and experiences on that are appreciated.

提前谢谢!

推荐答案

正如其他人指出的那样,学习Perl中OO的基础知识将不仅对大多数非麋鹿包都有帮助,而且对Moose本身,因为从头开始,Moose基本上只使用标准的Perl OO布局.基本上,一旦您感到舒适,您就会了解 Moose :: Manual :: Unsweetend 表明您将对Perl中的OO原则有一个合理的了解.达米安·康威(Damian Conway)的《面向对象的Perl》一书很好地介绍了面向对象的时期,而不仅仅是Perl的风格.我强烈建议您阅读它,或者至少阅读它的前半部分.

As everyone else has pointed out learning the basics of how OO in Perl is done will help you, not only with most non-moose packages out there but also with Moose itself since deep down Moose basically just uses a standard Perl OO layout. Basically once you're comfortable you understand what Moose::Manual::Unsweetend is showing you'll have a reasonable grasp of the OO principles in Perl. Damian Conway's Object Oriented Perl book is an excellent introduction to Object Orientation period not just Perl's flavor(s). I'd highly suggest reading it, or at least the first half of it.

最后,没有理由使用 Mouse (Moose的替代产品),除非您属于两个非常特定的类别,否则就很难启动时间,也没有严格的依赖要求.如果您不属于这两个地方,那么Moose几乎总是一个更好的答案.

Finally there is no reason to use Mouse (an alternative to Moose) unless you fall into two very specific categories, you have hard start up time constraints or hard dependency requirements. If you don't fall into those two places Moose will almost always be a better answer.

披露:我是Moose的核心开发人员,并且曾与Mouse合作并与之合作.

Disclosure: I'm a core Moose developer, and have worked on and with Mouse.

这篇关于我应该首先学习Perl 5 OO还是Moose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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