DEV Community

Bregy Malpartida
Bregy Malpartida

Posted on • Edited on

I'm Go Backend developer and love it, Ask Me Anything!

Top comments (37)

Collapse
 
erikthered profile image
Erik Nelson

How did you get into Go development professionally?

I've been in Java land for ~10 years doing mostly backend work, but I've been seeing increasingly more backend jobs using Go so I'm wondering if this is a direction I should start heading in.

Collapse
 
rhymes profile image
rhymes

I don't have enough experience but I think, apart from its concurrency primitives, some of the reasons to consider Go are: it is quite simple to grasp, fast, has a low memory footprint and any app can be deployed as a single file. Its standard library is quite extensive also.

Go through gobyexample.com/ and see if it peaks your interest.

Collapse
 
jimfilippou profile image
Dimitrios Filippou

What are goroutines bro?

Collapse
 
bregymr profile image
Bregy Malpartida

Putting "go" word before any function and automatically create a new concurrent task, in my opinion, is awesome. If you want coordinate many tasks you only need think in the flow of your program and implement your own algorithms, but obviously exist a stack library for this work: the fantastic sync library (golang.org/pkg/sync), look at it!

Collapse
 
shostarsson profile image
Rémi Lavedrine

Goroutines are the Go implementation of concurrency.
And you must not compare Concurrency with Parallelism.

Here is a very good video about it from Rob Pike.

And the associated slides (have a look at it, it is very educational) :
Concurrency is not Parallelism

So it is basically using resources efficiently.
Then you can improve the process using parallelism.

So goroutines are basically the Go implementation of concurrency.

I hope that can help.

Collapse
 
shostarsson profile image
Rémi Lavedrine

To add something to my previous comment, I can point anyone that is interested in Go concurrency models and so goroutines to the best article I have read about it from Trevor Forrey on Medium.
medium.com/@trevor4e/learning-gos-...

It is the perfect one if you are not very used to it and want to learn it the easy way.
And then have a look at his other article. They are absolutely great materials about Go.

Collapse
 
manzanit0 profile image
Javier Garcia

I found this helpful x)

gobyexample.com/goroutines

Collapse
 
georginagrey profile image
Georgina Grey

Do you think Golang is a good first programming language? For people that have zero experience in development, but would like to understand core concepts of programming they can later apply to other similar languages.

Collapse
 
bregymr profile image
Bregy Malpartida

Oh, wow, hard question, really I don't know I think any language is a good language for understanding core concepts of programming because all concepts are similar (like flow control or computer logic). But I accept exist better languages for the introduction to programming mind, (e.g. python) I suppose it is good because of its simplicity and versatility. Go have very intuitive reserved words and that makes simplicity to Go, but also it has deep concepts that you need to practice to master that. Finally, I'm not sure but I think that exist better languages for start to learn programming core concepts, for me that language is python.

Collapse
 
bregymr profile image
Bregy Malpartida

Following godoc of this function, Math.Round rounded any float to the nearest integer, rounding half away from zero (golang.org/pkg/math/#Round) and this function only exist from Go 1.10. If you want another more complex unit to round you can implement it.

func Round(x, unit float64) float64 {
    return math.Round(x/unit) * unit
}

fmt.Println(Round(12.3456, 0.01)) // 12.35 
fmt.Println(Round(0.363636, 0.01)) // 0.35
fmt.Println(Round(1.922636, 0.01)) // 1.92

You can round float and obteing a string without function Round, if you want you can convert your string to float later.

s := fmt.Sprintf("%.2f", 12.3456) // s == "12.35"

Here there good references
yourbasic.org/golang/round-float-2...
yourbasic.org/golang/round-float-t...

 
ravernkoh profile image
Ravern Koh

People say that the Erlang (and Elixir) ecosystems are much more suited (and battle-tested) for building large-scale, fault-tolerant systems.

I actually agree with this.

I feel that Go is more suited for things like Docker, where the main requirement is being extremely stable and fast at the same time. For large codebases, it also works really well due to its "stupid" coding style.

Thread Thread
 
ben profile image
Ben Halpern

For large codebases, it also works really well due to its "stupid" coding style.

I still haven't found the motivation to get past hello world in Go, but this description appeals to me.

Collapse
 
rapidnerd profile image
George

What sets go aside and makes it unique from other languages? Specifically for backend.
(Excluding that its a functional language)

Collapse
 
shostarsson profile image
Rémi Lavedrine

Its concurrency implementation makes it very easy to write softwares that are very efficient.
And it is a compiled language which means that it is faster than interpreted language.
So if you have to process a ton of data, Go is definitely interesting.
And it is very easy to learn. ;-)

Collapse
 
bregymr profile image
Bregy Malpartida

I agree <3

Collapse
 
perigk profile image
Periklis Gkolias

Go seems applicable in many fields. Do you think it will become mainstream in areas where there is a de-facto leader today, any time soon? Eg banking and enterprise(Java), DevOps and Machine learning(python), system programming(C++ I believe) or game programming(C# maybe, due to unity)

Collapse
 
ben profile image
Ben Halpern

What other languages were you working with before you got into Go?

Collapse
 
bregymr profile image
Bregy Malpartida

I love python too, and I had experience with C and C++, I think Go is an awesome language but its program paradigm (without objects and using pointers) needs special attention and concentration.

Collapse
 
subsr97 profile image
Subramanian 😎

I've started Learning Go recently. So far, I've written standalone scripts in Go.
How do I go from a beginner to an advanced Go developer?

Collapse
 
bregymr profile image
Bregy Malpartida

Really I don't know, probably the experience and the practice is the best options. If you're creating your own standalone scripts I think you only need merge many of these for creating a big application, one pretty idea to make "complex programs" with Go is create a Backend using its "http" stack library.

Collapse
 
f12developers profile image
Arjun Dahal

i want to ask you the roadmap of the backend developer what should i do to get started with go lang. i know the basics of go and tour of go is also completed. so what do i read or do now ? what should be my next steps