My favorite coding language is Go. Here's why!
Statically typed
Go is a statically typed language. This means that once a variable has been declared, its type cannot change. For example, x := 4
means that x
is now 4
. If I were to change this to a string, it would fail.
Concise
Hello world in Java is extremely complex:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Although Python is simpler, Go is still not nearly as verbose as Java:
package main
func main() {
println("Hello, World!")
}
camelCase
I get that some people prefer snake_case to camelCase, but I like camelCase. And seeing as most of the other languages I use are supposed to use snake_case, it's nice to use camelCase every so often.
Easy to learn
Alright, sure, I tried like ten languages before settling on Go, so I did have experience. However, it's still extremely easy to learn. It took me about two days to figure out how to do most things, which was fairly quick, and I loved it.
Other
- Go is a compiled language, making it extremely rapid.
- It comes with a built-in formatter (
go fmt <filename>
) - It's new-ish, so the developers learnt from other languages' mistakes
- It has a wide variety of applications, from webdev to CLI apps.
Have you tried Go? Did you like it?
Top comments (14)
Read the first few sections of this to get a good grasp of the advantages of Go
dave.cheney.net/practical-go/prese...
. Although that's a good blog for Go
This is amazing. Thank you for sharing these.
Top 10 "Go" Programming features.
I kept hearing about concurrency without having a clue what it is. I finally looked it up, and now it makes sense.
Yep, always wanted to get into Go. I just want to say that, Go isn't that young, it's the same age as Node ;)
That's true. Relatively to other languages, though, it's roughly a quarter of their age. (I found the average of Java, JS, Python, C, C++, and C#'s ages.)
I heard a lot of good things about Go, and a lot of bad things, such as the use of a non-standard date system. Maybe one day I’ll give it a shot, although from my understanding Go does not have something it particularily excels in (correct me if I’m wrong).
I think Go's original purpose was to get stuff done more easily and faster. From what I've seen and read, one of the most common reasons for using Go is CLI apps. Even GitHub's CLI is built entirely in Go.
What are the benefits of Go when it comes to writing CLI apps? How is it different than any other language?
I don't know, it just seems to be commonly used for them. Also, it's compiled, so it can be very fast.
Well… a lot of languages are compiled.
I love using go with Wails
How do you feel about Rust?
I've played with it before. It's cool, but I still prefer Go