I believe one of the important things to keep in mind when using lambdas and streams is to keep it readable. This can be done by explicitly declaring functions, filters, etc. or to use method references instead of nesting the code in complex statements.
By putting the code into methods, for example, anyone reading the code can start at the easily understandable "top layer", getting the big picture view. With well named methods, they then can check how exactly does, for example, this::replacePlaceholders do its job - but for the big picture, it's just important to know "Ah, and now he's somehow replacing the placeholders".
Unless the statement is very easy, I tend to refactor it into a method reference most of the time (since defining functions in the method itself also makes the method bigger and more complex).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I believe one of the important things to keep in mind when using lambdas and streams is to keep it readable. This can be done by explicitly declaring functions, filters, etc. or to use method references instead of nesting the code in complex statements.
By putting the code into methods, for example, anyone reading the code can start at the easily understandable "top layer", getting the big picture view. With well named methods, they then can check how exactly does, for example, this::replacePlaceholders do its job - but for the big picture, it's just important to know "Ah, and now he's somehow replacing the placeholders".
Unless the statement is very easy, I tend to refactor it into a method reference most of the time (since defining functions in the method itself also makes the method bigger and more complex).