Express.js #4

Closed
fasiha opened this Issue Dec 28, 2016 · 3 comments

Comments

2 participants
@fasiha

fasiha commented Dec 28, 2016

Continuing my tweet about Express as another data point to iron/diesel per “Teaching libraries through good documentation”

I’m not sure I can answer your question, since I somehow learned it a few years ago, basically by cobbling enough of an understanding on how the pieces fit together for the official API docs to make sense. But Express is a superstar so there are tons of online tutorials—all of them quite bad I found 😅. There’s a very brief official “hello world” which, when I was a beginner, I ignored because it was so short, and a much longer yet much less useful page on using a project generator to get started. Occasionally when I need to throw together an Express app, I revisit the Hello World page and then look up the API docs, each time. It’s really strange, I honestly don’t know how people learn to use Express, although obviously they do…

Another example in this space is in Clojure, where a lot of people use the combination of ring (HTTP server) & compojure (routing). Dozens of plugins, like express—for anti-forgery, cookies, timeouts, JSON, &c.

Of course, for both Clojure and Node there are Rocket-like frameworks (Rails-like?), but they seem not as popular, in those ecosystems, as these hypermodular libraries. Definitely a head-scratcher for me…

@killercup

This comment has been minimized.

Show comment
Hide comment
@killercup

killercup Dec 28, 2016

Owner

Thanks for your reply! I think I first used express.js when 3.0 was just released, but I can't really remember how I got familiar with it. Probably some tutorial someone with half a week more experience than me wrote :)

I'm the kind of person who likes technologies that build huge ecosystems on a few, simple concepts, like middlewares. And I've always admired projects that feel like that, given a set of useful concepts, they are the "obvious" implementations. That's all very theoretical, though, and even though it is very nice to think about, breaks down in practice quite fast, and you have to look for many different smaller things to glue together. In the end, you know exactly what you have built, though, and also know how to extend it.

On the other hand, there are frameworks like Rails (or Rocket probably) that give you an opinionated collection of things that you will probably need. And when looking for something, you often find that the framework already contains it, and can maybe even guess the name. "Guessing names" is how I learnt to use Rails, basically.

I'm not saying I like one or the other better, so far these are just observations. I have some ideas why composing small modules is more popular in a language like Clojure compared to Ruby, but nothing definite. And I have not yet made up my mind about what will work better for Rust.

Owner

killercup commented Dec 28, 2016

Thanks for your reply! I think I first used express.js when 3.0 was just released, but I can't really remember how I got familiar with it. Probably some tutorial someone with half a week more experience than me wrote :)

I'm the kind of person who likes technologies that build huge ecosystems on a few, simple concepts, like middlewares. And I've always admired projects that feel like that, given a set of useful concepts, they are the "obvious" implementations. That's all very theoretical, though, and even though it is very nice to think about, breaks down in practice quite fast, and you have to look for many different smaller things to glue together. In the end, you know exactly what you have built, though, and also know how to extend it.

On the other hand, there are frameworks like Rails (or Rocket probably) that give you an opinionated collection of things that you will probably need. And when looking for something, you often find that the framework already contains it, and can maybe even guess the name. "Guessing names" is how I learnt to use Rails, basically.

I'm not saying I like one or the other better, so far these are just observations. I have some ideas why composing small modules is more popular in a language like Clojure compared to Ruby, but nothing definite. And I have not yet made up my mind about what will work better for Rust.

@fasiha

This comment has been minimized.

Show comment
Hide comment
@fasiha

fasiha Dec 28, 2016

My favorite part of your essay is—

Most people are quite clever, know what they want, and see that it’s quite likely that all parts are already there. But it’s still hard to find this in the API documentation, because the library is very generic and it’s not always obvious how things work together.

I’ve been working through some programming challenges (Cryptopals) in Haskell and Rust as a total beginner in both, and this describes my experience with Haskell (and other Powerful Languages) so well 🤣. This (and the overall essay) resonated with my Rust experience because, after moving along quickly and solving the challenges with Rust, I had to figure out rust-openssl, and was dead in the water until I found one complete code example, in the issues tracker, from 2014 and figured out how all the pieces go together. I hadn’t realized it till then how useful the examples in the Rust book and throughout the Rust docs were.

fasiha commented Dec 28, 2016

My favorite part of your essay is—

Most people are quite clever, know what they want, and see that it’s quite likely that all parts are already there. But it’s still hard to find this in the API documentation, because the library is very generic and it’s not always obvious how things work together.

I’ve been working through some programming challenges (Cryptopals) in Haskell and Rust as a total beginner in both, and this describes my experience with Haskell (and other Powerful Languages) so well 🤣. This (and the overall essay) resonated with my Rust experience because, after moving along quickly and solving the challenges with Rust, I had to figure out rust-openssl, and was dead in the water until I found one complete code example, in the issues tracker, from 2014 and figured out how all the pieces go together. I hadn’t realized it till then how useful the examples in the Rust book and throughout the Rust docs were.

@fasiha fasiha closed this Dec 28, 2016

@killercup

This comment has been minimized.

Show comment
Hide comment
@killercup

killercup Dec 28, 2016

Owner

I hadn’t realized it till then how useful the examples in the Rust book and throughout the Rust docs were.

Exactly! When I was writing this post, this—the immense usefulness of examples—is what really surprised me. I'm really looking forward to seeing how we can make it more common throughout the Rust ecosystem to litter docs with examples!

This is one of the reasons I write these things down, by the way: To get the thoughts I have on a topic in order, and actually think it through (up to a point). And I'm quite often surprised about what conclusion I arrive at. (I think I read it first in an essay by Paul Graham that good essays are texts where, while writing them, you don't know where they'll take you. Edit: It was this one.)

I'll update the post to link to this issue.

Owner

killercup commented Dec 28, 2016

I hadn’t realized it till then how useful the examples in the Rust book and throughout the Rust docs were.

Exactly! When I was writing this post, this—the immense usefulness of examples—is what really surprised me. I'm really looking forward to seeing how we can make it more common throughout the Rust ecosystem to litter docs with examples!

This is one of the reasons I write these things down, by the way: To get the thoughts I have on a topic in order, and actually think it through (up to a point). And I'm quite often surprised about what conclusion I arrive at. (I think I read it first in an essay by Paul Graham that good essays are texts where, while writing them, you don't know where they'll take you. Edit: It was this one.)

I'll update the post to link to this issue.

killercup added a commit that referenced this issue Dec 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment