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…
To learn a new language, read its standard library
31–40 of 243 posts
Re: To learn a new language, read its standard library
#32That being said, for Erlang, I think this is a good idea. I learned a lot when reading the standard library.
Re: To learn a new language, read its standard library
#33> I hope that you will pick up the habit of browsing through source code. You can learn from it and mine it for ideas. Having GNU Emacs is like having a dragon’s cave of treasures.
- https://www.gnu.org/software/emacs/manual/html_node/eintr/On...
Re: To learn a new language, read its standard library
#34Re: To learn a new language, read its standard library
#35To 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.
[0] https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated...
Re: To learn a new language, read its standard library
#36To 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.
Re: To learn a new language, read its standard library
#37I think there’s definitely value to reading a language’s standard library, and I’ve also gotten lots of value from even reading the language’s implementation! But I hope people take this advice to start with reading the standard library with a grain of salt: it can be one extra resource for you, and likely to show you new things that weren’t written in docs somewhere, but if it doesn’t click or is proving difficult to understand, that’s fine!
In particular, for the “reading code to learn” bit, consider reading an application written in that language (command line tool, web application, etc.) and it might serve as a more reduced intro to the language.
Re: To learn a new language, read its standard library
#38To 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.
Re: To learn a new language, read its standard library
#39To 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.
Uh yeah if you try and read the Haskell standard library, you're screwed. It's list fusion and fancy algorithms to hack asymptotics all the way down.
Re: To learn a new language, read its standard library
#40I 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.