Catalyst+Mason+Template::Toolkit 是否值得学习而不是坚持使用 LAMP+Axkit?

发布于 2024-07-10 17:26:40 字数 1447 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

温柔女人霸气范 2024-07-17 17:26:40

回答您的问题....

  1. “职业发展” - MVC 是一种很好的编程实践,因此获得它的知识和经验肯定会增强您的职业潜力。

  2. “轻松构建强大的 Web 2.0 网站” - Catalyst 无疑使这变得更加容易,因为已经有人已经做到了这一点(即 CPAN 上的模块)。

  3. “Catalyst 实际上在哪些方面比 LAMP 更好?” - 嗯,实际上它们只是不同。 然而 Catalyst 确实强制执行了清晰的编程范式 (MVC),这使得测试、重构、生成可重用代码等变得更加容易......恕我直言;-)

希望这会有所帮助。

附言。 Catalyst 是 Perl 上的 Web (MVC) 框架之父,我强烈推荐它。 不过,请检查替代方案...建议一些好的 Perl 中的 MVC 框架。

聚苯硫醚。 可以在 Perl5 Wiki。

购买力平价。 Perl 现在并将继续是 Web (2.0) 开发的一个不错的选择(即忽略 FUD)。 如果我偶然错了,那么学习 Catalyst / MVC 之类的东西将为您提供必要的技能,这些技能可以轻松地应用于其他地方。

Answers to your questions....

  1. "career development" - MVC is a good programming practice so gaining knowledge and experience of it would definitely enhance your career potential.

  2. "ease of building powerful web 2.0 website" - Catalyst certainly make this a lot easier because there are already people that have been there and done it (ie. modules on CPAN).

  3. "in what way is Catalyst actually better than LAMP?" - Well really they're just different. However Catalyst does enforce a clear programming paradigm (MVC) which makes testing, refactoring, producing reusable code and much more a lot easier... IMHO ;-)

Hope this helps.

PS. Catalyst is the daddy of web (MVC) frameworks on Perl and I highly recommend it. However do check out the alternatives... Suggest some Good MVC Framework in Perl.

PPS. A good list of web frameworks (not just MVC ones) can be found on Perl5 Wiki.

PPPS. Perl is and will continue be a good choice for web (2.0) development (ie. ignore the FUD). If by chance I'm wrong then learning something like Catalyst / MVC will provide you with necessary skills which are easily adaptable elsewhere.

疯到世界奔溃 2024-07-17 17:26:40

LAMP 是 Linux、Apache、Mysql 和 Perl。 那只是一个堆栈。 如果您使用 Perl Web 框架,那么您仍然在使用 Perl。 您实际上并没有在 LAMP 和 Catalyst 或 Mason 之间进行选择。

LAMP is Linux, Apache, Mysql, and Perl. That's just a stack. If you use a Perl web framework, you're still using Perl. You're not really choosing between LAMP and Catalyst or Mason.

旧瑾黎汐 2024-07-17 17:26:40

Catalyst 似乎是一个非常好的框架,尤其是与 模板工具包。 如果你想学习 Catalyst,我肯定会通读 Catalyst 教程

Template Toolkit 在我看来是一个比 梅森

就我个人而言,我认为 Template Toolkit 值得学习,即使您不将其用于网络。

Template-Toolkit.org复制的代码

[% FOREACH person IN people %]
[%   IF loop.first %]
<table>
  <tr>
    <th>Rank</th>
    <th>Name</th>
    <th>Email</th>
  </tr>
[%   END %]
  <tr>
    <td>[% loop.count %]</td>
    <td>[% person.name %]</td>
    <td>[% person.email %]</td>
  </tr>
[%   IF loop.last %]
</table>
[%   END %]
[% END %]

您甚至可以嵌入< a href="http://template-toolkit.org/docs/manual/Directives.html#section_PERL" rel="nofollow noreferrer">Perl 代码直接添加到您的模板中。 必须启用 EVAL_PERL 选项才能评估 Perl 代码。

