采访:汤姆·奥兰(Tom Oram)和罗伯·艾伦(Rob Allen)

In our second interview, we talk to Tom Oram, who works for a small development firm in Wales and Rob Allen, from Nineteen Feet.

在第二次采访中,我们采访了在威尔士一家小型开发公司工作的汤姆·奥拉姆(Tom Oram)和《 十九英尺》的罗布·艾伦(Rob Allen)。

These two developers have a solid wealth of PHP experience and knowledge and have helped me refine my ideas and approaches on many occasions. With that, we’ll start with Tom.

这两个开发人员在PHP方面拥有丰富的经验和知识,并在很多场合帮助我完善了自己的想法和方法。 这样,我们将从汤姆开始。

汤姆·奥兰 (Tom Oram)

是什么导致您使用PHP? (What led you to PHP?)

A job. I was offered a job using a language I knew nothing about called PHP. It was PHP version 3 at the time, so much less advanced than it is now. Since then, I’ve been using PHP almost every day of my working life.

一份工作。 使用一种我不了解PHP的语言为我提供了一份工作。 当时是PHP版本3,比现在的要先进得多。 从那时起,我几乎每天都在使用PHP。

关于PHP的什么事情困扰着您? (What have been the things about PHP that bit you?)

In previous versions I’ve had various things which have caused confusion and frustration, most notably references and object copying in PHP 4.

在以前的版本中,我遇到过很多导致混乱和沮丧的事情,最值得注意的是PHP 4中的引用和对象复制。

However in PHP 5 I don’t really have anything that really catches me out. There are, however, things which I think could be improved or added to make the language easier and more consistent to use.

但是在PHP 5中,我实际上并没有什么真正吸引我的。 但是,我认为有些事情可以改进或添加,以使该语言更容易使用。

亮点或兑换功能是什么 (What have been the highlights or redeeming features)

I guess the best thing about PHP is the speed in which you can get going. You can have an idea and very quickly try it out while at the same time it’s very well suited to larger and more complex projects as well.

我想关于PHP的最好的事情就是速度。 您可以有一个想法,很快就可以尝试一下,与此同时,它也非常适合大型和更复杂的项目。

什么是引人注目PHP功能? (What are the compelling PHP features for you?)

For me I love interfaces and the fact that static typing is becoming more and more possible while still allowing dynamic typing.

对我来说,我喜欢界面,而且静态输入正变得越来越可能,同时仍然允许动态输入。

您想在语言中看到什么? (What do you want to see added to the language?)

  • Type hinting for scalar parameter types

    标量参数类型的类型提示
  • Type hinting of return values

    返回值的类型提示
  • Nested classes

    嵌套类

为什么要在Ruby,Python,Go等上使用PHP? (Why PHP over Ruby, Python, Go, etc?)

Honestly I think they all have their own pros and cons. In many ways I think the other languages are designed better and are more consistent.

老实说,我认为他们都有自己的优点和缺点。 在许多方面,我认为其他语言的设计更好,更一致。

However if you’re used to programming in a statically typed language (especially Java) then PHP might seem easier to relate to than Python or Ruby.

但是,如果您习惯于使用静态类型的语言(尤其是Java)进行编程,则PHP似乎比Python或Ruby更易于关联。

您看到自己将来会转向另一种语言吗? (Do you see yourself moving to another language in the future?)

I use other languages all the time, and if a job is better suited to another language I will use that. However for web-based projects I always reach for PHP first, I currently have no intention of changing that.

我一直在使用其他语言,如果工作更适合另一种语言,我会使用它。 但是对于基于Web的项目,我总是首先接触PHP,目前我无意对此进行更改。

您是否有自定义框架/设置? (Do you have a custom framework/setup?)

Over the years, with different projects, I’ve used different architectures and frameworks, ranging from complete custom frameworks through to modules within an existing systems (e.g., Joomla, WordPress, etc.).

多年来,在不同的项目中,我使用了不同的体系结构和框架,从完整的自定义框架到现有系统中的模块(例如JoomlaWordPress等)。

These days I tend to default to Zend Framework 2, which I’m very comfortable with, or sometimes Silex for more lightweight projects.

