DEV Community

David Marko
David Marko

Posted on

3 issues LiveView development in Go resolve efficiently for small teams

#go

If you are a freelancer or working in a small development team, you are probably aware of many related benefits. Many good articles reference different research outcomes on that topic.

We can mention just a few useful things that help small teams with sustainable software development.

  • an easy-to-understand implementation supporting a long-time software maintenance
  • complex features implemented with less code
  • using one development language (Go in this case) as much as possible
  • using a limited amount of familiar technologies because whatever you use in your project, you will have to maintain for years

Small teams

And here it is, where LiveView programming concepts help us in a great way. LiveView uses websockets to create a persistent connection between the client and the server, which enables the server to push updates to the client in real-time. This allows developers to build interactive user interfaces that can update dynamically in response to user actions or changes in the application state, without the need for traditional page reloads or AJAX requests. LiveView programming style is based on this excellent Live project that is an implementation of the LiveView approach in Go.

LiveView programming style can bring a significant boost in at least 3 key areas:

  • Smaller codebase (less code) — the entire LiveView abstraction and internal implementation require less code for implementing a complex frontend to backend communication. No REST endpoints are needed, almost no JavaScript is needed, and no DTOs and converters are needed as all is being done in a backend. Browser-to-backend communication goes through the websocket and is fully managed by the LiveView library. We just rely on facts, that things just work.

  • Go language only — as much as possible — most of the tasks providing communication between frontend and backend are managed by Live internally. We use Go for updating UI stuff, the codebase is in one place and there is no need for endpoints, DTOs, ajax calls, etc. We don't need Angular/React or Vue developers in a team.
    Live

  • Easy to understand code — declarative approach — LiveView programming and implementation approach are sort of declarative. We define LiveView browser actions(events) as HTML tag attributes and LiveView provides instrumentation for making it live.
    On the backend side, we are implementing event handlers in a declarative way also, and Live is responsible for internal routing so the appropriate event handler is called when the user triggers a button on the screen. (to be honest, you don't need to know anything about websockets to use LiveView programming)

Template

Code

If you are a long-time developer, part of your job is to maintain existing applications running successfully for years. Understanding how the flow is going, and being able to fix something or add a new feature quickly is a key thing. LiveView programming approach is a real game changer here for the last couple of years and is available in Go now.

Several useful links for supporting/explaining a LiveView idea:

Are you still with me? Nice. If you are interested in details and can get a full idea how you can use Live View programming approach in Go, you are welcome to take a part in this new Udemy Course "Mastering Live(View) development in Go" .

Course image

Top comments (0)