Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add expressworks project #14

Closed
wants to merge 1 commit into from
Closed

Conversation

azat-co
Copy link
Contributor

@azat-co azat-co commented Oct 26, 2013

ExpressWorks is an automated Express.js workshop based on workshopper and inspired by stream-adventure by @substack and @maxogden.

Learn the basics of the Express.js framework. Build servers that accept GET, POST, and PUT requests; parse data from URL, query string and payload.

https://npmjs.org/package/expressworks
https://github.com/azat-co/expressworks

@rvagg
Copy link
Contributor

rvagg commented Nov 2, 2013

Needs comment from other nodeschool maintainers before this can be merged by for my part:

This is a great addition, Express has become the web framework of choice (even though it's not my personal choice!). I haven't personally given the workshop a go but the feedback I've had from people that did give it a go for me was that it jumped a bit too quickly from basic to advanced without covering some of the more important concepts for building Express apps. I obviously can't say how valid this criticism is but the workshop does look pretty short and simple so far, I wonder if it needs a little more time in the oven to flesh out the important concepts?

Also, do you have any other Express users or experts that you might be able to rope in to help flesh this out any more? I've personally found it vital to have help from outsiders to figure out a good flow of exercises because it's too easy to become blinkered while you're in the guts of building it. learnyounode and levelmeup were both built with a ton of outside help and critique (and this is ongoing too obviously).

Perhaps if you'd like contributors we could put out the call for you or perhaps even ask TJ to tweet a call for helpers?

@azat-co
Copy link
Contributor Author

azat-co commented Nov 3, 2013

@rvagg Yes, I would love to have more contributors. I plan to integrate some of the @timoxley examples later (azat-co/expressworks#2) and iterate on bugs. The feedback from JavaScript Weekly (http://javascriptweekly.com/archive/154.html) and Node Weekly (http://nodeweekly.com/archive/9.html) has been nothing but good so far.

The goal of this merge is to get people started with Express.js, because nodeschool has only links to NPM. The future versions can be updated independently.

@rvagg
Copy link
Contributor

rvagg commented Nov 6, 2013

@brianloveswords & @maxogden can you make a final call on this please? I think I'm cool with this as long as @azat-co remains open to contributions to flesh this out further, having more attention will certainly help with that!

@timoxley
Copy link
Contributor

timoxley commented Nov 6, 2013

TBH I'm not sure if "framework tutorials" really belong in nodeschool (in my opinion). Should probably focus on core tech rather than specific frameworks.

@timoxley
Copy link
Contributor

timoxley commented Nov 6, 2013

Hm… levelup/leveldb is a specific framework, but… it doesn't occlude core node apis. While convenient, express's heavy abstraction does help people avoid learning anything about what node is actually useful for outside of being a lightweight alternative for a rails/sinatra/django api. It might be different story if there was already a workshop focussed on node's built-in http/tcp/udp apis.

@max-mapper
Copy link
Contributor

Sorry for the late response here. I agree with the last couple of points by @timoxley, and also by the points made by @rvagg.

From reading through the challenges, it looks to me like only the jade and stylus ones are express specific. The rest of them seem like open ended problems that can be solved with express builtins but could also be solved with stuff in core or modules from NPM.

An example might be the the json_me challenge. Here's a solution using require('http') that still passes:

var http = require('http')
var fs = require('fs')

var filename = process.argv[3]
var buff = fs.readFileSync(filename)
var data = JSON.parse(buff)
var dataString = JSON.stringify(data, null, '  ')

http.createServer(handler).listen(process.argv[2])

function handler(req, res) { 
  if (req.url.match(/^\/books/)) {
    res.writeHead(200, { 'Content-Type': 'application/json' })
    res.end(dataString)
    return
  }
  response.writeHead(404)
  res.end()
}

Here's the reference solution.

@azat-co how do you feel about making it more like ServerWorks or APIWorks or something more open ended, meaning express specific hints and instructions could stay in there but it could also be solved with non-express specific solutions?

@timoxley
Copy link
Contributor

timoxley commented Nov 6, 2013

ServerWorks or APIWorks or something more open ended

👍

@rvagg
Copy link
Contributor

rvagg commented Nov 12, 2013

@brianloveswords what's your take on this?

@brianloveswords
Copy link
Contributor

Ahh sorry I missed this thread! Thanks for pinging me @rvagg.

I'm a little torn, but I think I'm okay with adding it – I think express makes some questionable design decisions but it's often the first app/server abstraction people use and if we can use it as a gateway to better things, we should do that.

I would definitely like to see ServerWorks or APIWorks, though – something that teaches people the fundamentals without the express magic. Maybe that can be created as complementary material to this?

In any case, as @rvagg said, I'm okay with merging this as long as @azat-co remains open to contributions.

@brianloveswords
Copy link
Contributor

Also, I'll try to make some time this week to go through the workshopper and provide some feedback!

@azat-co
Copy link
Contributor Author

azat-co commented Nov 13, 2013

@maxogden @rvagg @brianloveswords @timoxley Yes, I agree that it possible to solve the steps without using Express.js. It also makes sense to combine ExpressWork into ApiWorks/ServerWorks using @timoxley's examples (status 200, status 500, etc.). Or to have both, Express and a separate ServerWorks/ApiWorks as an intermediate class/workshop before ExpressWorks?

I'm okay with maintaing ExpressWorks as-is (and improving it). I'm also okay with not merging ExpressWorks, and later rebranding/refactoring it into ApiWorks with a different text for tutorials, etc. (time permitting).

Another (quite different) approach is to separate framework specific workshops into NodeUniversity.io and make it a logical continuation of NodeSchool.io. I expect there will more of those in the future.

IMHO, Express.js is ubiquitous to have it in the core and not everybody is interested (unlike us) in the minute details. Most people just prefer to jump straight to templates, routes... I'm no saying it's the best way, just what I've observed.

@Raynos
Copy link

Raynos commented Nov 24, 2013

I've been thinking of doing a web server workshop myself. The biggest stumbling block is that I don't want people to learn with express (there are some issues I have with express that are out of scope) but I don't want them to do things by hand either.

Ideally they would figure out how to find modules to use and do it with those modules. That leads into a second problem, having noticed other workshops that depend on npm modules it makes it a bit difficult because either they are hard to find or you are telling your learners to use a specific module that might be a bit wonky. I wouldn't want to tell users to use my modules because that forces too much opinion / bias.

This leads me to think that we are hitting into a bigger problem of the node community isn't doing a good job of documenting and showing by example how to do web servers with just require("http") and modules.

To address that I started working on http-framework which is mostly a set of examples and documentation about how to approach the problem of web apps with just require("http").

If I were to author a ServerWorks workshop I would give people the choice to author their answers as they want however I would reference http-framework documentation & examples to make it easier to figure out some of the harder stuff without having to read the node docs. This will be effective if I keep my http-framework documentation in it's current style which is "how to use the function and how to do it by hand".

I'm not sure how I want to show the answers. Either they would be hand written or depend on http-framework. It does raise a difficult question, for example a hand written sessions answer is just going to be painful where as using generic-session keeps the answer clean and understandable.

@Raynos
Copy link

Raynos commented Nov 24, 2013

This also introduces a new idea.

There might be value in having ServerWorks / APIWorks that has a set of common problems but allows you to pick your framework like http / express / hapi.

Then we pick one champion for each framework and he writes problem specific hints and problem specific answers. That way we are opinion neutral and we have a set of common challenges people can do to compare web frameworks

@max-mapper
Copy link
Contributor

I am pretty sure that @hueniverse was working on a hapi adventure? (Could be wrong). His opinion would be nice to have here.

Also, quoting @azat-co from above:

IMHO, Express.js is ubiquitous to have it in the core and not everybody is interested (unlike us) in the minute details. Most people just prefer to jump straight to templates, routes... I'm no saying it's the best way, just what I've observed.

At the recent nodeschool IRL events I've noticed that its pretty difficult to introduce people to node, npm, the core modules, and in some cases the command line and javascript, all while being able to answer their questions that come up. I don't have anything against express, but rather the concept of teaching frameworks to beginners in general, because it's a lot easier to get into a rabbit hole with a framework.

Maybe we could accept all workshops to nodeschool but have a 'fundamentals' area and then a 'framework' area? I just don't want to set the expectation that node === a thing for serving websites, even though that is a popular perception of node.

I'm totally okay position it as: "learn the basics of node, and then move on to more specific topic areas". This would mean that the levelmeup workshop should move into the 'frameworks' area, whereas ServerWorks, LearnYouNode and StreamAdventure would be 'fundamentals'. I'm not sure where FunctionalJavaScript belongs.

@azat-co
Copy link
Contributor Author

azat-co commented Nov 24, 2013

@maxogden I like this approach. I think it totally makes sense and is a good layout for future assuming there will be more framework/module based classes, e.g., nodeuniversity.

@azat-co
Copy link
Contributor Author

azat-co commented Nov 24, 2013

@Raynos the idea of a low-level and moduless class is good, would you like to collaborate with your examples for ServerWorks/ApiWorks?

@brianloveswords
Copy link
Contributor

+1 on fundamentals and frameworks separation.

@max-mapper
Copy link
Contributor

or we could call it fundamentals and electives :D

On Sat, Nov 23, 2013 at 8:03 PM, Brian J Brennan
notifications@github.comwrote:

+1 on fundamentals and frameworks separation.


Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-29148451
.

@Raynos
Copy link

Raynos commented Nov 24, 2013

@azat-co would love to collaborate. Still got some work to do to flesh out the breadth of http-framework itself.

@hueniverse
Copy link

My views on this are simple. I don't think it is reasonable to build applications of any meaningful scale without a framework, and the choice of framework has to fit the team, the requirements, and the culture.

That said, I am constantly frustrated by people introduced to node via Express. Their understanding of how node works and where node ends and Express begins is very limited. Many of them thing that req.body is part of node core (and we had to deal with issues where people complained that it is missing as a bug).

I don't want to see Express or Hapi featured as lessons for beginners. I want people to have the tools to actual look at how the various frameworks operate and make an educated choice, one based on technical abilities.

@timoxley
Copy link
Contributor

@maxogden functional-javascript-workshop probably belongs alongside an introductory js workshop, if/when that pops up.

@rvagg
Copy link
Contributor

rvagg commented Nov 24, 2013

Agree on functional-javascript belonging in a fundamentals section.

Also FYI I've trying to find time to work on a new "intro to JavaScript" workshop I've started while also working on the new exercises for API workshopper. The aim is to have it ready for campjs at the latest. Probably also for JSFest. Seems that a lot of people are coming to these workshops without the basics in place.

@azat-co
Copy link
Contributor Author

azat-co commented Nov 28, 2013

So what is the decision? Create a new section?

@ghost
Copy link

ghost commented Dec 1, 2013

Somebody has written a useful adventure, so I'm +1 on merging this, whatever I might think of express. I think the right answer to addressing the express vs http.createServer vs hapi vs whatever problem is to write more adventures and to put them all up on nodeschool.io! We can later organize things more into sub-categories once we have more adventures but right now there aren't enough adventures up for that to be a big problem.

@ghost
Copy link

ghost commented Dec 1, 2013

merged!

@ghost ghost closed this Dec 1, 2013
@rvagg
Copy link
Contributor

rvagg commented Dec 2, 2013

yay for action! thanks @substack

@azat-co
Copy link
Contributor Author

azat-co commented Dec 2, 2013

👍

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants