Hacker News new | ask | show | jobs
by mtomassoli 5169 days ago
I think that "readability" also depends on what you're used to reading and writing. To me, my code blocks are quite readable, but that's only true because I've seen a lot of them in these last two weeks.

Code blocks let you write

  with myfunc(iter) << 'x, y':
    code which uses x and y
instead of

  def some_func_name(x, y):
    code which uses x and y
  myfunc(iter, some_func_name)
If you prefer the second form, then you don't need code blocks. I think the first form is much better. It's not just a matter of saving one single line: you don't have to define a function which you'll never use again, so the first code is actually more readable.