Rate my Refactor

Advice and discussion about code design and refactoring, crowd-sourced from a community of experts in your field

lib/foo_bar.rb
  • def FooBar
  • bazes = []
  • Bar.each do |b|
  • b.baz << b
  • end
  • end
  • def FooBar
  • Bar.collect do |b|
  • Using collect here is a great idea.
  • b.baz << b
  • end
  • end
docs.md
  • Removing this line breaks everything DONT DO IT. UNIX is the answer, but only if you phrase the question very carefully.
  • There are 3 kinds of people: those who can count and those who can't.
  • Removing this line breaks everything DONT DO IT. UNIX is the answer, but only if you phrase the question very carefully.
  • There are 2 kinds of people: those who can count and those who can't.
  • I'm pretty sure this was a joke. Unless I'm one of the kinds of people who can't count?!

Hey Everyone,

I thought the bazes array might have been unnecessary. What do you think?

Also I think there was some incorrect math in the docs. But counting can be hard...

I never thought to do that before. Thanks for sharing - I'll try this in my next project!
Reminds me of that Sandi Metz book. What's it called? POOGERS or something?
See my note about collect, I think it's perfectly cromulent.
Final UI pending :)
Questioning a design decision?
Looking for some input on a tough problem?
Want to talk about your application of a slick design pattern?

Get outside your own head and get some extra eyeballs on your work.

Early Access!

We're working hard to get a beta launched so that you can start improving your code with community feedback (and we can start getting user feedback and tuning our app!)

Sign up for email updates and you'll be the first to get an invite when we go live.

Q:Isn't this just StackOverflow?

A:No! Every discussion centers around a set of diffs that you want to present and participants comment and suggest changes directly in the code. Like GitHub pull request comments just for your topic.

Q:So then it's GitHub...?

A:No again. Well maybe a bit - as in, we'll likely be using GitHub's already fantastic APIs for diffs and comments. But the purpose and spirit of our project is very different.

Q:Why should I use this?

A:Maybe you're working solo on a side project and could benefit from input from others knowledgeable in your tech stack. Maybe you're a freelancer without a traditional office environment and you want to kick an idea around with some "temporary virtual coworkers". Maybe you can find great reasons we haven't thought of!

Q:When is this going to be ready?

A:We're glad you're eager! That probably depends on how much potential users care. The best way to ensure this sees a launch sooner rather than later is to sign up for our mailing list. To answer you: Probably sometime in mid-to-late-2018.