Shahzeb: Hello Stefan, thank you for taking the time out for this interview. Before we start, can you just tell us a little about yourself so our readers can get to know you better?
Stefan: Thanks for having me, Shahzeb. I‘m Stefan. I live in Zurich, Switzerland where I also work for a small agency/software company as a full stack developer. I design and build simple HTML websites, more or less complex UIs and widgets with Vue.js and help build and maintain monolithic backend services written in PHP with Laravel. (Not all alone of course. I have a great colleague that completes the dev-team.)
I also write code in my free time. In the last few years I’ve released a couple of cool side projects.
laravel-stats is a CLI that gives you a summary of the size and structure of your Laravel application.
screeenly, which is a web application, allows its users to create screenshots, PDFs and more from websites or their own HTML.
Or more low-level stuff like my “git-auto-commit” and “changelog-updater” GitHub Actions.
I just love writing code that solves my immediate problems.
When not sitting at the computer, I do sports, go hiking in the beautiful Swiss alps or cook food for friends and family.
Shahzeb: Can you share your journey with Laravel? Any relatable experience from your career you find interesting and would like to share with our audience?
Stefan: The first time I heard about Laravel was in December 2013. I stumbled upon the “PHP the right way” website and saw that the CodeIgniter framework was listed under “legacy frameworks” – Laravel was not.
I’ve used CodeIgniter in the past for a personal project and just finished migrating an application from a custom framework to CodeIgniter. (I was at the company for only 4 months at that time.)
I sent an email to my developer colleague and suggested that we take a closer look at this Laravel framework and try it out in an upcoming project.
We’ve used Laravel v4 for our next project and were blown away how fast we could build out this application.
A year later we decided to start rewriting our big, main application – that generates the majority of revenue for the company – in Laravel. It was a enormous project. The app had many features and was already 5 years old at the time. We’ve kept the old CodeIgniter application running and migrated feature by feature to Laravel. It took us maybe 12 to 15 months to do this; but it was well worth it. The app got much more stable, we added an extensive test suite and we could add new features and scale the app much easier.
Even though complete rewrites are thrown upon in the programming community, I would say that it was the right decision to do. There wasn’t much development around CodeIgniter at that time and it got harder and harder to bolt new features to the existing app.
It was probably one of the best professional learning experiences I had so far.
Shahzeb: What were the major challenges you faced at the beginning of your career, and how did you tackle those?
Stefan: The biggest challenge for me was getting a programming job where I fit in. I graduated from my apprenticeship as a general IT specialist and struggled to find a company that would take someone that has basically no professional experience in programming. (Still a common problem for people coming into this industry!)
We had a couple of programming courses during my apprenticeship, but they were all pretty abstract. (I remember writing Java code to steer an immaginary Mars-rover left, right and forward). During the apprenticeship, I worked with other trainees in a small development studio and created small websites for clients in PHP, HTML and CSS. This gave me a bit of experience, but not that what companys were exactly looking for in a CV.
I then spent my 5 week summer-break to create a simple CodeIgniter app to log how much gas I filled up for my car and how much money that cost me. The app also calculated the average consumption per 100 kilometers. It was basically a glorified spreadsheet.
I then sent a couple of application out to companies, that took on PHP developers, and showed them the app I built.
I then got and accepted an offer based on that app and my willingness to learn new stuff. I’m still at that company today and am grateful that they saw the potential in me.
After that time, what helped me to become a better developer, is reading documentations, watching video tutorials (Laracasts had a very big influence on me) and building little side projects to apply my learnings.
Most of those side projects were really just for me and not an attempt to start a side-business – as many try to do that today. They existed solely for my learning purposes.
Stefan: Most of my ideas come from little nitpicks I experience in my day to day work. screeenly came to be, as we needed a service that took regular screenshots of all websites in our portfolio. I told the team that I would take a look at this and over a weekend I built screeenly.
The original app is still out there, and used by hundreds of users every month. It got a big push a couple of years ago, when Nextcloud started advertising it for one of their plugins.
In 2020 though, I’ve released a new major version as a paid product. I poured all my accumulated knowledge about APIs and Laravel projects into this new version. It was a fun learning experience yet again.
The app basically boots a Google Chrome browser, navigates to a URL and takes a screenshot. The app uses powerful open source code to make this work. Puppeteer and Spatie’s Browsershot package to name the most important ones. (I build upon the shoulders of many hundreds if not thousands here) Recently, I also open-sourced the core functionality of the new version into a package: sidecar-browsershot .
The package allows its users to run Browsershot/Google Chrome on AWS Lambda. This way, your local server doesn’t need to have Google Chrome installed.
laravel-stats was born out of this tweet by David Heinemeier Hansson in 2015. He showed a cool summary of the size of the Basecamp 3 app – which is written in Ruby. I thought: “Hey, wouldn’t it be cool if such a command existed for Laravel?”. A couple of weeks later I’ve released the first version of that package. I install this package in every project I work on and use it multiple times per week.
Another good and more recent example is my changelog-updater GitHub Action.
I got tired of manually updating the CHANGELOG of my projects whenever I released a new version. I was determined that there must be a way to automate this.
Shahzeb: You have overall full ratings on Github. What is the development workflow that helps you work smoothly and efficiently?
Stefan: Whenever I start a new project I first start with pen and paper. Even in the age of iPads, I think it still one of the best prototyping tools. If it’s an app with a UI, I sketch out a rough layout of the design. I often also write pseudo code on how I think the code should work.
Another important part when staring a new project for me, is solving the hardest problem first. For example I don’t care about database structure or authentication methods used. First I want to solve the “core” problem of the application. For example I’ve recently created a project, where a user can submit text and turn that text into a MP3 podcast. The problems I solved first were:
- How can I turn the incoming text to audio? (What third-party cloud services can I use?)
- How can I merge multiple MP3 files into a single file with PHP? (The app generates a podcast RSS feed. Each text should be its own podcast episode.)
I usually write very ugly code in a /wip route or Artisan command to solve these core problems.
Only then I start extracing the code, polishing it and build the rest of the app around it.
From there on I don’t have a perfect workflow. I flesh out the README with bullet points of what I need to document, write tests and prepare a blog post to introduce the project or feature.
What helps me concentrate is listing to music. Either calm, athmosperhic music without lyrics or music from past video games. For example this YouTube playlist with music from the Warcraft III game regularly runs in a loop.
Shahzeb: You have extensive Laravel development knowledge. What motivated you to become a Laravel web developer? Who were your mentors and inspirations in this journey?
Stefan: I would say that I stumbled into this role of becoming a Laravel developer and not actively chose it. As mentioned, I worked with plain PHP or CodeIgniter before. But after reading the Laravel documentation for the first time I knew that this was the way forward. Artisan commands, database migrations, Eloquent models, Blade. All made so much sense to me and made programming apps actually fun again.
I didn’t have a mentor at the time with which I regularly had contact. I would call Jeffrey Way a mentor though. Through Laracasts I learned so much about Laravel, PHP and programming in general. To this day I have a regular todo in my task manager to check out Laracasts and watch a video about a topic I don’t know or not much about. As Jeffrey would say: „Never stop learning!“.
Twitter also had a big influence on me. I started following Taylor Otwell and other prominent developers in the Laravel community and observed from afar how they write code.
Reading their code influence how I structure and write code today.
Shahzeb: What tools do you use during Laravel development? What is your workflow?
Stefan: For many years I’ve written code solely in Sublime Text. In 2020, I finally gave PhpStorm a go and never looked back (sometimes wonder how I could even write PHP code before it).
Besides PhpStorm, I try to use simple, fast, easy-to-use tools. iTerm for my terminal, Firefox as my go-to browser and valet for serving my projects locally. For a short period of time I’ve used Docker for my local dev environment, but ditched it as performance issues regularly broke my “flow”.
As I get older, my number one rule has become to use simple and fast tools that get the job done. (I know this sounds weird coming from a guy who switched from Sublime Text to PhpStorm, but bear with me.)
For example, for installing different versions of databases I use “DBngin” (made by the folks who made “TablePlus”). It’s a very simple app that has a “+”-button to add new database and a “Start” and “Stop” button for each database type. It gets the job done and that’s it. No fluffy features that 90% of it’s users don’t need. I also wish that, we as a community, soon find a better way to write cross-platform without relying on Electron. I have a couple of apps I regularly have to use, where I wish they would be native and not a 500MB app bundle that comes with its own browser.
Shahzeb: Which type of web hosting would you prefer? In your opinion, what are the benefits of hosting a site on a managed solution provider rather than conventional shared hosting?
Stefan: I’ve used shared hosting when I got started in this industry 14 years ago. I didn’t had the funds for managed hosting and shared hosting worked fine for my personal projects back then.
But the more I learned about programming and the more powerful my applications got, I quickly reached the limits of shared hosting.
The first problem was no access to the shell or tools like git or redis . The second problem was hitting the performance limits of hosters. I remember that I once setup a HTTP queue system that regularly brought the shared hosting server to its knees.
Managed hosting also has become much cheaper in the last few years. Choosing managed hosting over shared hosting is a no-brainer these days.
Saving a couple of dollars per month is not worth it, if you have to navigate around all these restrictions shared hostings imposes on you.
Shahzeb: How important do you think Manage hosting is for Laravel Developers, what values does this bring to their development, and how does this affect their workflow?
Stefan: Managed hosting solutions are great as it allows us developers to spend more of our time working on our apps. No need to spend time setting up MySQL and keep it running or figure out why the webserver crashed.
That‘s always a good thing.
Shahzeb: What do you think about managed hosting solutions like Cloudways that provide an optimized PHP stack and offer Laravel framework in one click with features to deploy their web apps?
Stefan: I think if there are more tools available that make Laravel or PHP programming accessible to more user, the better. So yeah, I think Cloudways does a great job at it.
Who doesn’t want to deploy their new, shiny app to production and bring it to users easier?
Shahzeb: Who should we interview next and why?
Stefan: Hard to pick a single name here. I would suggest Tony Messias . He isn’t such a loud voice in the Laravel community but regularly produces great packages, articles and videos.
I also like that he has a watchful eye on the Ruby on Rails community. He regularly ports packages from Ruby to PHP and thus brings new concepts and patterns to the PHP and Laravel community.
Shahzeb: Stefan, I’m sure many people have taken notes. I’m also sure they’d love to see a picture of your workstation if you’d like to share one!
Stefan: This is my little home office nook, where I spend some of my free time working on code projects.
Shahzeb: Thank you once again, Stefan Zweifel!
Shahzeb is a Digital Marketer with a Software Engineering background, works as a Community Manager — PHP Community at Cloudways. He is growth ambitious and aims to learn & share information about PHP & Laravel Development through practice and experimentation. He loves to travel and explore new ideas whenever he finds time. Get in touch with him at [email protected]