Live data from Hacker News

To learn a new language, read its standard library

patshaughnessy.net

111–120 of 243 posts

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

#111

Whole heartedly agree. I was big into Go years ago, and some newer guys tried to make it a functional language. When they argued with me, I couldn't say 'its's just not right', but instead pointed them to std library code. Protip: That doesn't change their mind, it just makes them hate Go.

If it drove them to write in another language, might that be a win? A code base full of non-idiomatic code, where devs think in the style of language A while using language B, isn’t a great place to hang out.

It absolutely would be, if our entire stack wasn't in Go.

One was a JS guru who literally threatened 'I can walk across the street and get another job, you know.' And we let him, and both of us are happier for it.

So I do agree, don't join a team writing a language you hate.

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

#115

Whole heartedly agree. I was big into Go years ago, and some newer guys tried to make it a functional language. When they argued with me, I couldn't say 'its's just not right', but instead pointed them to std library code. Protip: That doesn't change their mind, it just makes them hate Go.

Why is that wrong? A language can be multi-paradigm while the “official” documents are written in a specific style. Like human languages, they evolve with their use (or fork into another language completely), while the high literature is the last one to change. Together with that, I agree that one should read the high literature before inventing a new writing style.

> read the high literature

The elite language in Rome was Greek.

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

#116

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.

/me trying to learn OCaml after learning a bunch of other languages. Disagrees.

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

#118
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.

Wouldn't building a small, toy application with the framework be a more efficient way to learn it?

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

#119
post #89

This is a classic academia-ish take. Consume a bunch of theory and regurgitate whatever you've read. Better way to learn is making stuff with the language, having actual skin in the game. Only then bounce back to theory on the more nuanced stuff.

I don't think this is a good read. A standard library is very concrete - it's the core of the language in action, and the shape that its code takes will likely be repeated regularly in 3rd party code written in that language. There's nothing academic or abstract about it. EDIT: As others note, a good chunk of a stdlib may involve system interop that isn't representative, so that tempers my comment with regards to whe…

Here is a basic structure implemented in C++:

https://github.com/llvm-mirror/libcxx/blob/master/include/ve...

I would not recommend anyone ever look through that as a way to learn C++. Heck just something as basic as a struct that stores two member variables is a 200 line of code horror show in C++:

https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b501...

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

#120
post #89

This is a classic academia-ish take. Consume a bunch of theory and regurgitate whatever you've read. Better way to learn is making stuff with the language, having actual skin in the game. Only then bounce back to theory on the more nuanced stuff.

Better really depends on who you are. Born academics can learn better by reading foundation libraries and principles, and they write articles advising others to do the same :-) What you described as better could be a really good fit for business-first coding opportunists who would get annoyed by perceived inefficiencies and petty politics in academia... The article is a terrific example of basic analysis BTW. This un…

No, even academia and pure theorists could take a fresh perspective with actual skin in the game in making software.

> The article is a terrific example of basic analysis BTW.

Hahaha. It's some cherry picked examples and you're already claiming it's 'a terrific example of basic analysis'. The hyperbole is real in software.

Post reply on HN