devpapa

Maybe Going with Go

I'm still doing research to decide on the backend framework for Brief. In a previous post I explored a few frameworks and it came down to two considerations:

  1. Use old, boring, tried and tested tech (PHP/Laravel)
  2. Leverage a modern framework that is designed for performance and speed (Go/Gin).

I'm leaning more to Go as at the time of writing. It has many good qualities. I actually asked ChatGPT for suggestions and this is what I got:

Advantages of using Go over PHP for web app development in 2023 could include:

Performance: Go is known for its exceptional performance. It is a statically typed compiled language that can execute code significantly faster than PHP, which is an interpreted language. This can lead to faster web applications and better scalability.

Concurrency: Go has built-in support for concurrency through goroutines and channels. This makes it easier to write highly concurrent and scalable web applications. PHP, on the other hand, traditionally relies on multi-threading or process-based models, which can be less efficient for handling many concurrent requests.

Strong Typing: Go's strong type system can help catch errors at compile-time rather than runtime. This can lead to more reliable and maintainable code compared to PHP, which is dynamically typed.

Static Binaries: Go compiles into a single binary executable, which simplifies deployment and reduces the risk of dependency-related issues compared to PHP, which often requires a web server with PHP installed.

Easy to Learn and Read: Go is designed to be simple and easy to learn. Its clean syntax and minimalistic approach make it easy for developers to write and maintain code. PHP, while also relatively easy to learn, can be less consistent in terms of language design.

Strong Standard Library: Go comes with a comprehensive standard library that includes packages for handling HTTP, JSON, databases, and more. This can save development time compared to PHP, where you often need to rely on third-party libraries for similar functionality.

Built-in Testing: Go includes a testing framework in its standard library, making it easier to write and maintain unit tests and ensuring better code quality.

Growing Ecosystem: The Go ecosystem has been steadily growing, with a vibrant community and an increasing number of third-party libraries and frameworks for web development.

Scalability: Go's performance and concurrency features make it well-suited for building highly scalable web applications that can handle a large number of concurrent users.

Cross-Platform: Go is cross-platform and can be compiled for various operating systems, making it suitable for building web applications that can run on different platforms.

As for Go web frameworks, Gin comes highly recommended.

I suspect that I'll be writing more about Go here as I kick the tires and try out tiny projects.

There's another option that's lurking at the back of my mind and that's NextJS but the JavaScript ecosystem is too volatile for me, and I easily get distracted. For now I'm using all the self-control I can muster to keep it at bay.

Further Reading