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

Event Manager Re-Write #326

Open
burtlo opened this issue Nov 12, 2012 · 7 comments
Open

Event Manager Re-Write #326

burtlo opened this issue Nov 12, 2012 · 7 comments

Comments

@burtlo
Copy link
Contributor

burtlo commented Nov 12, 2012

I sat down to re-create the event manager tutorial awhile back thinking about how I would build it and I came up with a different solution. Before I actually write the accompanying text to support the tutorial I would like to talk the changes that I am proposing.

https://github.com/JumpstartLab/event_manager_tutorial/commits/master

  • Uses a more functional approach at the outset

The current tutorial has you generate a class and class structure way before I believe it is necessary.

  • Has a short version of the attendees file

I distilled down some of the important rows of the attendees file into a smaller file. This makes it easier to view the output when you run the application. It does not make thousands of queries to the sunlight API.

  • Starts with parsing the CSV file with File operations and looping.

Previously the tutorial goes right to the CSV library. I felt it was important to show them how to use File first. The tutorials uses the CSV library when starting to deal with the difficulties of the header row, the column names etc.

  • Parsing and Cleaning Zipcodes

The first task for the student is to parse and clean phone numbers. However, nothing is done with the phone numbers. Jeff had suggested that he would like for the tutorial to get to the fun parts (e.g. Using an external service like Sunlight) sooner and so in this version the phone number parsing has been removed.

The zipcode problem is interesting enough and most importantly gets you good data which you can use immediately with the Sunlight API.

  • Using the sunlight API

Steps through the building and collecting specific legislators information to populate in a form letter.

  • Uses ERB instead of custom template solution

The tutorial previously used a custom template solution. I felt it was clear and effective. I thought that it would be a good idea to introduce students to ERB.

When I finished writing this section I realized that ERB uses binding and that might be large of concept to explain at this stage. So I am torn.

I like the idea of using ERB, because it sets the student up for familiarity with ERB later when working with Rails.

I dislike the idea because of having to work with bindings.

  • Ends with Joyful Refactoring.

At the end, as opposed to various parts in the middle, some refactoring is done to create common objects (e.g. EventManager, Zipcode) and separated into individual files.

@steveklabnik
Copy link
Contributor

Uses a more functional approach at the outset

👍

Has a short version of the attendees file

👍

Starts with parsing the CSV file with File operations and looping.

Seems okay, I guess. I'm torn; people should almost never be writing their own parsing stuff, so I like giving them the idea that they should go straight to the library.

Parsing and Cleaning Zipcodes

👍, though I'll miss the refactoring fun of phone numbers.

Using the sunlight API

👍

Uses ERB instead of custom template solution

👍, and it comes with Ruby.

When I finished writing this section I realized that ERB uses binding and that might be large of concept to explain at this stage. So I am torn.

I don't think bindings are a big deal. "We need some sort of context to evaluate options when it's being generated," done. We gloss over lots of things, I don't think one more is a big deal.

I like the idea of using ERB, because it sets the student up for familiarity with ERB later when working with Rails.

Exactly. I've been wondering if maybe gasp we should make our Rails projects stick to Rails defaults, like ERB and minitest.

Ends with Joyful Refactoring.

I haven't read this part yet, but I really think that stressing refactoring as you go is a good idea.

@burtlo
Copy link
Contributor Author

burtlo commented Nov 13, 2012

The tutorial does some refactoring throughout. Like creating a method for zipcode cleaning, refining the way zipcodes are processed, etc.

It just adds a bonus full refactoring to classes for more of the sub-components and moving classes into separate files.

@jcasimir
Copy link
Contributor

I like your thinking.

@jjwanat
Copy link

jjwanat commented Dec 1, 2012

Hey guys, I hope it is okay to jump in. I am a Ruby newbie that just started this tutorial. I've hit a wall and thought I would check it out on GitHub.

I've been trying to refactor "clean_number" into its own method for about 30 minutes now. I'm guessing it's because I'm a complete newbie and missing something very simple, but that is also why I would like to help make it easier for beginners like myself. Personally, I enjoy the refactoring until it gives me problems. =)

Please let me know what, if anything, I can do to help. Also, if someone could help me out with my current bug, I'd greatly appreciate it and would love you forever. Thanks!

@steveklabnik
Copy link
Contributor

Hey @Drekonus ! How about this: send me an email, and we'll work through it. Then, if there's a way we can make the tutorial better, we can bring the discussion back here. What do you think? [email protected]

Just show me where you're at so far. :) gist.github.com is useful to share code through emails.

@jcasimir
Copy link
Contributor

@burtlo This sounds cool, but could it be ready when we need it on 1/29?

@steveklabnik
Copy link
Contributor

Is this going to happen?

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

No branches or pull requests

4 participants