Live data from Hacker News

To learn a new language, read its standard library

patshaughnessy.net

191–200 of 243 posts

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

#192

Completely agree. Once you learn enough languages, it all starts blending together and looking more or less the same. Same control structures, same functions, same structures, same classes, same objects, same lists, same hash tables, same pretty much everything. There's usually a few innovations and peculiarities here and there but it's not that much. The bulk of the language is actually the standard library. The API…

> This is why Scheme is so easy to learn. The language itself can be learned in hours. The standard library is so small it's pretty much useless. Learning Racket on the other hand is much harder.

This is why Racket is so easy to learn. The language itself can be learned in hours. The standard library is so big that you can do anything with it. Learning Scheme on the other hand is much harder.

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

#193

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.

Well that's just silly. Why take a job using hammers and nails when you really like screws and screwdrivers, but hate hammers and nails?

I think the argument instead might have been, "Go is not designed for it, and kludging in a language paradigm that the language wasn't designed for is going to make for worse code."

The fact that these engineers didn't understand this, suggest to me that perhaps they were not very good engineers as such, even if they might have been skilled software programmers.

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

#194

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.

Wanting to explore that space as a hobby is not wrong, but insisting on it at work when it's clearly not typical or well-supported is pretty wrong in my opinion.

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

#195

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…

Could I trouble you to compare Ada and Rust, especially in terms of safety? I'd like to be able to write low-level code without dealing with the insanity of C, and my top picks are Ada (traditional answer to "safe language"), Rust (the up and coming answer to "safe language"), and Pascal (friendlier than C and way better at least for memory safety), but I'm reluctant to learn all of them to sufficient depth to be abl…

Memory "unsafety" isn't bad. It's just a feature. In fact it's a feature some people want and need. I'd still start with C. There are all the ressources in the world to learn and it's better to know how to manage boundaries and memory allocation by hand than the other way around.

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

#196

Any tip where to begin with Julia?

https://github.com/JuliaLang/julia/tree/master/stdlib . The matrix factorizations for example are pretty nice reads if you know the subject https://github.com/JuliaLang/julia/blob/master/stdlib/Linear...

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

#197

> To learn a new language, read its standard libraryTo learn a new language, read its standard library Yes, but also no. The standard library is often more complex and uses more advanced features then you often need for most projects. I.e. collections in std are supper general purpose, but if you need to write a collection it's normally specific to the purpose you need it for. I.e. std is the "most" general purpose l…

That's why I decided not to invest in Scala. Its standard collections library was so hard to grok that I just decided to stay on Java. I must understand everything in the entire stack I'm using. If I have blind spots, it makes me nervous.

Java is pretty good in that regard, for example. I regularly browse its standard library and it's quite comprehensible. Concurrent stuff is not easy, but I guess that's the nature of underlying algorithms.

Also that's the reason that I don't like Java streams. They're as hairy as Scala collections. I'm avoiding Java streams.

IMO implementation details of any library matters as much as its public API. If library implementation is not nice to read, it's a very bad smell.

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

#198
post #81

Earlier quoted context omitted.

sudo apt-get install python3

I meant actual code from their library So https://github.com/python/cpython/tree/main/Python

Sorry it was a tongue-in-cheek comment about preferring Python to Julia :)

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

#199
post #158

Completely agree. Once you learn enough languages, it all starts blending together and looking more or less the same. Same control structures, same functions, same structures, same classes, same objects, same lists, same hash tables, same pretty much everything. There's usually a few innovations and peculiarities here and there but it's not that much. The bulk of the language is actually the standard library. The API…

I think the Scheme quote is interesting, because it almost applies to C. Most people consider learning C hard (for example, compared to python), but it is an extremely small language with a "standard library so small it's pretty much useless".

C is hard because despite being a "small" language, it's full of all kinds of unintuitive rules and behaviour for beginners to stumble upon, and the language provides next to no assistance in avoiding the pitfalls. People have to learn C by making potentially dangerous mistakes, hopefully in code where they don't matter.

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

#200
post #170

Earlier quoted context omitted.

What do you mean? The entire premise behind the design and creation of the C++ language was to add object oriented features to C.

https://arne-mertz.de/2015/07/c-is-not-an-object-oriented-la...

Sorry mate, your argument doesn't make much sense. People can and do write OOP in C++, and just because it is multi-paradigm does not mean no one should write OOP.

It's like saying, because an artist is using watercolors for this painting, they should therefore never do pencil drawings on other projects.

Post reply on HN