Hi,

On Mon, Apr 21, 2025 at 05:11:19AM -0700, Vinicius Fernandes wrote:
>    Hello everyone! I hope you're all doing well.
>
>    I’ve been a developer for 5 years, currently working with Laravel for
>    backend and Vue.js for frontend.
>    Lately, I've been thinking about switching my backend language to
>    Golang, and I’d love to exchange some ideas with people who are already
>    on this path.
>
>    I have a few questions and curiosities about the language and the
>    market. In the day-to-day of companies, is Golang commonly used to
>    build APIs, like we do with Laravel? Or is it more focused on specific
>    solutions, like high-performance systems, microservices, or cloud
>    applications?
> [...]

All of the above, I'd say. Though "This is a (REST) API" and "this is a 
high-performance cloud microservice" are really orthogonal concepts :)

> [...]
>    Another thing I’d like to know is: for those of you who work
>    professionally with Golang, what role does the language play in your
>    company? Does it completely replace other stacks, or is it used in
>    specific projects alongside other technologies?
> [...]

At my day job, where possible, we use Go as our backend language. We do have a 
few services that are not built with Go because the things they do require 
packages not available in Go (such as templating transactional emails with 
React).

Other than that, we use it for things ranging from little CLI tools all the way 
to services wrangling large amounts of geodata, rendering maps, managing a 3D 
reconstruction pipeline and more or less everything in between.

The same goes for my freelancing projects: depending on the client, somewhere 
between "a lot" and "all" of the backend code is Go, again with a wide range of 
applications, roughly from "managing and analysing audio data" to "interfacing 
with legacy systems that speak an extremely niche protocol specified in 2002 
and not touched since".

> [...]
>    I’m also curious about how Golang is being accepted in the market. Do
>    you see good demand for developers skilled in this language?
> [...]

Freelancing in Western Europe seems to work out nicely. I haven't had a problem 
finding clients and permanent jobs in the last 10 years, but YMMV.

> [...]
>    And for someone starting with Golang coming from a PHP/Laravel background,
>    what would be the main challenges or differences I should be aware of?
> [...]

The main thing I've seen people with a similar background struggle with is that 
idiomatic Go code is IMHO a lot more straightforward than the usual PHP code 
base. Things really are (and should be) what they say they do, there's very 
little magic.

Some struggle with building complex cathedrals of SOLID (tm) design, where a 
rustic shed would do just fine. My suggestion would roughly be:

        At first, try the _dumbest_ thing that can possibly do what you want. 
That's often enough.

Others have difficulties getting started without things like a web framework. 
Here, my advise would be:

        Treat the standard library as your first framework, and only add 
3rd-party stuff once you've determined (not guessed!) that you need it.

Especially things like `net/http` are very very good, and provide roughly all 
that one would need. For the things that aren't in there, you can usually fall 
back to collections of middleware like Gorilla instead of throwing the 
proverbial baby out with the bathwater.

> [...]
>    If you could share some of your experiences, learning tips, and even
>    best practices for using Golang to build APIs, I’d really appreciate
>    it!
> [...]

I've already mentioned it above, but I'll reiterate:

        Dumb code that does what it says without magic is a lot more desirable 
than "clever" or "abstracted away" code that is inscrutable. Strive for 
simplicity.

This doesn't mean "write bad code, it'll be fine". It means that idiomatic Go 
code embraces and exemplifies this quote by Antoine de Saint-Exupéry:

        Perfection is achieved, not when there is nothing more to add, but when 
there is nothing left to take away.”

--
        Gregor

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/g5rckwrglotsad3eghtc6hecqo2zx3zvqnai2areghga6ul7a6%40yyuizbcsodct.

Reply via email to