[% TRY %]
   [% PERL %]
      die "nothing to live for\n";
   [% END %]
[% CATCH %]
   error: [% error.info %]
[% END %]

Catalyst seems to be a very good framework, especially when coupled with Template Toolkit. If you want to learn Catalyst, I would definitely read through the Catalyst tutorial.

Template Toolkit seems to me to be a more capable template processing system than Mason.

Personally, I think Template Toolkit is worth learning, even if you don't use it for the web.

Code copied from Template-Toolkit.org

[% FOREACH person IN people %]
[%   IF loop.first %]
<table>
  <tr>
    <th>Rank</th>
    <th>Name</th>
    <th>Email</th>
  </tr>
[%   END %]
  <tr>
    <td>[% loop.count %]</td>
    <td>[% person.name %]</td>
    <td>[% person.email %]</td>
  </tr>
[%   IF loop.last %]
</table>
[%   END %]
[% END %]

You can even embed Perl code directly into your templates. The EVAL_PERL option must be enabled for Perl code to be evaluated.

[% TRY %]
   [% PERL %]
      die "nothing to live for\n";
   [% END %]
[% CATCH %]
   error: [% error.info %]
[% END %]
回眸一遍 2024-07-17 17:26:40

我知道这个帖子已经很老了,但我会贡献一个想法。 恕我直言,学习新东西总是值得的,即使你认为你不会专业地使用它。 接触新代码几乎总是会带来新的见解。 这些见解可能是负面的:“他们为什么这样做?这毫无意义?”。 但我认为更多时候你会想出一种看待事物的新方式,或者解决常见问题的新方法。

这些见解有助于防止程序员变得陈旧。 也许这就是为什么这么多人编写自己的编程语言,或者重新发明轮子等等。

I know this thread is quite old, but I'll contribute one thought. IMHO it's always worthwhile learning something new, even if you think you won't use it professionally. The exposure to new code almost always leads to new insight. The insights might be negative: "Why did they do it that way? That makes no sense?". But I think more often you'll come out with a new way of looking at things, or a new approach to solving a common problem.

These insights are what help to keep programmers from getting stale. Perhaps this is why so many people write their own programming languages, or are re-inventing the wheel, and so on.

弥枳 2024-07-17 17:26:40

我同意戴夫·罗尔斯基(Dave Rolsky)的观点:称 TT 比梅森“更有能力”是一个糟糕的措辞。 喜欢 TT 的人似乎喜欢它,因为它应该“更干净”。 从 Mason 转到 TT,TT 感觉就像一件相当紧身的直筒夹克。 假设您很可能在 TT 内部以及 Mason 内部“拥有 Perl 的全部功能”,但是对它的访问被隐藏了,事实上,如果它不被隐藏,它就会失去它的一个真正的卖点:它不会'看起来不再“干净”了。

我自己,我不确定我是否会承认 TT 是“更干净”(如果 Perl 人能够停止内化反 Perl 诽谤运动中的言论,并克服这种自卑情结,那就太酷了)。 如果这个想法是网络猴子应该更擅长修改 TT 中的控制结构而不是 Mason 中的控制结构,那么我认为这并不成立:我希望在任何情况下它们通常都需要来自真正程序员的帮助。

I agree with Dave Rolsky: calling TT "more capable" than Mason is a poor choice of words. People who like TT appear to like it because it's supposed to be "cleaner". Coming to TT from Mason, TT feels like a fairly tight straight-jacket. Hypothetically you may very well "have the full power of perl" inside of TT as well as inside of Mason, but access to it is buried, and indeed if it weren't buried it would lose it's one real selling point: it wouldn't seem "cleaner" any more.

Myself, I'm not sure I would conceed that TT is "cleaner" (it would be kind of cool if perl people would stop internalizing the rhetoric from the anti-perl smear campaign, and get over this inferiority complex). If the idea is that web-monkeys are supposed to be better at munging control structures in TT rather than in Mason, I would suggest that that's not established: I would expect that typically they'd need help from a Real Programmer in any case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文