5 ms·
One of the things I'm really liking about ruby during my python to ruby conversion is that it handles the visitor pattern for me. Half the Java code I ever wro
by dnaquin 17y ago
One of the things I'm really liking about ruby during my python to ruby conversion is that it handles the visitor pattern for me.
Half the Java code I ever wrote was probably visitor pattern cruft. Ruby largely just handles it all for me.
- blasdel 17y agoWhat are you doing in ruby that you weren't in python?
- dnaquin 17y agoI can write methods that take blocks. Sure I can do the same thing in python, but I either have to write a lambda that limits me to a single line or write a one-off named method. The latter being much less clear than do ... end.
- swolchok 17y ago"visit_foo" as a nested function definition, immediately before it's used in a function call, is not particularly unclear.