Chris Wiegman Chris Wiegman

3 Lessons for a PHP Developer Working in GoLang

After working almost exclusively in WordPress and PHP since 2012 I’ve recently made the switch to GoLang for my day job. Frankly, it’s been an eye opening experience. If there is one thing I don’t recommend for a developer at any level it is to get to so deep into one language or library that you lose touch of the bigger picture. That said, while I’m still learning a lot after four months on the job there are three important lessons I’ve learned that I think will benefit anyone making a similar switch.

Programming Doesn’t Require Expensive IDEs

Over the last few years I had become quite a fanboy of PhpStorm. So much so that when I started with GoLang I ponied up and bought Jetbrains’ GoLand product as well. Turns out that was a mistake. PHP may offer robust libraries and other tools but it doesn’t compare with GoLang with its standard tools for unit testing, formatting code and more. Today I’ve switched to VS Code for pretty much all of my work. It’s fast, customizable and works great with a variety of languages, especially GoLang.

Don’t Forget the Fundamentals

Coming from PHP concepts such as typing and others weren’t something I worried about every day. Now that I’m working in GoLang, which is statically typed, I find myself much more conscious of what I’m working with. From errors to simple strings I have to watch variables a lot more now and can’t just re-assign most when it seems convenient. Frankly this is a lesson I’ll take back to PHP with me. With weak typing in PHP it is all too easy to get complacent and that isn’t a good practice for any developer.

There is Code in the WordPress Ecosystem Beyond PHP and JavaScript

Finally, as a WordPress developer, I think it is safe to say that the most important thing I’ve learned working in GoLang is that there is room for developers to work in the WordPress ecosystem without PHP and JavaScript. If the magic of WordPress is its ability to integrate with anything than, when building something to integrate with WordPress it is perfectly acceptable to use the best tool for the job, not just PHP and Javascript.

In the end, these last four months have taught me how much fun coding can be again. These lessons I’ve learned so far might not seem like much, but they do show just how complacent a developer can be working in the same thing for too long. As I break out of my own bubble I’m not only having a great time learning them but I also can’t wait for all the lessons I have yet to learn.