Array evaluating to nil

Was it an issue of low-quality/someone-just-doesn't-know-Ruby?

(I was one of the post answerers, I'm aware of the post's content--I'm asking about this post specifically, not reasons-in-general, so to see it I guess you need some amount of SO rep.)

  • 6
    I don't see anything seriously wrong with the question other than it's a bit "noobish" (but that shouldn't stop someone from getting help). – vcsjones Jun 7 '12 at 17:30
  • Very strange. Maybe it was incomplete initially, got closed/flagged and then a mod came around and removed it without seeing that it was updated? – Tudor Jun 7 '12 at 17:47
  • @Tudor Possible, although it was deleted less than an hour ago, and AFAICT hadn't been edited since yesterday. I'm just curious what happened is all. – Dave Newton Jun 7 '12 at 17:48
  • 1
    Looking at the question now (thanks Arjan), I can't say that it was a low quality question. I've since removed my answer - I'm really not sure why it would be deleted. – Makoto Jun 7 '12 at 17:49

The poster flagged it and asked for it to be deleted. casperOne obliged.

  • 2
    Ah. That seems somewhat counter to what I'd expect from SO, though, deliberately removing information like that. I know SO isn't javaranch/coderanch, but they had a specific policy of not removing valid, informational content--ultimately that makes more sense to me. Thanks for the info, though :) – Dave Newton Jun 7 '12 at 17:52
  • 3
    @DaveNewton It looks to me like the OP just had a minor issue with misplacing a line in their code, so it's unlikely that this question would be particularly helpful to someone else. That's just my best guess, though. – Adam Lear Jun 7 '12 at 17:55
  • Hmmm, intriguing indeed. Should we ask for some tools using which moderators can detach a user from a post instead? – Arjan Jun 7 '12 at 17:56
  • @Arjan That's an employee-only tool at the moment. If someone wants to disassociate their post from their account, we can certainly do that. – Adam Lear Jun 7 '12 at 17:57
  • Yep, I know you can ask the developers/employees, but they need to focus on next year's IPv6 day ;-) Though you're saying the post was probably not useful for future readers, and though the 70k+ Michael and 42k+ @Dave won't miss the upvotes, it still feels odd someone can just flag for removal, while I assume the self-deletion-protection was working. – Arjan Jun 7 '12 at 18:01
  • @AnnaLear Definitely possible, although not understanding the nature of Ruby instance vars and how/where they're declared is definitely a Real Thing, e.g., in Java, declaring an instance var would go outside of instance methods. – Dave Newton Jun 7 '12 at 18:03
  • 1
    @DaveNewton Just to verify, the question is too localized. The OP asked to have the question deleted, and given that too localized questions rarely have the ability to be formed so that they're not too localized, I removed it so as not to be an eyesore on the site (except for 10K users when they choose to look at it). For future reference, I've added the close notice to the question, which I should have done in the first place. – casperOne Jun 7 '12 at 18:06
  • @casperOne Okay, thanks for the info. Not that it matters, but for the Java/Ruby instance variable convention, I guess I have to ultimately disagree... but I'm a disagreeable sort. – Dave Newton Jun 7 '12 at 18:12
  • @DaveNewton Well, ruby-on-rails isn't my domain specialty, so it's completely possible that this could be a very valuable piece of information for the community, and not something that's too localized. We're not infallible, and we certainly are open to reversing our positions when we're shown the value of good content. If you can show us that, then we'd be more than happy to undelete and open it back up. – casperOne Jun 7 '12 at 18:14
  • 1
    @casperOne Not sure how/where to show you that :) It's just that in Java, instance vars are declared completely separately from methods. In Ruby, instance vars are "declared" using either the attr_accessor method (public vars) or just initialized inside instance methods. If you went from Java -> Ruby and didn't know about the accessor generator methods you might just drop an instance var init in the class def and wonder why it didn't work. In addition, the comment trail in my answer discusses how/when instance vars are used when they're in methods like that. – Dave Newton Jun 7 '12 at 18:18
  • @DaveNewton Can you bring some of that information up out of the comment trail, as well as into the question to make it a better pair all around? I think that if you do that, then we'd be more than happy to open it up, because it generalizes it for more people (the question would have something like "I did this, and expected this, because of this" while the answer would have the rest that's elaborated on in the comments). – casperOne Jun 7 '12 at 18:21
  • @casperOne Yep; I'll try to edit it up in a bit and ping you here. Thanks for the info/time from you and Anna. – Dave Newton Jun 7 '12 at 18:22
  • I'm not seeing why this should have been deleted. The OP's mistake seems like one worth keeping open. – user7116 Jun 7 '12 at 19:22
  • @casperOne I've edited my answer to include the original information plus merged in information from my comment responses--let me know what you think. Thanks again :) – Dave Newton Jun 7 '12 at 20:32
  • @DaveNewton I like it, and I learned a little about ruby-on-rails in the process. Undeleted and opened. Thanks for helping! – casperOne Jun 7 '12 at 20:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .