Live data from Hacker News

To learn a new language, read its standard library

patshaughnessy.net

61–70 of 243 posts

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

#63

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.

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.

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

#64

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.

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.

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

#65
post #31

Reading the Python stdlib was a brilliant move a peer encouraged me to do. I learned three themes of stuff: 1. A good look at long lasting, durable pure python. 2. A good look at long lasting, durable C implementations of python (dict is the core of Python. Read the source!) 3. A look at a bunch of libraries that basically never get used and a sense of how they compare to popular third party libraries. (Doing this is…

I'd love if you could elaborate on your thoughts for 3. Is it a problem of not being feature complete in unpopular parts of the stdlib?

urllib vs requests is one prominent example

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

#66
post #45
post #12

To anyone that considers this approach for learning C++, I would advise strongly against it. Standard library code has to deal with too many cases and tries to be optimal for as many of them as possible. Also the formatting is highly unusual, compared to other C++ code found in the wild.

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 to build on top of them where possible and not use unsafe.

It's probably important to delineate between a good example of application code vs library code also. The std lib is not going to help much with application code.

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

#67
post #12

To anyone that considers this approach for learning C++, I would advise strongly against it. Standard library code has to deal with too many cases and tries to be optimal for as many of them as possible. Also the formatting is highly unusual, compared to other C++ code found in the wild.

The same is true of clojure. Don’t read clojure.core as idiomatic.

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

#70

I find languages are pretty easy to pick up after the first few. What seems to be the barrier nowadays is frameworks. How do people go about learning a new framework? Obviously most of them have an intro project to follow on with, but they tend to be pretty simplistic, and once that's done, getting to the complicated bits that you actually want to implement seem to be the barrier.

If you stay strictly in the procedural/OO paradigm then sure: it's just a new std lib and syntax. When you jump to functional, logical, or more esoteric paradigms things start to get pretty different.

Of course if you've already got one of each major paradigm under your belt things get progressively easier because you're exposed to more ideas...

Post reply on HN