Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/s opinion on Go

Name: Anonymous 2009-11-28 22:04

You know, the google thing.  Personally I'm a bit excited for a compiled python-like C language.  It's going to take for fucking ever for it to become useful, though, especially with google's slow and steady attitude.  I could see it catching on though kind of like python did.

Name: Anonymous 2009-12-02 22:02

>>106,108,111

The only place where null is useful is as a sentinel value for collections. But if you really think about it, any well-chosen user-defined value can fulfill that role. Everywhere else, it's a pain in the ass to deal with. Don't tell me you've never been annoyed with NullPointerExceptions, because that's bullshit.

Having null in the language amounts to admitting the possibility of run-time errors *every time* you use a pointer/reference, but null is obviously only useful *sometimes*. See Scala or OCaml's Option and Haskell's Maybe for alternative ways to solve the null problem when they *are* needed. Note that OCaml is object-oriented, but its variables can never be null. That is because the ML language family actually has type systems that advanced beyond the 70s, unlike C++ and Java, who use glorified structs and are object-oriented in name only.

In short, think of null as the equivalent of Haskell's _|_. Both can be values of any type, but Haskell actually has the courtesy to crap out and allow the programmer to give a helpful text message every time it is encountered, whereas Java, C++ (pointers only, not references), and Go will happily chug along until the problem is encountered so far from its source that hours of frustration ensue.

Remember, kids: When you must fail, fail noisily and as soon as possible.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List