Live data from Hacker News

Show HN: Minum – A minimal Java web framework

github.com

61–70 of 113 posts

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

#61
post #55

Why does almost all the Java based web development framework use "template" system, instead of generating HTML from code(like Flutter/Swift)? Is this due to the inherent limitation of Java language/syntax?

In order to make this not extraordinarily painful, you need some good language support for internal DSLs, or a template language / preprocessor, both of which Java doesn't really have. You could still do it somehow, but it probably wouldn't be the nicest experience. Plus, historically, the Java community has been in love with XML, so you'll find lots of templating libraries based on XML.

Swift has function builders which are part of the magic that makes such DSLs practical.

In Kotlin, which also runs on the JVM, this is possible much more easily than in Java: https://kotlinlang.org/docs/typesafe-html-dsl.html

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

#62
post #56
post #54

To anyone developing libraries: please, for the love of god, just put a damn code snippet right at the top. A simple hello world would do. If you're pitching me something, show it to me. People don't have to dig around to see what you've made. I think the average visitor will give you about 10 seconds to decide if this is something they might be into, and if they can’t tell then they’ll leave.

Click the giant "QUICKSTART" link and you'll get what you're asking for.

I agree with the OP: you shouldn't have to click anything to get an idea of what it even is and whether it's remotely interesting to you. To me, "quick start" implies that my interest has been piqued enough for me to dive in further. If you can't convince me to continue reading in the first ~10 seconds, there's a high probability that I'm closing the tab.

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

#63
post #56
post #54

To anyone developing libraries: please, for the love of god, just put a damn code snippet right at the top. A simple hello world would do. If you're pitching me something, show it to me. People don't have to dig around to see what you've made. I think the average visitor will give you about 10 seconds to decide if this is something they might be into, and if they can’t tell then they’ll leave.

Click the giant "QUICKSTART" link and you'll get what you're asking for.

It's near the bottom of the page. It's admittedly a very little bit of with, but other frameworks don't make you work as hard.

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

#64

Awesome, love to see more Java devs pushing back on the spring madness. In Db.java, with the write/update/delete locks, that mutate both in memory and on disk, is there not a bunch of race conditions there?

There are locks around those - for example, writeLock

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

#65

I didn't see looping support for templating, like for rendering collection to HTML table. Did I miss something?

You did not miss anything. It lacks that functionality, making it necessary to template the inner part, and then use that within an outer part.

Fully-featured templating libraries provide this in the form of special syntax. This does not provide that level of capability.

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

#66
post #39

Earlier quoted context omitted.

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.

For the record, I love this project's minimalist goal. Having said that, I agree with the other commenter that escaping by default (with an opt-out mechanism) is probably the better choice. I don't even think this violates your prioritization because it should result in less code when considering an app in its entirety (framework + logic).

Interesting point. Definitely worth considering. Thanks.

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

#67

[flagged]

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'…

> Java has not been boilerplatey for a long time

Considering records just made it into the language, I think "for a long time" is a very misleading description. And records only solve the problem if your type is actually immutable - which you may not be able to do if you have to interface with stuff like Hibernate which assumes that it can just mutate everything everywhere.

That's why people use Lombok - because the language itself is too clumsy.

And that's just one example. The way checked exceptions don't work well with lambdas and require manual catching and rethrowing would be another. And so on.

> The real nice thing about Java is everything is statically typed, unlike in TypeScript where just your code and if you're lucky some of your dependencies

Thankfully, there are many other statically typed languages, so you don't have to decide between Java or TypeScript/typed Python. With Scala or Kotlin, you don't even have to leave the JVM.

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

#69
post #55

Why does almost all the Java based web development framework use "template" system, instead of generating HTML from code(like Flutter/Swift)? Is this due to the inherent limitation of Java language/syntax?

I wonder why more java frameworks don't reuse the parsing from JSP, but just drop the servlett part. Though maybe that's not as easily done as said.

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

#70
I like this Java movement back from overbloated frameworks with decades of cruft.

I thought about building my own libraries as well. Don't have time for that yet.

What I don't like about this library:

Java 21 requirement. Virtual threads are performance optimization, they should not be a requirement. If I'm fine with running thread per request, that's on me. I mean, we built apps 20 years ago which did that and they worked. They wouldn't work worse today.

Everything bundled. I'm fine with mini-framework with everything, however it should be split with separate libraries.

No module-info.java. I mean, we're talking about Java 21 which is 12 releases after Java 9. Time to embrace modules.

Post reply on HN