6 min read

The GOTH Chronicles: My Quest for an Eco-Friendly, Developer-Friendly Software Stack

The GOTH Chronicles: My Quest for an Eco-Friendly, Developer-Friendly Software Stack

Embarking on a new tech stack journey is always an exciting and challenging endeavor. With a background in Java and JavaScript, I found myself at a crossroads when deciding on the tech stack for a new project. In this blog post, I'll walk you through my decision-making process and why I ultimately picked the GOTH stack—Go(lang), TailwindCSS & Templ, and HTMX.

What I Want to Achieve

I am looking to embark on a learning experience developing a web application. So I was looking for a tech stack that is simple to start in a one-person setting. As this may be the seed for my next venture, I also did not want to be limited in growth and complexity: the stack needed to be ready to scale when necessary.

My Selection Criteria

My 2 biggest selection criteria are eco-friendliness and simplicity.

Eco-friendliness in terms of technology stack heavily relates to energy consumption I used the paper "Energy Efficiency across Programming Languages" to guide my decision 📗.

In terms of simplicity, I split up this criterion into 6 sub-criteria:

  1. Simple to Learn: As someone without a formal CS education, I need a stack that was accessible to developers with varied backgrounds and experience levels 🧠
  2. Simple to Find Errors: Prioritizing early error detection, I look for a stack that makes it simple to uncover issues during compilation rather than relying solely on testing ⚡
  3. Simple to Test: The ability to write tests (and apply test 1st TDD) helps me a lot to keep confidence & reduce cognitive load while evolving to a maintainable codebase 🚦
  4. Simple to Use: A sufficiently large community, robust tooling, and readily available libraries are essential for a smooth development experience 👨‍👩‍👧‍👦
  5. Simple to Host & Run: I search for a stack that is easy to run and host, and facilitates the development of a cleanly architected application 💻
  6. Ready to Scale: The chosen stack has to be workable for solo projects but also ready to scale as the project grows ⏫

Phases in My Selection Journey

In the past years, I've worked in PHP (early days, hobby projects), Python (learning & algorithms, a little bit of Django), and mainly Java/JavaScript (large commercial projects & products).

  1. Personal considerations: As I wanted to learn, I'd rather avoid Java & JavaScript. This is a personal bias, though I am not sure it influences my final choice (Java nor JavaScript being very simple in terms of learning and developer experience)
  2. Python Consideration: Initially, I leaned towards Python. I quickly reconsidered this, after becoming more aware of its high energy consumption.
  3. Go for the Back-End: After further consideration, I selected Golang for the back-end. It is the simplest language that performs very well in terms of eco-friendliness. One disadvantage is that it lacks some local communities in Belgium and Europe, although that seems to be improving.
  4. Front-End Exploration: Initially, I opted for Svelte for the front-end (as it also does server-side rendering out of the box) but found I was simply duplicating work I already did in the back-end (creating stores, views, ...).
  5. Discovery of HTMX: HTMX caught my attention as an alternative for full-breadth SPA frameworks like Svelte. With a limited number of HTML extensions, it allows for real-time update capabilities and interactivity. As such, it offers the user experience without the need to build an entirely new front-end app.
  6. Server-Side HTML Rendering: HTMX heavily relies on server-side HTML rendering. I chose Templ over the standard library for this. Templ compiles the templates to Go classes and gives you type safety (and hence earlier error detection).
  7. Adding TailwindCSS: Incorporating TailwindCSS for styling the HTML gives plenty of options to create the UI/UX I want (for now). The clear isolation of HTML & CSS in the architecture allows working in full-stack mode most of the time, with experts working on specific improvements when needed.

The GOTH Stack Unveiled

So my current selection consists of

  • Go(lang): Providing a robust back-end foundation with fast compilation and strong typing.
  • TailwindCSS & Templ: Offering a powerful combination of styling and server-side rendering with type safety.
  • HTMX: Adding real-time updates and interactivity to the front end.
  • Make: For build scripts & automation

Lessons Learned and Early Conclusions

The learning experience with the GOTH stack has been smooth, thanks to the ample learning materials available. Notable mentions include "Learn Go with Tests" and the book "Hypermedia Systems."

The GOTH stack provides an exceptional feedback cycle, with almost instant compile-time feedback, fast test execution, and auto-reloading of the locally running application on file changes. This helps a lot with my attention span of seconds 😄

This combination of super-quick feedback and a simplified architecture (no different programming language between back-end & front-end stacks) allows me to easily extend the scope of the app without creating a massive cognitive load.

Going forward and extending the application, I am reassured by the availability of several concepts that foster clean code (using interfaces already allows for a clean separation of the core and adapters in my hexagonal setup). For the more complex use cases, there is quite a bit of documentation on Domain-Driven Design (DDD) and event-driven architecture in Golang, so my continued learning is assured 🤘

Looking Forward

I am genuinely pleased with my choice of the GOTH stack. The learning journey has been rewarding, and I am excited to witness the growth of my application. Stay tuned for further updates!

As I continue on this path, I invite you to share your thoughts. Are there additional selection criteria I may have missed, or areas you believe deserve more attention?

Thanks for reading, let's learn and grow together!

References

Energy efficiency across programming languages: how do energy, time, and memory relate? | Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering
The Go Programming Language
Go is an open source programming language that makes it simple to build secure, scalable systems.
Learn Go with Tests - Learn Go with tests
</> htmx - high power tools for html
htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext htmx is small (~14k min.gz’d), dependency-free, extendable, IE11 compatible & has reduced code base sizes by 67% when compared with react
Hypermedia Systems
The revolutionary ideas that empowered the Web. A simpler approach to building applications on the Web and beyond with htmx and Hyperview. Enhancing web applications without using SPA frameworks.
GitHub - a-h/templ: A language for writing HTML user interfaces in Go.
A language for writing HTML user interfaces in Go. - GitHub - a-h/templ: A language for writing HTML user interfaces in Go.
Tailwind CSS - Rapidly build modern websites without ever leaving your HTML.
Tailwind CSS is a utility-first CSS framework for rapidly building modern websites without ever leaving your HTML.