这些天,我倾向于默认使用我非常满意的Zend Framework 2 ,或者有时使用Silex进行更轻量级的项目。

However when using these I don’t like to work “within” the framework but rather use the framework for a specific purpose (e.g., develop the UI with it’s MVC and form components or create the database layer with it’s DB components). I’m also a big fan of the Doctrine2 ORM library.

但是,当使用这些工具时,我不喜欢在框架内“工作”,而是将框架用于特定目的(例如,使用MVC开发UI并形成组件或使用DB组件创建数据库层)。 我也是Doctrine2 ORM库的忠实拥护者

您如何实施部署? (How have you implemented deployment?)

Again it varies from project to project. My favourite approach at the moment is automatic deployment using Github and Travis CI.

同样,它因项目而异。 目前,我最喜欢的方法是使用GithubTravis CI进行自动部署。

Basically when a Travis build succeeds on the master branch you can set it to signal the server (via Webhooks which can then begin an update.

基本上,当Travis构建在master分支上成功时,可以将其设置为向服务器发出信号(通过Webhooks ,然后可以开始更新)。

Sadly it’s not something I get to use everywhere and I’m still trying to work out the best ways, but I really do like automatic deployment.

遗憾的是,这并不是我可以在任何地方使用的东西,而我仍在尝试找出最佳方法,但是我确实很喜欢自动部署。

您的标准工具链中有什么? (What is in your standard toolchain?)

您可以分享哪些测试技巧? (What testing tips can you share?)

Firstly, when working on a project always test. Never write any code unless there is a failing test somewhere! If you’re not used to this, then it can take some time, but after a while you will find it harder to write code without tests.

首先,在进行项目工作时始终要进行测试除非某个地方测试失败,否则不要编写任何代码! 如果您不习惯此操作,则可能需要一些时间,但是过一会儿,您会发现没有测试就更难编写代码。

Secondly give phpspec a try. PHPUnit is very forgiving and when using it you can come up with all sorts of “clever” tests to test the code you’re producing.

其次,尝试phpspec。 PHPUnit非常宽容,使用它时,您可以提出各种“聪明”的测试来测试所生成的代码。

With phpspec you can’t do this. Whenever you have some situation, where you’re struggling to write the test you need or you find you are doing some complex in your spec file, then it’s usually a sign that your code has a bad design somewhere.

使用phpspec不能做到这一点。 每当遇到某种情况时,如果您正在努力编写所需的测试,或者发现自己在spec文件中做一些复杂的事情,那么通常这表明您的代码在某处设计不好。

Again it may be frustrating at first, but with practice your design should get better.

同样,乍一看可能会令人沮丧,但是通过实践,您的设计应该会变得更好。

有没有您无法使用的工具? (Are there tools you use which you can’t live without?)

There are many tools which I wouldn’t like to be without, including the ones I mentioned above. But the one I really couldn’t live without (and I’m ashamed to admit it) is probably PHP’s var_dump() function.

我不想缺少许多工具,包括我上面提到的工具。 但是我真正不能没有的一个(我很ham愧地承认)可能是PHP的var_dump()函数。

I use it far less these days but even so, every now and then it’s just easier to work out a strange problem by dumping out the contents of some data structure than re-reading the code multiple times or starting a debugger.

我现在很少使用它,但是即使如此,通过转储某些数据结构的内容来解决一个奇怪的问题要比多次重读代码或启动调试器要容易得多。

您的团队如何工作? (How does your team work?)

I work for a small company and sadly, most of the time, each developer is working on separate, individual, projects. So often, there’s not much team work involved.

我在一家小公司工作,可悲的是,大多数时候,每个开发人员都在从事单独的个人项目。 因此,通常不需要太多的团队合作。

We are currently trying to make more of an effort to work as a team and thankfully we’re getting opportunities to do this. When doing this, there are many (heated) discussions. We’re including pair programming often and also making sure that committed code is always reviewed by other members of the team.

目前,我们正在努力加大团队合作的力度,值得庆幸的是,我们有机会做到这一点。 这样做时,有很多(激烈的)讨论。 我们经常包括结对编程,并确保团队中的其他成员始终审查已提交的代码。

We use Github and treat it much like working on a OSS project. There is a central repository for the project and each member forks the repository to their own account, they then issue Pull Requests to the main repository.

我们使用Github并像对待OSS项目一样对待它。 该项目有一个中央存储库,每个成员将存储库分叉到自己的帐户,然后他们向主存储库发出“ 拉取请求 ”。

The rule is that you’re not allowed to merge your own pull request. This way code is always reviewed by a second developer.

规则是不允许您合并自己的请求请求。 这种方式的代码总是由另一位开发人员审查。



Thanks to Tom for his feedback and opinions on all the questions. I hope you’ve gained some insight from what he’s had to say. Now, let’s turn it over to Rob Allen, core contributor to Zend Framework 2.

感谢汤姆对所有问题的反馈和意见。 希望您从他的发言中获得了一些见识。 现在,让我们将其交给Zend Framework 2的核心贡献者Rob Allen。

罗伯·艾伦 (Rob Allen)

是什么导致您使用PHP? (What led you to PHP?)

Back in 1999, I helped to form a guild for, the MMORPG, EverQuest. We decided we needed a website and I volunteered to write it as I already had a personal, static, HTML site.

早在1999年,我就为MMORPG EverQuest组建了行会。 我们决定需要一个网站,而我已经自愿编写了该网站,因为我已经拥有一个个人的静态HTML网站。

As we needed dynamic elements to the new site, I asked around and someone recommended PHP to me. It was the last gasp of PHP 3, back in those days, and that site is still running on PHP 5.4 ,with very minor changes.

当我们需要新站点的动态元素时,我四处询问,有人向我推荐了PHP。 那是当时PHP 3的最后喘息之机,并且该站点仍在PHP 5.4上运行,仅做了很小的更改。

关于PHP的什么事情困扰着您? (What have been the things about PHP that bit you?)

Passing objects in PHP 4 would pass by value unless you explicitly de-referenced. Forgetting that used to cause me no end of trouble!

除非您明确取消引用,否则在PHP 4中传递对象将按值传递 。 忘记曾经给我带来的麻烦!

Other than that, I regularly forget that the sort methods sort in-place and so you don’t assign the result of sort() to a new variable.

除此之外,我经常会忘记sort方法就地进行排序,因此您不会将sort()的结果分配给新变量。

亮点或兑换功能是什么 (What have been the highlights or redeeming features)

I love how PHP thinks HTTP and web all the time. It’s very much the language for web development and does it very well.

我喜欢PHP一直认为HTTP和Web的方式。 它非常适合Web开发,并且做得很好。

什么是引人注目PHP功能? (What are the compelling PHP features for you?)

There are many. My favorite feature is that it’s so widely used, that getting help on anything is very easy.

有许多。 我最喜欢的功能是它的用途如此广泛,以至于获得任何帮助都很容易。

您想在语言中看到什么? (What do you want to see added to the language?)

I don’t really need anything added, so I’m happy to go with the flow. I would quite like named parameters, though as I don’t have them, I don’t design methods with too many parameters!

我真的不需要添加任何东西,因此很高兴顺其自然。 我很想命名参数 ,尽管由于我没有命名参数 ,所以我不会设计带有太多参数的方法!

为什么要在Ruby,Python,Go等上使用PHP? (Why PHP over Ruby, Python, Go, etc?)

Nowadays, because it’s the one I know and swapping to another scripting language wouldn’t give me enough of a gain to justify swapping. I think that the main motivator for me to change language for web projects would be for a new paradigm, such as built-in parallelisation or something.

如今,因为这是我所知道的,所以切换到另一种脚本语言并不能给我足够的好处来证明切换的合理性。 我认为对我来说,更改Web项目语言的主要动机是建立新的范例,例如内置并行化或类似的东西。

您看到自己将来会转向另一种语言吗? (Do you see yourself moving to another language in the future?)

I expect to add new languages to my arsenal. I started in C and then C++ GUI application development on Windows. Clearly C/C++ isn’t ideal for web programming, so I use PHP there. PHP is not the best for iOS or OS X development, so I use Objective-C.

我希望在我的武器库中添加新的语言。 我从C开始,然后在Windows上进行C ++ GUI应用程序开发。 显然,C / C ++对于Web编程而言并不是理想的选择,因此我在那里使用PHP。 PHP并不是iOS或OS X开发的最佳选择,因此我使用Objective-C。

I expect that I’ll learn other languages as required for the problem space that I’m trying to work in. As I’m self-employed, I’ll also learn a new language if my client asks me to, for a given project!

我希望我会根据自己要解决的问题空间学习其他语言。由于我是自雇人士,如果客户要求我给定的时间,我还将学习一种新语言。项目!

您是否有自定义框架/设置? (Do you have a custom framework/setup?)

At my last company, we built our own starting-point layer on top of Zend Framework. I haven’t written enough new projects in my new job to have a need for a common starting point yet. For utility classes, I’ve started separating them out to their own repositories and putting them on Packagist so that they are easy to pull into new projects.

在上一家公司,我们在Zend Framework之上构建了自己的起点层。 我在新工作中没有编写足够的新项目,因此还需要一个共同的起点。 对于实用程序类,我已经开始将它们分离到各自的存储库中,并将其放在Packagist上,以便可以轻松地将它们引入新项目中。

您如何实施部署? (How have you implemented deployment?)

Depends on the client’s set up. So far, all systems have used git and custom scripts.

取决于客户的设置。 到目前为止,所有系统都已使用git和自定义脚本。

您的标准工具链中有什么? (What is in your standard toolchain?)

I develop locally on my Mac, using Apache with automatic virtual hosts. I code in Sublime Text 3 with a fair few packages installed now.

我使用自动虚拟主机的Apache在Mac上本地开发。 我在Sublime Text 3中编码,现在安装了一些软件包。

All my projects are now in git which I usually use from the command line, though I’ve been playing with SourceTree too recently.

我的所有项目现在都在git中,我通常从命令行使用它,尽管我最近一直在使用SourceTree。

My PHP is 5.4.24 and I have the usual development tools such as Xdebug, PHPUnit, phpcs, phpmd, phpcpd all installed. I’m also using composer for package management, on new projects.

我PHP是5.4.24,我安装了所有常用的开发工具,例如XdebugPHPUnitphpcsphpmdphpcpd 。 我还在新项目上使用composer进行程序包管理。

I have one client where we use Vagrant which seems to work reasonably well. For testing against IIS and also checking IE, I use VMWare Fusion.

我有一个客户,我们在这里使用Vagrant似乎工作得很好。 为了针对IIS进行测试并检查IE,我使用了VMWare Fusion。

您可以分享哪些测试技巧? (What testing tips can you share?)

Buy Chris Hartjes’ books.

克里斯·哈特斯的书

有没有您无法使用的工具? (Are there tools you use which you can’t live without?)

Not really. I don’t tend to get so attached to tools that I can’t swap to something else if there’s a compelling reason.

并不是的。 我不太喜欢工具,如果有令人信服的理由,我就不能交换其他东西。

您的团队如何工作? (How does your team work?)

I’m self-employed so don’t have a team as such. In some projects I slot in as a developer among the client’s team and in others I act as a consultant to the side.

我是自雇人士,所以没有这样的团队。 在某些项目中,我作为开发人员加入客户团队,而在另一些项目中,我担任顾问。

结语 (Wrapping Up)

Ok, there you have it from Tom and Rob. Whilst succinct, I hope that you can pick up a lot of useful information from their feedback across the interview questions posed.

好的,汤姆和罗布在那里。 简洁地说,我希望您能从面试过程中提出的反馈中获得很多有用的信息。

Whether it’s the strong emphasis on testing (and I’m a big advocate of Chris Hartjes’ books too), what’s good to have in a standard environment, or PHP’s key features, I hope the information today helps you and your team improve.

无论是强调测试(我也是Chris Hartjes的书的大力倡导者),在标准环境中具有什么好处还是PHP的关键功能,我希望今天的信息能帮助您和您的团队改进。

翻译自: https://www.sitepoint.com/interview-tom-oren-rob-allen/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值