Perl 的复杂性?

发布于 2024-08-08 08:46:42 字数 127 浏览 9 评论 0原文

关于 Perl 编程语言的复杂性的一般讨论是什么,比如人们应该真正关注什么在讨论其复杂性时?

What is the general discussion of the complexity of the Perl programming language, like what should one really focus on when discussing its complexity?

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

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

发布评论

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

评论(2

复古式 2024-08-15 08:46:42
  • 完成同一件事的方法有很多,其中一些由于其作为脚本语言的传统而结构很差
  • 当您更改前导字符时,变量引用似乎会更改变量的类型,例如从 @ 到 $
  • 函数调用和结果返回机制
  • PERL 很难读懂。 PERL 程序的编写者也会在返回自己的代码并理解它时遇到困难
  • 正则表达式太容易使用,并且经常在解析器或纯字符串函数会更清晰和更高效的地方使用
  • 即使是 网络早期的 PERL 编程书籍,很多都写得很差,很多人以非常非结构化的方式学习 PERL。这使得管理以一致的方式编写专业级代码的团队变得更加困难
  • Many ways to accomplish the same thing, some of which are poorly structured due to its heritage as a scripting language
  • The way that variable references seem to change the type of the variable when you change the leading character, e.g. from @ to $
  • The function calling and result returning mechanism
  • It is difficult to read PERL. Even the writer of a PERL program will experience difficulty in returning to their own code and making sense of it
  • Regular Expressions are too easy to use and often used where a parser or just plain string functions would be clearer and more efficient
  • Due to a flood of PERL programming books in the early days of the web, many of which are poorly written, a lot of people learned PERL in a very unstructured way. This makes it harder to manage a team of people writing professional grade code in a consistent way
柳若烟 2024-08-15 08:46:42

Perl 的“复杂性”之一来自于有多种方法可以完成某件事。

考虑一下低级的“if”语句。 Perl 提供了几种替代的 if 和类 if 结构。 N00b Perl 程序员被迫询问哪个是“首选”,并发现答案往往是微妙的。

有时是do_something || die,有时是 do_something 或 die,有时是一个真正的 if 语句。

One source perl's "complexity" comes from there being several ways to do something.

Consider the lowly "if" statement. Perl offers several alternative if, and if-like constructs. N00b perl programmers are forced to ask which is "preferred" and find that the answer is often nuanced.

Sometimes it's do_something || die, sometimes it's do_something or die, sometimes it's a for-real if-statement.

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