Live data from Hacker News

To learn a new language, read its standard library

patshaughnessy.net

71–80 of 243 posts

Re: To learn a new language, read its standard library

#71

Earlier quoted context omitted.

It's just a little bit more work to write a non-trivial program in Go than in a scripting language such as Python, so if you need/want the good tooling and you need/want the significant speed improvement, it could be a good choice.

Go doesn’t have the libraries of python however. In certain computing domains you would first have to spend 10 years rewriting the python frameworks in golang before you could even be on parity with python. I am most familiar with scientific computing and GIS applications — python is miles ahead of golang in ecosystem support in those domains.

If that was a useful argument for the future we'd all still be using Perl.

I mean, I still write a lot of Perl, but everyone else would be too.

Re: To learn a new language, read its standard library

#73
post #66
post #45

Earlier quoted context omitted.

That's probably true of quite a few languages actually. I mean if there is any library you want to be as fast as possible, it's the standard library. Take python for example, a big chunk of the standard library is actually written in c (although there is often an equivalent implementation in python). In rust the standard library uses quite a bit of unsafe code, and even nightly only features and standard-library-only…

> In rust the standard library uses quite a bit of unsafe code, and even nightly only features and standard-library-only features that you don't usually need in real code I have found the Rust std lib to be a great resource. Much of the unsafe is necessary because there is literally no other way to build up abstractions like Box or certain data structures without it. Obviously once those are written though, you want…

Exactly. The rust standard library can be very informative (and the same is true of other standard libraries as well), but it isn't necessarily going to be the same as what you would do in application code, because in application code you have the benefit of the standard library.

Re: To learn a new language, read its standard library

#75

IMHO, any language worth learning has a large enough user base in both corporate and academic settings and that there are books written on it. That's my criteria. If it doesn't have at least 5 books on Amazon, I'm suspicious of it (and from real publishers, and not publishing mills). There's too much wheel-reinventing happening for me to get excited about new languages. In the last decade I've spent time learning fiv…

Golang is effectively from the late 70's as well.

Re: To learn a new language, read its standard library

#76

Earlier quoted context omitted.

That’s actually what I do whenever I’m lacking humility as a coder. One F12 on std::iterator (which is now deprecated lol [0]) is enough for me to remember that I don’t know anything. [0] https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated...

My gripe with C++ is that you need to know so many things to build even the most basic abstractions. When writing a custom data structure you always end up with having headaches about the specifics of std::iterators and rvalue references and all that jazz rather than focusing on the actual algorithm. There’s a reason why people want to go back to Orthodox C++ (using C++ as C with a few extra features)

This. Want to define a class? Remember the rule of 3 (or is it 5?).

Re: To learn a new language, read its standard library

#77

Earlier quoted context omitted.

It's just a little bit more work to write a non-trivial program in Go than in a scripting language such as Python, so if you need/want the good tooling and you need/want the significant speed improvement, it could be a good choice.

Go doesn’t have the libraries of python however. In certain computing domains you would first have to spend 10 years rewriting the python frameworks in golang before you could even be on parity with python. I am most familiar with scientific computing and GIS applications — python is miles ahead of golang in ecosystem support in those domains.

[deleted]

Re: To learn a new language, read its standard library

#78
post #64

Earlier quoted context omitted.

Go doesn’t have the libraries of python however. In certain computing domains you would first have to spend 10 years rewriting the python frameworks in golang before you could even be on parity with python. I am most familiar with scientific computing and GIS applications — python is miles ahead of golang in ecosystem support in those domains.

For scripting and "just throwing something together for internal use," Python is a pretty traditional choice, but I think Go is able to outclass it for maintainability -- static typing and somewhat better package management are a big help, and Go has a comparable ecosystem.

We'll see in another ten years

Re: To learn a new language, read its standard library

#79
To learn a language, read and understand its specification. Then learn the tooling and libs that come with the compiler. Then just start reading other people's source from wherever while you write your own stuff. Reading the standard lib is helpful, ad is reading the source of any framework, but you have to know the language spec well for it to make sense.

Re: To learn a new language, read its standard library

#80

Earlier quoted context omitted.

What is novel about Go? It just seems like C repacked with a garbage collector and basic concurrent programming support to me. Which both weren't novel even when Go was designed.

It's just a little bit more work to write a non-trivial program in Go than in a scripting language such as Python, so if you need/want the good tooling and you need/want the significant speed improvement, it could be a good choice.

Julia makes the same claims
Post reply on HN