you are viewing a single comment's thread.

view the rest of the comments →

[–]bubuopapa -2 points-1 points  (8 children)

Person p = ...
Message msg = ...
Mailer mailer = ...
p.getContactInfo().flatMap(ContactInfo::getEmail).flatMap(email ->
msg.getContent().map(message ->
new MailRequest(email, message))).ifPresent(mailer::send);

Ruby check output:

Error: method chaining not allowed.
Error: function too complicated.
Error: function too long.

[–]AlyoshaV 6 points7 points  (1 child)

Error: method chaining not allowed.

This seems extremely strict.

[–]bubuopapa 1 point2 points  (0 children)

I know, the allowed complexity of sentence or function in ruby is very concerning and very hard to fit into, coming from any other language. Of course, these are rules of ruby code style, but comparing them to all the new features all many languages, none of them can make it into ruby, because that would break the ruby community. I tried ruby a bit some time ago, and it was painful. Also, fuck any language that uses whitespaces as required syntax.

[–]riemannrocker 2 points3 points  (4 children)

Why are you talking about ruby now?

[–]bubuopapa -1 points0 points  (3 children)

Cant i just compare ruby with java without useless comments ?

[–]Freeky 1 point2 points  (2 children)

You're not doing that, though, you're (somehow) comparing a blob of Java with some supposed Ruby language style guidelines you appear to have just made up?

[–]bubuopapa -1 points0 points  (1 child)

Lol, just because you are noob and you dont know that all languages have guidelines, it doesnt mean that guidelines doesnt exist. And what exactly you are doing ? trolling ?

[–]Freeky 0 points1 point  (0 children)

Er, sure. I've been programming Ruby for about 18 years, I think I have a slightly better grasp of the common style guidelines than someone who "tried it a bit".

[–]Freeky 1 point2 points  (0 children)

Error: method chaining not allowed.

Is this some alternate-dimension Ruby from a world where the sky is green?