在我们的雷达上:PHP 7争议和依赖注入

Over the past eight months, we’ve enjoyed bringing to you the latest and greatest updates from the world of web development. But we’ve also noticed that discussions among web professionals on our forums have not been receiving nearly enough exposure as they should.

在过去的八个月中,我们很高兴为您带来Web开发领域的最新,最伟大的更新。 但是我们也注意到,在我们的论坛上,Web专业人士之间的讨论没有得到应有的足够的曝光。

To change things up a bit, we’re going to start bringing to you items and information from those discussions that have caught our attention. Sometimes these discussions will be useful and interesting, and sometimes they may be challenging or insightful. Either way, they’re likely to bring new information to light that you haven’t come across before, and will help to provide insight and perspective on topics you’re interested in.

为了稍微改变一点,我们将开始为您提供那些引起我们注意的讨论中的项目和信息。 有时这些讨论将是有用和有趣的,有时它们可​​能是具有挑战性或有见地的。 无论哪种方式,它们都可能带来您从未遇到过的新信息,并将有助于提供您对感兴趣主题的见解和观点。

So let’s get started!

因此,让我们开始吧!

PHP 7争议 (PHP 7 Controversy)

The PHP 7 Revolution article brought on a vast amount of discussion in our forums. The article covered information on how PHP is skipping 5.7 and moving directly to PHP 7, that the new version will give us return types, and that the removal of PHP4-style constructors is certainly going to be a controversial change. Tony Marstron controversially pleaded: please don’t break our language.

PHP 7 Revolution文章在我们的论坛上进行了大量讨论。 本文介绍了有关PHP如何跳过5.7并直接迁移到PHP 7的信息 ,该新版本将为我们提供返回类型 ,并且删除PHP4样式的构造函数肯定会引起争议。 托尼·马斯特隆(Tony Marstron)提出了有争议的辩护: 请不要破坏我们的语言

An excellent response from rrcatto:

rrcatto出色回应

“If a business needs to run a piece of code, to me this also implies actively maintaining it. … If the language changes, code must also change. That is the only dev paradigm that makes sense, because progress is a good thing and we should not hinder it.”

“如果企业需要运行一段代码,对我而言,这还意味着积极维护它。 …如果语言更改,代码也必须更改。 那是唯一有意义的开发范式,因为进步是一件好事,我们不应阻碍它。”

The conversation continued at length, with great insights provided.

对话持续了很长时间,提供了深刻的见解。

依赖注入是邪恶的 (Dependency Injection is Evil)

A highly controversial topic — dependency injection is evil — also came up in the discussion on PHP 7, and was (usefully) moved to a separate thread for examination.

在PHP 7的讨论中也提出了一个极具争议性的话题- 依赖注入是邪恶的 ,并且(有用地)转移到一个单独的线程中进行检查。

It seems that some of Tony’s articles voice opinions that are controversial and oppose the norm, and this one on dependency injection really struck a nerve with some.

似乎Tony的某些文章表达了有争议的意见并反对规范,而有关依赖注入的意见确实使某些人感到不安。

Jeff Mott summarized the Pro case quite well, with:

Jeff Mott很好地总结了Pro案例 ,其中包括:

“Dependency injection makes code more flexible and more decoupled.”

“依赖注入使代码更灵活,更分离。”

Others too attempted to examine the reasons why Dependency Injection may be bad, to find out whether any of the claims had much ground to stand on. Another key point was also great to see:

其他人也试图研究依赖注入可能不好的原因,以找出是否有任何主张有足够的根据。 另一个关键点也很高兴看到:

“[R]equirements change all the time, and therefore software changes all the time. Today, an important factor that makes an architecture good or bad is how adaptable it is to change.”

“ [R]需求一直在变化,因此软件一直在变化。 如今,改变架构的好坏的一个重要因素是变更的适应性。”

While it can be tempting for dissenting opinions to color how you feel about that person, it’s vital for such conflicts to occur for it is only by shining the light of inquiry on the problem space of controversial issues that we can find out where we stand on the topic, and find the most suitable solutions.

虽然不同意的观点会给您上色您对这个人的看法很有吸引力,但发生此类冲突的关键是,只有通过对有争议的问题的问题空间进行询问,我们才能找出自己的立场。主题,并找到最合适的解决方案。

It’s also illuminating how even though disagreement occurs on the techniques that are used, rarely do the parties involved resort to personal attacks. Instead, we see an examination of the ideas being presented, which is something that we can all aspire to.

这也说明,即使在使用的技术上发生分歧,参与的各方很少诉诸人身攻击。 相反,我们看到了对提出的想法的检查,这是我们所有人都可以追求的。

你的想法? (Your thoughts?)

That’s all from us this week. What do you think about the change of focus? Could we do with more threads being examined? Are there any important threads that we could do with examining next week? We would love to hear your thoughts.

这就是我们本周的全部。 您如何看待焦点变化? 我们可以处理更多线程吗? 下周我们可以做一些重要的事情吗? 我们很想听听您的想法。

翻译自: https://www.sitepoint.com/radar-php-7-controversy-dependency-injection-troubles/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值