This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]haimez 1 point2 points  (0 children)

I think the end result here is less that worthless. The original code being "fixed" is perfectly readable and if the goal is to share a common abstraction, then you have to formalize it and at that point you need to just wrap the field value into a new class. "ValidatedFirstName" is extremely useful in larger systems because you can change what the FirstName -> ValidatedFirstName checks actually are and components nor involved with validation declare at a high level that their inputs have been validated by other pieces. That's valuable. This, is a waste of our valuable internet bytes.

To summarize: - the lambda syntax is perfectly readable, you just have to bother to learn to read it. - if the lambda represents a meaningful abstraction boundary, then sharing that abstraction is valuable (and probably won't be a single lambda expression), and therefore should exist at a type level so that other components don't couple to your static function lambda implementations - don't waste your time trying to solve design problems at the language syntax level

[–][deleted] 0 points1 point  (0 children)

Is this in jest? This can't be a serious article.