When to use blocks

前端 未结 3 694
春和景丽
春和景丽 2021-01-31 04:45

I love Ruby blocks! The idea behind them is just very very neat and convenient.

I have just looked back over my code from the past week or so, which is

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 05:18

    This is what functional programming people call "continuation-passing style". It's a valid technique, though there are cases where it will tend to complicate things more than it's worth. It might be worth to relook some of the places where you're using it and see if that's the case in your code. But there's nothing inherently wrong with it.

提交回复
热议问题