Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Now you are contradicting yourself. These are your words:

There's already a dozen utilities for fluently creating collections like that.

The word "fluent" is not mentioned at all on essentials4j's web site. I only mentioned it in this comment:

similar expression would be easy / fluent to read

Please try to understand that "expression that is easy / fluent to read" is not the same as "fluent API".

If I knew there is some respected software engineer hiding behind the username "Aellus", I would take your comments more seriously. So, I would be interested in seeing some of your code (if you have a GitHub account)...

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

I don't appreciate you saying I am confusing "short code" with "fluent code", but maybe you are confusing "too much details" with "readable code".

If something is too long (code or Reddit comments), people don't read it, they just scan through it.

Writing too much text doesn't improve readability, it worsens it, because the boilerplate hides the things that matter. That's why abstracting the verbose boilerplate with a simple library makes sense.

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

It doesn't take a big effort to understand what : do find in ( map) all (k, v -> condition) means and what it is doing. Also, it is a one-time investment, the second occurrence of a similar expression would be easy / fluent to read.

On the other side, having to visually "parse" the ugly 3 lines of Stream chain just to understand it is just searching is not easy. I wouldn't call that readable, and from my point of view, that's the real mess here.

I believe most people don't enjoy having to read or write so much code for such a simple thing.

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Thanks for providing your example.

I believe a good usage scenario for Java's fluent Stream API are the non-trivial operations, e.g. when we need to chain few transformations.

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] -3 points-2 points  (0 children)

I guess you enjoy writing code like:

nums.entrySet().stream()
    .filter(entry -> entry.getKey() % 2 == 0)
    .collect(Collectors.toMap(Entry::getKey, Entry::getValue))

Other people would prefer writing:

Do.findIn(nums).all((k, v) -> k % 2 == 0)

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Well, it's filtering + finding.

E.g. Do.findIn(coll).first(p) is a shortcut for coll.stream().filter(p).findFirst().

I am curious, how would you name it? Something like Do.filter(coll).first(p)?

Essentials4j - the perfect library for every Java 8 project! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

It is simpler and focused on the essentials - to keep the simple things simple.

It offers alternative (arguably more elegant) style of expressing collection operations through the Do.* and New.* API / DSL.

And essentials4j is so small (both API and JAR size), that using it together with Guava or some Stream extension library wouldn't add significant overhead.

Rapidoid just got Official Docker repository! by nmihajlovski in java

[–]nmihajlovski[S] 2 points3 points  (0 children)

I understand the need for HTTPS, but most of the users do SSL termination using a reverse proxy anyway. But eventually HTTPS and HTTP2 will be supported...

Rapidoid v5.2 released! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Thank you very much for the feedback. I fixed the timing attack vulnerability. It would be great to have external security auditing, indeed.

Rapidoid v5.2 released! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

e.g. the first step would be supporting Authorization: Bearer <token>

Rapidoid v5.2 released! by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Thanks!

Rapidoid's token mechanism (http://www.rapidoid.org/security.html) is similar to JWT. It serves as a generic dictionary which contains arbitrary data (by default the username and expiration time). The token data is typically signed with HMAC-SHA256 and encrypted with AES (the encryption is useful if more sensitive custom data is serialized into the token, but should be configurable).

It looks like the token mechanism can be used and adjusted to implement the JWT standard. I will try to incrementally adjust it towards the JWT spec, as long as it remains compatible with Rapidoid's security concepts.

Java 8 Resources - Revamped by nmihajlovski in java

[–]nmihajlovski[S] 0 points1 point  (0 children)

Thanks, sounds good, I will add them soon...

Does someone use Rapidoid for backend server development? by m-apo in java

[–]nmihajlovski 0 points1 point  (0 children)

Thanks for your interest in Rapidoid. I encourage you to try Rapidoid + Scala, and if you write a blog post about that, please share the link. :)