SlideShare a Scribd company logo
1 of 33
Adventure in learning Go
(for a C# dev!)
Ken Faulkner : @kpfaulkner
Adventure in learning Go
(for a C# dev!)
Ken Faulkner : @kpfaulkner
Basics
•Native
Basics
•Native
•Wide OS Support (Win, MacOS, *BSD, Linux)
Basics
•Native
•Wide OS Support (Win, MacOS, *BSD, Linux)
•Simple syntax (C inspired)
Basics
•Native
•Wide OS Support (Win, MacOS, *BSD, Linux)
•Simple syntax (C inspired)
•Produces single binary
Basics
•Native
•Wide OS Support (Win, MacOS, *BSD, Linux)
•Simple syntax (C inspired)
•Produces single binary
•Best used for system/server development
Basics
•Native
•Wide OS Support (Win, MacOS, *BSD, Linux)
•Simple syntax (C inspired)
•Produces single binary
•Best used for system/server development
•Traded “trendy” for practicality
Hello World (mandatory)
package main
import (
"fmt"
)
func main() {
fmt.Printf(“Hello NDC Sydney!")
}
The Good
• Small syntax (fits in your head)
The Good
• Small syntax (fits in your head)
• Great concurrency model (goroutines)
The Good
• Small syntax (fits in your head)
• Great concurrency model (goroutines)
• Interfaces (same but different)
The Good
• Small syntax (fits in your head)
• Great concurrency model (goroutines)
• Interfaces (same but different)
• Garbage collection
The Good
• Small syntax (fits in your head)
• Great concurrency model (goroutines)
• Interfaces (same but different)
• Garbage collection
• Runtime performance (personal experience, but could find
benchmarks proving one way or the other)
Go Routines
• Think of them as very light weight TPL Tasks with queues for inter task
comms
Go Routines
• Think of them as very light weight TPL Tasks with queues for inter task
comms
• Can have hundreds of thousands of them without issue
Go Routines
• Think of them as very light weight TPL Tasks with queues for inter task
comms
• Can have hundreds of thousands of them without issue
• Think GreenThreads (ish) but done right (IMHO)
package main
import “fmt”
func doSuperComplexCalc() {
// super secret incredibly complex calculation
// writes results somewhere.
}
func main() {
doSuperComplexCalc()
// do more complex work in main thread.
fmt.Printf(“done!”)
}
package main
import “fmt”
func doSuperComplexCalc() {
// super secret incredibly complex calculation
// writes results somewhere.
}
func main() {
go doSuperComplexCalc()
// do more complex work in main thread.
fmt.Printf(“done!”)
}
The (perceived as) Bad
• No generics
The (perceived as) Bad
• No generics
• No Nuget (or equiv, yet)
(nearly all dependencies seem to come from Github)
The (perceived as) Bad
• No generics
• No Nuget (or equiv, yet)
(nearly all dependencies seem to come from Github)
• No LINQ
The Ugly Cliché
• Tooling
The Ugly Cliché
• Tooling
• Editors/IDEs (VS Code, Sublime Text, Gogland, Vim…. Emacs if you’re
that class of person)
The Ugly Cliché
• Tooling
• Editors/IDEs (VS Code, Sublime Text, Gogland, Vim…. Emacs if you’re
that class of person)
• No exceptions, check every function return
err := DoSomething()
If err != nil {
// we have an error.
}
The Strange
• Object Oriented…. “yes and no” (Golang FAQ)
The Strange
• Object Oriented…. “yes and no” (Golang FAQ)
• No classes only structs (no inheritance)
The Strange
• Object Oriented…. “yes and no” (Golang FAQ)
• No classes only structs (no inheritance)
• Think of methods as C# extension methods
Methods
type Calculator struct {
total int
}
func (c *Calculator) AddToTotal(x int) {
c.total += x
}
func (c *Calculator) DisplayTotal() {
fmt.Printf("Total is %d", c.total)
}
Overall thoughts
• Great for server work
• Great for CLI tools
• Very easy to become productive
• Very helpful community
• Missing some nice-to-haves (eg Nuget, LINQ)
END
Similar Concepts
C# GO
Task GoRoutine
Class/Struct Struct
Dictionary Map
Array Array
List Slice (wrapper around Array)
Class Composition Embedded Types
Waaaay different, 5th cousin twice removed
C# GO
Generics ???
Exception Fatal
Objects Nope
Access Modifiers Case sensitivity
LINQ Noooooooooooooooo

More Related Content

What's hot

Rabbits, indians and... Symfony meets queueing brokers
Rabbits, indians and...  Symfony meets queueing brokersRabbits, indians and...  Symfony meets queueing brokers
Rabbits, indians and... Symfony meets queueing brokersGaetano Giunta
 
Running a Plone product on Substance D
Running a Plone product on Substance DRunning a Plone product on Substance D
Running a Plone product on Substance DMakina Corpus
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinarRoland Benedetti
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013gwhathistory
 
Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07Svein Fidjestøl
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 
Apache Traffic Server Internals
Apache Traffic Server InternalsApache Traffic Server Internals
Apache Traffic Server InternalsPSUdaemon
 
DevOps: What is This Puppet You Speak Of?
DevOps: What is This Puppet You Speak Of?DevOps: What is This Puppet You Speak Of?
DevOps: What is This Puppet You Speak Of?Rob Reynolds
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Minimal Containers for PHP
Minimal Containers for PHPMinimal Containers for PHP
Minimal Containers for PHPWeaveworks
 
Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_presojessicard
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersDiego Freniche Brito
 
Tech talk live customizing alfresco
Tech talk live   customizing alfrescoTech talk live   customizing alfresco
Tech talk live customizing alfrescoAlfresco Software
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
cPanel conf 2017 - How to Speak cPanel
cPanel conf 2017 - How to Speak cPanelcPanel conf 2017 - How to Speak cPanel
cPanel conf 2017 - How to Speak cPanelcPanel
 
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweet
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweetErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweet
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweetCoTweet
 

What's hot (20)

Delphi L01 Intro
Delphi L01 IntroDelphi L01 Intro
Delphi L01 Intro
 
Rabbits, indians and... Symfony meets queueing brokers
Rabbits, indians and...  Symfony meets queueing brokersRabbits, indians and...  Symfony meets queueing brokers
Rabbits, indians and... Symfony meets queueing brokers
 
Running a Plone product on Substance D
Running a Plone product on Substance DRunning a Plone product on Substance D
Running a Plone product on Substance D
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinar
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
 
Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
Apache Traffic Server Internals
Apache Traffic Server InternalsApache Traffic Server Internals
Apache Traffic Server Internals
 
DevOps: What is This Puppet You Speak Of?
DevOps: What is This Puppet You Speak Of?DevOps: What is This Puppet You Speak Of?
DevOps: What is This Puppet You Speak Of?
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Minimal Containers for PHP
Minimal Containers for PHPMinimal Containers for PHP
Minimal Containers for PHP
 
Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_preso
 
Scaling Deployment at Etsy
Scaling Deployment at EtsyScaling Deployment at Etsy
Scaling Deployment at Etsy
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented Programmers
 
Tech talk live customizing alfresco
Tech talk live   customizing alfrescoTech talk live   customizing alfresco
Tech talk live customizing alfresco
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
cPanel conf 2017 - How to Speak cPanel
cPanel conf 2017 - How to Speak cPanelcPanel conf 2017 - How to Speak cPanel
cPanel conf 2017 - How to Speak cPanel
 
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweet
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweetErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweet
ErLounge SF/Bay: 2010.01.12 Christian Westbrook / CoTweet
 

Similar to Learning Go for C# Developers - An Adventure in Concurrency and Simplicity

Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1Lin Yo-An
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with GoSteven Francia
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Levente Kurusa
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectYen-Chin Lee
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxQIANG XU
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshareCavelle Benjamin
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: BashMichał Kordas
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageRené Ribaud
 
20180324 leveraging unix tools
20180324 leveraging unix tools20180324 leveraging unix tools
20180324 leveraging unix toolsDavid Horvath
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with Cgpsoft_sk
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP PerspectiveBarry Jones
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Prof. Wim Van Criekinge
 
Go for Rubyists
Go for RubyistsGo for Rubyists
Go for Rubyiststchandy
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 

Similar to Learning Go for C# Developers - An Adventure in Concurrency and Simplicity (20)

Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
Happy Go programing
Happy Go programingHappy Go programing
Happy Go programing
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
Homebrew atlrug
Homebrew atlrugHomebrew atlrug
Homebrew atlrug
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming language
 
20180324 leveraging unix tools
20180324 leveraging unix tools20180324 leveraging unix tools
20180324 leveraging unix tools
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013
 
Go for Rubyists
Go for RubyistsGo for Rubyists
Go for Rubyists
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Learning Go for C# Developers - An Adventure in Concurrency and Simplicity

  • 1. Adventure in learning Go (for a C# dev!) Ken Faulkner : @kpfaulkner
  • 2. Adventure in learning Go (for a C# dev!) Ken Faulkner : @kpfaulkner
  • 4. Basics •Native •Wide OS Support (Win, MacOS, *BSD, Linux)
  • 5. Basics •Native •Wide OS Support (Win, MacOS, *BSD, Linux) •Simple syntax (C inspired)
  • 6. Basics •Native •Wide OS Support (Win, MacOS, *BSD, Linux) •Simple syntax (C inspired) •Produces single binary
  • 7. Basics •Native •Wide OS Support (Win, MacOS, *BSD, Linux) •Simple syntax (C inspired) •Produces single binary •Best used for system/server development
  • 8. Basics •Native •Wide OS Support (Win, MacOS, *BSD, Linux) •Simple syntax (C inspired) •Produces single binary •Best used for system/server development •Traded “trendy” for practicality
  • 9. Hello World (mandatory) package main import ( "fmt" ) func main() { fmt.Printf(“Hello NDC Sydney!") }
  • 10. The Good • Small syntax (fits in your head)
  • 11. The Good • Small syntax (fits in your head) • Great concurrency model (goroutines)
  • 12. The Good • Small syntax (fits in your head) • Great concurrency model (goroutines) • Interfaces (same but different)
  • 13. The Good • Small syntax (fits in your head) • Great concurrency model (goroutines) • Interfaces (same but different) • Garbage collection
  • 14. The Good • Small syntax (fits in your head) • Great concurrency model (goroutines) • Interfaces (same but different) • Garbage collection • Runtime performance (personal experience, but could find benchmarks proving one way or the other)
  • 15. Go Routines • Think of them as very light weight TPL Tasks with queues for inter task comms
  • 16. Go Routines • Think of them as very light weight TPL Tasks with queues for inter task comms • Can have hundreds of thousands of them without issue
  • 17. Go Routines • Think of them as very light weight TPL Tasks with queues for inter task comms • Can have hundreds of thousands of them without issue • Think GreenThreads (ish) but done right (IMHO)
  • 18. package main import “fmt” func doSuperComplexCalc() { // super secret incredibly complex calculation // writes results somewhere. } func main() { doSuperComplexCalc() // do more complex work in main thread. fmt.Printf(“done!”) }
  • 19. package main import “fmt” func doSuperComplexCalc() { // super secret incredibly complex calculation // writes results somewhere. } func main() { go doSuperComplexCalc() // do more complex work in main thread. fmt.Printf(“done!”) }
  • 20. The (perceived as) Bad • No generics
  • 21. The (perceived as) Bad • No generics • No Nuget (or equiv, yet) (nearly all dependencies seem to come from Github)
  • 22. The (perceived as) Bad • No generics • No Nuget (or equiv, yet) (nearly all dependencies seem to come from Github) • No LINQ
  • 24. The Ugly Cliché • Tooling • Editors/IDEs (VS Code, Sublime Text, Gogland, Vim…. Emacs if you’re that class of person)
  • 25. The Ugly Cliché • Tooling • Editors/IDEs (VS Code, Sublime Text, Gogland, Vim…. Emacs if you’re that class of person) • No exceptions, check every function return err := DoSomething() If err != nil { // we have an error. }
  • 26. The Strange • Object Oriented…. “yes and no” (Golang FAQ)
  • 27. The Strange • Object Oriented…. “yes and no” (Golang FAQ) • No classes only structs (no inheritance)
  • 28. The Strange • Object Oriented…. “yes and no” (Golang FAQ) • No classes only structs (no inheritance) • Think of methods as C# extension methods
  • 29. Methods type Calculator struct { total int } func (c *Calculator) AddToTotal(x int) { c.total += x } func (c *Calculator) DisplayTotal() { fmt.Printf("Total is %d", c.total) }
  • 30. Overall thoughts • Great for server work • Great for CLI tools • Very easy to become productive • Very helpful community • Missing some nice-to-haves (eg Nuget, LINQ)
  • 31. END
  • 32. Similar Concepts C# GO Task GoRoutine Class/Struct Struct Dictionary Map Array Array List Slice (wrapper around Array) Class Composition Embedded Types
  • 33. Waaaay different, 5th cousin twice removed C# GO Generics ??? Exception Fatal Objects Nope Access Modifiers Case sensitivity LINQ Noooooooooooooooo