Benjamin is a Doctrine Project lead and core contributor to the project. He is the creator of Tideways.io, a robust Performance Monitoring and Profiler for PHP and HHVM.
Benjamin is an open source enthusiast and loves to contribute to several projects. In addition to development, he also actively participates in PHP conferences and training sessions. Let’s start the interview!
Cloudways: Hi, Benjamin, How are you? It’s an honor to have you on board for this interview. Can you please briefly describe yourself :)?
Benjamin: Hi. I am Benjamin from Bonn, Germany. I am a huge coffee addict and am very interested in the process of coffee preparation and consumption, a passion I share with my wife! I also play board games with my friends.
This is my 17th year as a PHP developer. I have recently started to dig around other languages such as Go and C. Also, this year, I started my own company Tideways that offers a PHP application performance management tool.
Cloudways: You have extensive knowledge of PHP development. What motivated you to become a PHP web developer? Who are your mentors in this journey?
Benjamin: I began programming PHP to help a friend maintain a large news website for a multiplayer game (Starsiege Tribes) and, after that developed a browser game with another friend that never got finished. From 1999 to 2005, I used PHP only for hobby projects, so the motivation to become a programmer was mainly fun until I started working for money during my university studies.
Until 2007, my PHP knowledge was very basic. Then, I started volunteering for the Zend Framework, mostly fixing small bugs in many different parts of the codebase. Reading code created by other programmers helped me grow a lot as a programmer.
I would consider Matthew Weierophinney of Zend Framework fame as one of my first mentors, because he teached me a lot about PHP and open source. Later Roman Borschel, then maintainer of Doctrine 2 helped me fine tune my programming skills. I have also learned a lot from various members of the Dortmund PHP User group, notably Kore Nordmann, Manuel Pichler and Tobias Schlitt, whose company Qafoo I joined in 2013.
Cloudways: Doctrine has now become the latest tool for interacting with MySQL database. Since you are leading this project, can you tell us how Doctrine is different from other ORM and how does it work?
Benjamin: Doctrine 2 is one of the most popular ORMs in PHP, something, we could have never imagined when starting work on version 2 in 2009/2010. The biggest difference between many other PHP ORMs and Doctrine is its use of the Data Mapper pattern, which forces a strict separation between data objects and the code operating with the database. We haven’t invented this pattern ourselves. We use the fundamental ideas based on the Java Persistence API standard and adapted it to fit PHP as much as possible. Because of this, Doctrine is definitely not a lightweight library, but it is extremely powerful without requiring too much black magic. I think it hits a perfect balance between ease of use and robustness.
Cloudways: Benjamin, PHP 7.0 has been released and 7.1 is also heading towards release. What mainstream changes have you observed in the new versions of PHP? What changes should be introduced in PHP to make it faster and better optimized?
Benjamin: In the recent years, the most important change in PHP was the move towards more type safety through objects. With PHP 7, this move now includes scalar types, but personally I haven’t used them in a production project yet, so I cannot offer any judgement on their usability yet.
I think with regard to speed and optimization, PHP code (especially libraries) is actually moving in the direction of more and better abstractions, which does not necessarily making it faster. Doctrine is a good example here, because its PHP code designed for performance rather than speed.
PHP has become fast, so as PHP developers, we don’t have to optimize the code too much.
Cloudways: As an ORM database developer, what are your thoughts on SQL and NOSQL databases? Which one is better suited for rapid application development?
Benjamin: I am not a fan of rapid application development. I think you should try to use the right tools from the beginning, because then the solution is usually achieved in less code and less work. That means the decision for SQL or NoSQL technology should be based on business requirements and if you make the right decision, which is not always the case, then you will have save time and development costs.
For NoSQL databases, an ORM like Doctrine might be harmful though, since the database is much simpler with less features. You can often develop very thin but powerful layer on the top that makes use of the features of the database more directly.
Cloudways: What framework would you recommend to a beginner for kickstarting projects?
Benjamin: I think even if the learning curve of Symfony is steeper than most frameworks, it is still worth it to invest in learning Symfony. In my opinion, it is by far the most consistent, powerful and thought out PHP framework. However starting with Laravel is not necessarily a bad idea either, because the community is very big. However, to be honest, you pick up a lot of programming bad practices when learning Laravel (such as the use of Static Classes/Methods), whereas Symfony drives you towards the use of best practices in OOP.
Cloudways: Who would you recommend to follow within the PHP community? Who has influenced you in the PHP world?
Benjamin: I learned that you have to follow a fair share of people that challenge your assumptions, so that you can learn new and different ideas. If you stay within your community of like minded developers, it is very hard to grow beyond a certain level. You should follow developers in the PHP community that look beyond their assumptions and share them, such as Mathias Verraes, Marco Pivetta or Chris “Grumpy” Hartjes. Also, people from other communities such as David Heinemeier Hansson , Martin Fowler, Kent Beck or Uncle Bob Martin often write pieces that challenge assumptions.
It wouldn’t make sense to share who influenced me over the years, because often this is very dependant on your own current level and their current interests. Web development is a continuously changing field and there are always new people with great ideas that are worth following. In PHP and Symfony community, there are several people who share their knowledge of the language, framework and the ideas about web development.
Cloudways: Benjamin, you are a contributor to Symfony and you have a strong opinion about open source contributions. In your view, what benefits does a developer get by making contributions to open source projects?
Benjamin: Open source is a great place to learn working on high quality codebases written by other people. This includes learning accepting, contributing and maintaining code by others. For me, working on Zend Framework 1 helped me understand intentions and styles of other programmers and how programs and code work in general. Reading and understanding new, potentially complex code is a great skill I have learned from open source projects.
Cloudways: You have learned a lot of things in your PHP experience. Please share one piece of valuable advice with the readers.
Benjamin: At present, the most important advice I would give is to be pragmatic first and then work on making code maintainable and reusable. I explicitly don’t mean writing no tests or spaghetti code. However, try not to overengineer or over think the problems. Implement the most simple solution. The clarity of an existing, working solution often helps finding and refactoring to very elegant maintainable solutions that you can’t come up with by just thinking about the problem.
Cloudways: Benjamin, we always ask developers to share their workstation image as an inspiration for the reader.
Benjamin: Attached is the photo of my current desk, we just moved into the new office so it’s a bit spartanic 🙂
Cloudways: What do you think about managed hosting solutions like Cloudways, that provide an optimized PHP stack with features to help developers kickstart their web projects? We would love it if you test cloudways and give us your valuable feedback.
Benjamin: Managed Hosting or Platform as a Service is very valuable to get projects started, when you don’t have enough time or experience with the operations part of web development.
The requirements for a good platform has changed drastically in the last 15 years with the arrival of AWS (IaaS), Heroku (PaaS) or Docker (FaaS). I think the separation of companies providing hosting resources and management and software platforms on top is a very welcome occurrence because it introduces much needed specialization. AWS and Digital Ocean provide very powerful hosting platforms but will never perfectly support PHP stack in every detail. Thus, managed hosting companies like Cloudways that build on top of the modern clouds functionality are very useful.