Live data from Hacker News

Show HN: Minum – A minimal Java web framework

github.com

31–40 of 113 posts

Re: Show HN: Minum – A minimal Java web framework

#31
post #25

Earlier quoted context omitted.

Actual Java dev here, not just someone who used it in college and got annoyed -- but I have no idea what you're talking about. Java has not been boilerplatey for a long time, I'd say since sometime between Java 5 and Java 8. You do know you can declare multiple classes in a single file (static nested classes), contrary to the popular convention, right? And "public static void main" doesn't count as boilerplate, that'…

> The real nice thing about Java is everything is statically typed Optional and generics would like a word... Edit: OK, since this got a downvote, let me be clearer, with some help from the parent: You just use Optional , and if you're lucky some of your dependencies BUT NOT ALL OF THEIR TRANSITIVE DEPENDENCIES also use Optional correctly and don't return null, and before you know it you've lost the nice safety and i…

I have never ever ever seen a null inside an Optional -- the most common constructor actually Optional::ofNullable makes the correct decision, so you can't even fck it up, and if you deliberately try to, I'm sure intellij would scream your head off.

Re: Show HN: Minum – A minimal Java web framework

#32
post #31
post #25

Earlier quoted context omitted.

> The real nice thing about Java is everything is statically typed Optional and generics would like a word... Edit: OK, since this got a downvote, let me be clearer, with some help from the parent: You just use Optional , and if you're lucky some of your dependencies BUT NOT ALL OF THEIR TRANSITIVE DEPENDENCIES also use Optional correctly and don't return null, and before you know it you've lost the nice safety and i…

I have never ever ever seen a null inside an Optional -- the most common constructor actually Optional::ofNullable makes the correct decision, so you can't even fck it up, and if you deliberately try to, I'm sure intellij would scream your head off.

The problem is whether the optional itself is null, not whether the contained value is.

Re: Show HN: Minum – A minimal Java web framework

#33
post #14

Names. The problem always comes down to naming. `StartLine.Verb.GET` is not a good name. Neither StartLine nor Verb are used in that context in the HTTP spec. The most widely used name for GET/POST etc. is Method. The author will find that these seemingly small things will hinder adoption.

Agree. Looking at the example project, this is not a single case, when a name could be better. Helpers and Utils are naming anti-patterns, so naming function ˋ(de)serializeHelperˋ is not a good idea.

Names. One of the two hard problems in computer science, along with cache invalidation. And off-by-one errors.

Re: Show HN: Minum – A minimal Java web framework

#34
post #25

Earlier quoted context omitted.

Actual Java dev here, not just someone who used it in college and got annoyed -- but I have no idea what you're talking about. Java has not been boilerplatey for a long time, I'd say since sometime between Java 5 and Java 8. You do know you can declare multiple classes in a single file (static nested classes), contrary to the popular convention, right? And "public static void main" doesn't count as boilerplate, that'…

> The real nice thing about Java is everything is statically typed Optional and generics would like a word... Edit: OK, since this got a downvote, let me be clearer, with some help from the parent: You just use Optional , and if you're lucky some of your dependencies BUT NOT ALL OF THEIR TRANSITIVE DEPENDENCIES also use Optional correctly and don't return null, and before you know it you've lost the nice safety and i…

Yep, this is a great point, and while these days people use stuff like @NonNull/@Nullable, it does not help a lot, for the exact same reason.

I wish Java had had non nullable types as default from the getgo, and it's hard to add now for the same reason JS/PY have a hard time adding static typing

Re: Show HN: Minum – A minimal Java web framework

#35
post #32
post #31

Earlier quoted context omitted.

I have never ever ever seen a null inside an Optional -- the most common constructor actually Optional::ofNullable makes the correct decision, so you can't even fck it up, and if you deliberately try to, I'm sure intellij would scream your head off.

The problem is whether the optional itself is null, not whether the contained value is.

That’s not a problem either.

Re: Show HN: Minum – A minimal Java web framework

#36
post #8

Earlier quoted context omitted.

in case you truly want to go as absolutely minimal as possible. i do. for my own personal projects, i use that database.

One suggestion I have would be to include a very minimal implementation of login management (basically just properly hash/salt passwords and provide some easy way to add users). I've used Django before for the sole reason that it includes a database and user management because some API had to be login only since said API had high resource usage. I can see how having your own database is kind of "minimal" in the Java…

Your wish is my command ;)

https://github.com/byronka/minum/blob/master/src/test/java/c...

Re: Show HN: Minum – A minimal Java web framework

#39
post #12
post #7

Earlier quoted context omitted.

here’s a more realistic example: https://github.com/byronka/minum_usage_example_mvn/blob/d649...

Making the user manually escape parameters (and be very careful not to miss any) seems at odds with the goals of ease of use and maintainability. Most template libraries do this automatically by default.

You are not wrong. Just, here, priority is

1. minimalism 2. ease of use

It's an uneasy balance. I am well aware of the value of fully-powered templating engines.

Post reply on HN