-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Change due to Golang APIs v1.22 - use of dependencies #3
Comments
Hey @surfmuggle thanks for the great question. When it comes to Go, there is a big thing going around saying that we shouldn't use dependencies. However that is not so binary as it sounds, most of biggest software out there, take Linux for example (the operating system) it's built using 3rd party software as well. Now, answering your question depends on what your building, do want to learn or speed? Using code that someone wrote is going to make you go faster, but in the future do you foresee too much configuration of that code? If so maybe that package doesn't give you that flexibility and you have to build your own solution. In content online and in the industry packages are used a lot for speed purposes, in content to make the video short and in business to get the a faster time to market. So, TLDR; I wouldn't worry to much about packages, just be pragmatic on what you need and what you can possibly build yourself. I wouldn't want to build HTMX from scratch or Templ but I need a server side UI built, so I consume those packages. On the other hand I might not need gorilla/mux and I can easily build my HTTP routing layer with std library. Hope that helps. |
I wanted to understand at least a little why templ was created and found
Adrian is the initial creator of templ. And below you can find some of my notes from the video above Why Server Side Rendering
Why templ - and what are the stdlib templates shortcomings
templ - history, goals and advantages
I hope that the documentation or FAQ will be modified to include the benefits of |
In your great Video How to create your Golang APIs from now on with v1.22 you suggested to go without dependencies until there is a clear reason to add one.
You said that two questions can help decide whether to add a package dependency
This is a tricky question for someone new to Go and without knowledge about the packages / dependencies used in this project fullstack-go-htmx.
I would prefer to avoid dependencies but i would not be willing to reinvent the wheel that 3rd party dependencies already solve. But without a better understanding what
Templ
andgorialla/mux
offer compared to the standard library and what features i might need i am unable to decide.I asked ChatGPT about the differences but as known this could be outdated or plain wrong.
Edge Conditions:
templ
,gorilla/mux
nornet/http
,template/html
What would you recommend use the 3rd party packages or avoid them?
Dependencies
The file go.mod has these direct dependencies
And these indirect dependencies - a direct dependency depends on other packages
The text was updated successfully, but these errors were encountered: