go podcast()

003: Pointers or !Pointers, stack, and heap


Listen Later

We go over what are pointers and when to use or not use them. For instance, this is probably not a good use for pointers.

func main() {
  var i int = 10
  abc(&i)
}

func abc(i *int) {
  *i = 15
}

In my opinion any dereferencing is probably bad. Better way:

func main() {
  var i int = 10
  i = abc(i)
}

func abc(i int) int {
  return 15
}

I also try to give some basics info regarding the stack and heap and why pointers might not be seen as an optimization.

I have a course on building SaaS in Go.

Follow me on Twitter.

...more
View all episodesView all episodes
Download on the App Store

go podcast()By Dominic St-Pierre

  • 3.6
  • 3.6
  • 3.6
  • 3.6
  • 3.6

3.6

5 ratings


More shows like go podcast()

View all
Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

Software Engineering Radio - the podcast for professional software developers

273 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

285 Listeners

The Cloudcast by Massive Studios

The Cloudcast

153 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

587 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

630 Listeners

Soft Skills Engineering by Jamison Dance and Dave Smith

Soft Skills Engineering

275 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

214 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

989 Listeners

REWORK by 37signals

REWORK

208 Listeners

CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

CoRecursive: Coding Stories

185 Listeners

Kubernetes Podcast from Google by Abdel Sghiouar, Kaslin Fields

Kubernetes Podcast from Google

180 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

139 Listeners

Oxide and Friends by Oxide Computer Company

Oxide and Friends

47 Listeners

Cup o' Go by Jonathan Hall & Shay Nehmad

Cup o' Go

15 Listeners

Fallthrough by Fallthrough Media

Fallthrough

10 Listeners