Not an expert here, but "division of resonsibilities". I'd say *too
many* private methods is smelly. A helper class could serve the main
class, making both easier to understand. Especially if you have a few
distinct groups of private methods: separate helper classes group them
nicely, share instance variables appropriately, etc.
It probably shouldn't mean *more* code, but better organised code.
Gavin
On 26/04/2010, at 7:29 AM, liam <liam.mclen...@gmail.com> wrote:
Who considers private methods to be a code smell? That seems
rediculous to me. I'd love to know what the argument is.
On Apr 25, 11:01 am, Andrew Grimm <andrew.j.gr...@gmail.com> wrote:
I suspect the ability to call private methods is something that'd be
very hard to change in ruby. I can't see how you could change that
without forbidding open classes, which would mean an end to duck
punching (though to be honest I don't punch ducks much myself)
One minor glitch that annoys me is that you can't declare a method
private in the method definition itself. You can't do something like
private def change_balance(amount)
...
end
instead, you have to do
def change_balance(amount)
...
end
private_method :change_balance
which isn't very DRY to me.
For what it's worth, some people regard private methods as a code
smell - something that ought to be refactored out into another
object.
Andrew
On Sun, Apr 25, 2010 at 10:30 AM, liam <liam.mclen...@gmail.com>
wrote:
I don't know ruby very well so my likes / dislikes are evolving, but
the moment the things I don't like are:
Ruby has complicated and overloaded anonymous method syntax:
- do ... end, proc.new, lambda, & parameter syntax, blocks are
method
parameters but not exactly
Compare this to the javascript equivalent: function() {}
Linking scripts is a pain with require, load, require_relative.
The ability to call private methods.
On Apr 24, 9:24 pm, Andrew Grimm <andrew.j.gr...@gmail.com> wrote:
Opposite of the previous question. Unlike the previous, it should
be
able to fit in 140 characters or less.
For me:
* ruby (MRI and YARV) is an imperfect implementation of ruby (the
language).
* ruby's appeal isn't small, just selective, ala Spinal Tap.
Andrew
--
You received this message because you are subscribed to the
Google Groups "Ruby or Rails Oceania" group.
To post to this group, send email to rails-
ocea...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com
.
For more options, visit this group athttp://groups.google.com/
group/rails-oceania?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Ruby or Rails Oceania" group.
To post to this group, send email to rails-ocea...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com
.
For more options, visit this group athttp://groups.google.com/
group/rails-oceania?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Ruby or Rails Oceania" group.
To post to this group, send email to rails-ocea...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com
.
For more options, visit this group athttp://groups.google.com/group/
rails-oceania?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Ruby or Rails Oceania" group.
To post to this group, send email to rails-ocea...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Ruby or
Rails Oceania" group.
To post to this group, send email to rails-ocea...@googlegroups.com.
To unsubscribe from this group, send email to
rails-oceania+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.