I started writing code in PHP back in 2010. Back then, PHP version 5.x was the latest version available and it was ideal for small - medium web projects. Nowadays PHP has evolved a lot and in its current versions, 7/8.X, it is a full OOP language, with strong frameworks (like Laravel) and a huge community of supporters worldwide. Also performance was a pain point for years, and it has been dramatically improved.
I enjoyed coding in PHP for many years, and I still do, but in the last 1.5 year I decided to try GoLang. Golang is a simple, smart, compiled and superfast programming language developed by Google, designed to cover the needs of building modern, cloud applications and support their scaling effordlessly.
In the following list, you could find some of the reasons why I fell in love with Go:
- Built-in dependency manager: You do not need to install extra programs like ‘php composer’
- Built-in web server: You do not need to install and configure web servers
- Built-in template engines: You do not need to install twig or blade. Go has her own template engine.
- Built-in testing package: You do not need to install 3rd party libraries for testing.
- Memory Caching: You do not need to store temporary data in a database, in a file or in redis. With Go you can keep data in memory, even when the communication around one request is completed.
- Easier package installation: Sometimes in PHP we need to install a package via composer but also need to install and configure the package extension. For example mongoDB requires both steps. In GoLang life is simpler, you only have to install the package via the dependency manager.
- Speed & optimised utilisation of hardware resources: GoLang is an extremely fast and compiled programming language compared to PHP.
- Dockerfile: No more complexity about configuration in docker file.
- Coding standards: With Golang you have to follow the language standards while you craft your code, otherwise you will get compile errors. This is so important for code readability.
- Ideal for microservices: GoLang is designed for complex backend systems and is suitable for cloud infrastructure.
What’s your take on this dilemma? PHP or GoLang? Reach out, connect and let’s discuss.