For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | __pid_t's commentsregister

This. I found that I was on a different level than my peers in college in terms of programming ability. I knew I was on a different level because we had group work, and it was very annoying having to explain simple things like how to do a linear search for an element in an array. At that point, I believed that some people with CS degrees actually _can\'t_ do fizzbuzz

In the end, I had practiced more and have pretty much programmed everyday for 7 years, while they only did the minimum requirement to pass classes in CS>


> nil pointer dereference in closeConnIfStillIdle

What happens here? Does Go suffer from boundary access issues that C has? You know, in Rust, you don't have to worry about that, but is it the same for GO?


Go has null pointers, unlike Rust. Dereferencing a null reference type generally panics, but there are some random exceptions (e.g. indexing a nil map returns a zero value of the appropriate type).


I've run into intermittent issues with net/http (such as the defaults for HttpClient causing application failures in production). It's just a spot you learn to pay attention to. I'm glad they're fixing some of the bugs in the code because otherwise it is an incredible part of the STD lib.


I think it would produce a runtime error and return a stack trace. Someone more qualified than me should chime in though...


Yes, like this:

  package main
  
  import "io"
  
  func main() {
  	var foo io.Closer
  	foo.Close()
  }
  justin@t420:/tmp$ go run nil.go 
  panic: runtime error: invalid memory address or nil pointer dereference
  [signal 0xb code=0x1 addr=0x20 pc=0x401023]
  
  goroutine 1 [running]:
  panic(0x463ea0, 0xc82000a140)
  	/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
  main.main()
  	/tmp/nil.go:7 +0x23
  exit status 2


The goroutine panics. Nil dereferences are recoverable from[1], but I'm not sure how many people expect standard library code to panic.

[1]: https://play.golang.org/p/hjfaNQbOBO


> Does Go suffer from boundary access issues that C has?

It has NPE (like Java or C#), though in some conditions it'll behave more like Objective-C.


How's Devry? I worked with a person that got a degree from there. It's for-profit too. I can't imagine it's any better than ITT with it's vendor lock in.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You