News for hackers. Stuff that matters.
Re:Your Code is My Hell by Pewpewarrows on Monday August 22, 2011 @12:57PM (#2913116)

    "Dividing methods into private and public is for control freaks, you don’t need it in Ruby"
Coming from a Python dev's perspective, does Ruby have the concept of public/private? Python just has the underscore and double underscore conventions: if you absolutely have to you can use the "private" variables and methods, but in doing so you still understand that it might change without notice in future versions. "We're all adults here" is the the motto, if I recall.
Re:Your Code is My Hell by avdi on Monday August 22, 2011 @01:08PM (#2913160)
Ruby has a public/private divide which can easily be circumvented. But the circumvention is a bit ugly, which is a good thing - it makes the circumvention obvious in the code.

Personally, I think Ruby hits a sweet spot here: the privacy curtain is strong enough that Ruby WILL let you know when you've stepped off the path of using methods which are part of the stable API. But you can then tell Ruby "yes, I understand, and I know what I'm doing".

Re:Your Code is My Hell by route66 on Monday August 22, 2011 @01:16PM (#2913192)
Strictly speaking ruby, private only forbids calling the method in question with an explicit receiver.

object_instance.private_method is obviously prohibited, but so is self.private_method when called from another class method. The latter one is fine when private_method is called, without the self. To circumvent privateness in the other case ("calling an underscored method") you would have to say object_instance.send(:private_method).

Re:Your Code is My Hell by petercooper on Monday August 22, 2011 @03:56PM (#2913862)
Luckily there's also protected, which allows you to call with an explicit receiver, but only from an instance of the same class (or within its hierarchy).
Re:Your Code is My Hell by gabebw on Monday August 22, 2011 @01:00PM (#2913131)
Yes, Ruby has private methods:

    def i_am_public
       ...
    end

    def i_am_private
       ...
    end
    private :i_am_private

    private

    def i_am_also_private
       ...
    end