25
Golang #5 TO GO or NOT TO GO Vu Nguyen [email protected]

Golang #5: To Go or not to Go

Embed Size (px)

Citation preview

Page 1: Golang #5: To Go or not to Go

Golang #5

TO GO or

NOT TO GO

Vu [email protected]

Page 2: Golang #5: To Go or not to Go

Go is an optional language released in 2012( It does not force you using it likeJava for Android or Obj-C for iOS )

Why is it so popular today?

Page 3: Golang #5: To Go or not to Go
Page 4: Golang #5: To Go or not to Go

Who are switching to Go?

(definitely not mobile devs)

Page 5: Golang #5: To Go or not to Go
Page 6: Golang #5: To Go or not to Go

Why Go?

1. Single binary deployment2. Minimal language3. Easy concurrency4. Full development environment5. Multi-arch build6. Low-level interface7. Getting started quickly

Page 7: Golang #5: To Go or not to Go

Nope. Only 1 reason.

Page 8: Golang #5: To Go or not to Go

Nope. Only 1 reason.

It just works!

Page 9: Golang #5: To Go or not to Go

Remember the day when you wrote your first program in University.

int main(int argc, const char* argv[]) {printf("%s", "Hello world");return 0;

}

$ ./helloHello world

Page 10: Golang #5: To Go or not to Go

Then things get so complex…

Page 11: Golang #5: To Go or not to Go

What is “AbstractUniversalModelFactoryBuilder” ?When will we use “abstract class” or “interface” ?Hey, “callback” or “promise” or “async.js” or “yield”?How to run your app on multiple-cores computers ? (hint: Node.js “cluster”)How to correctly install all these dependencies?“MVC” or “ORM” or “EntityFramework” or “name-your-fancy-framework” ?Why my database got “undefined” instead of my beautiful numbers?Why did you use “tab” instead of “4 spaces” ?

Then things get so complex…

Page 12: Golang #5: To Go or not to Go

Why get into trouble?

Page 13: Golang #5: To Go or not to Go

Why get into trouble?

Programming languages are tools to build my beautiful applications.

Nothing more!

Page 14: Golang #5: To Go or not to Go

Why people create so many things tosimplify life of developers?

- Create applications without writing code.- Build real-time mobile applications without server code.- Automatically scale up without manually config.- ORM, frameworks, and IDE.- …

Page 15: Golang #5: To Go or not to Go

Because development is hard.

Page 16: Golang #5: To Go or not to Go

Because development is hard.

Life is short.

Keep building your awesome applications.

Page 17: Golang #5: To Go or not to Go

Just Go!

Page 18: Golang #5: To Go or not to Go

Just Go!

import "fmt"func main() {

fmt.Println("Hello world!")}

$ ./helloHello world!

Page 19: Golang #5: To Go or not to Go

1. Cross platform build2. Garbage collector3. Run on multiple-core by default4. Easy to learn and write5. Consistent coding style, easy to read others’ code6. Super easy deployment and config7. Good and consistent performance8. No more crazy “AbstractUniversalFactory…”9. No more OOP, ORM, fancy frameworks, …

Just write code that matter.

Page 20: Golang #5: To Go or not to Go

Writing a web server

import ("net/http""fmt"

)

func handler(w http.ResponseWriter, r *http.Request) {fmt.Fprintln(w, "Hello World!")

}

func main() {http.HandleFunc("/", handler)http.ListenAndServe(":8080", nil)

}

Page 21: Golang #5: To Go or not to Go

Go is a language for engineers

• Go make development life simplerbut do not try to hide nasty things.

• You still need your computer science knowledge.

Page 22: Golang #5: To Go or not to Go

When not Go?1. Mobile development2. Web development3. Game development4. Data scientist5. Low-level drivers6. Performance critical code7. Prototyping applications8. MVC applications9. Shared host (PHP, ASP.NET)

Page 23: Golang #5: To Go or not to Go

When not Go?1. Mobile development → Java, Obj-C, .NET2. Web development → JavaScript3. Game development → Game engines4. Data scientist → Python, R5. Low-level drivers → C, Rust6. Performance critical code → C, C++, Rust7. Prototyping applications → Node.js8. MVC applications → PHP, ASP.NET, Ruby on Rails9. Shared host (PHP, ASP.NET) → Wordpress!

Page 24: Golang #5: To Go or not to Go

When Go?

1. Distributed environmentServer development, web services, api

2. PortableCommand line tools

3. You care about team productivityand good performance & quality.

Page 25: Golang #5: To Go or not to Go

Golang #5

THANK YOU

Vu [email protected]