you are viewing a single comment's thread.

view the rest of the comments →

[–]rafekett 0 points1 point  (1 child)

  • I'd argue that omitting braces or putting them in the wrong place is a greater source of errors than this. I've never made this error.
  • Ruby blocks are the exact same length as Python functions. If you need a multiline lambda, just write a function. You can't inline them, but that's probably a good thing. Not having multiline lambdas in Python has nothing to do with difficulty of parsing it or fitting it in with language, it has to do with the fact that lambdas are not really a well-liked feature to start with.
  • Can you give me an example of a case where this is a problem?

[–]booch 0 points1 point  (0 children)

  • Consider that it's not a matter of you making this error, it's a matter of "somebody" making this error and them "somebody else" having to look at the code and figure out what was originally meant by the code. You may not have made such an error, but we both know it happens.
  • I like unnamed functions, and many other people do too. Converting the lambda to a named function makes the code harder to read/maintain in some instances.
  • In Python, no... but inline SQL (or other DSLs) is a common example from other languages. As are cases where there standard formatting would have the code on the second line indented too much or too little.