Live data from Hacker News

To learn a new language, read its standard library

patshaughnessy.net

21–30 of 243 posts

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

#21
post #14

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.

Re-implement a toy version of the framework from scratch. :-) Or, try to add a non-trivial feature to the framework.

How do you know what a "toy version of the framework" looks like when you're not experienced with the framework itself?

It seems to me like you've already solved the issue of "learning the framework" if your mental model of the framework is that solid.

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

#22
post #15

I’m using Zig a lot right now, and I have been pleasantly surprised by the standard library. Maybe it’s due to Zig being a very straightforward language, but I find most everything I read in the standard library to make immediate sense. I don’t know about reading std alone to learn Zig though, I used other sources like ziglings and ziglearn which taught me syntax and patterns. Had I started with the standard library…

Is there any learning resource for Zig that doesn’t assume you already know C? I couldn’t find any.

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

#23
post #9

Definitely true for Golang, learned a ton reading its stdlib (and even found a bug this way)

I agree, Golang is a good language for this. Rust, too.

The Python standard library is pretty crufty — lots of stylistically dated code. Same with Perl 5, and I would guess other similar languages but I can't speak from direct experience. I bet that's more a function of their age — back in the 1990s maybe it might have been unreservedly good advice to read those standard libraries.

I've also learned a lot from writing FFI extensions for languages, which for Rust and Go involves a lot of standard library diving but for languages like Python, Perl 5 and Ruby where the core is mostly written in C, it's a different experience than reading the standard library.

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

#25

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.

I usually prefer working with mature stacks that don't require me to constantly work with flavor of the month frameworks. It's great to broaden your horizons and all, but that is something that needs to be done judiciously and deliberately if it is to actually be of any use.

Me too, but to get started on a non-trivial project in such a stack is, IMO, the tricky part. It would be nice if I could do everything in the stack(s) I already know, but that's not always possible (e.g. backend vs web vs mobile app vs desktop app).

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

#26
In the past, people supported pundits who would sit in the monasteries/huts their whole life perfecting their knowledge of scriptures and their skills of explaining them to others (incl. picking the right verse when it's needed and commenting the way helpful to the seeker). Some times I feel like today, besides free software projects, meant to be ran on donations, there should be entire separate projects dedicated to writing really good (also taking usability, eloquence, ease of understanding and practical examples very seriously) documentation for programming languages and libraries.

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

#28
This is how I approached learning Nim at the time, and it was quite an excellent approach in my opinion. Even gives you the opportunity to contribute to the language in question, when you inevitably come across something that isn't optimal, a bug, or even something as small as formatting inconsistencies, which is a nice feeling

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

#29

Until you realize most of the time the code is loaded with Macros, ifdefs, cross-platform conditions(windows,macos,linux...), hacks for different versions of OSes/dependency/whatever, the real meat is hard to spot on, it's easy to get lost in those noises.

Funny enough, this was a source of much criticism for OpenSSL as well, at least in the 1.0x series.

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

#30
I say best way to learn is to start coding and break stuff :-)

Also once one gets more experienced, its better to decouple the language from programming concepts like object oriented programming, continuations, avoiding side effects in functional programming, etc. Useful to read books like SICP and algorithm books, then learn multiple languages and you will see they are not that different overall.

I recommend learning Lisp or Scheme or related languages because they have a lot of good conceptual resources to learn from. But maybe that’s my background talking, I loved SICP. I learnt SO much from studying Common Lisp in the last year. Of course it helps that it has a great language specification.

In terms of choosing a language, standard library matters a lot. Hence the explosion of JS due to NPM and also being in browser. I’m suprised SWIFT is not more popular, given Apple’s place in the ecosystem. I really liked programming in Swift, very enjoyable language. And it has generic functions too!

Post reply on HN