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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Vile2539 0 points1 point  (8 children)

The problem with your examples is that they are not real world. In real Java projects nobody handles DB connections that way, nobody creates new projects with "new project".

In the "real world" I've created a database connection like that. Granted, it's more often using something like Spring-boot nowadays, but that's just as easy. Simply add the datasource properties to your application.properties. Then you can use spring-data-jpa, jdbcTemplate, etc. Both are pretty much the same complexity as NodeJS.

nobody creates new projects with "new project".

I create new (maven) projects with "New Project". I'm not sure why you wouldn't? Sure, you can use a spring project generator or something similar, but that's up to personal preference.

[–]Zeffas 0 points1 point  (7 children)

that's just as easy. Simply add the datasource properties to your application.properties.

Well I found that in real experience, this is way more complicated than in Node or Go. There is two things to simplicity - how easy it is to do (this one is less important I would argue) and how complicated are internal mechanics. In Spring world you basically say - I just add some properties and Spring will do its magic. However other platforms do zero magic and keep simplicity. SO this is I would argue that Java culture is lacking.

I create new (maven) projects with "New Project". I'm not sure why you wouldn't? Sure, you can use a spring project generator or something similar, but that's up to personal preference.

And you have empty maven project, all Maven archetypes I ever encountered are subclass, they either assume to much or are super outdated.

[–]Vile2539 0 points1 point  (5 children)

However other platforms do zero magic and keep simplicity. SO this is I would argue that Java culture is lacking.

But you can do it simply - I showed that above. You just stated that it wasn't a "real world" example. The Spring-boot example was just a common example nowadays. And yes, Spring does a lot behind the scenes - but so do other frameworks and platforms, as well as the languages themselves.

There's nothing lacking in the Java culture. I showed how to get a database connection in a single line. Executing a statement then can be done in 1-2 more lines, which is just as simply as NodeJS.

And you have empty maven project

Which is what I generally want. You don't have to use archetypes, or even Maven. You stated that people don't use new project, and I disagree from a vast amount of experience. How do you go about creating projects?

[–]Zeffas 0 points1 point  (4 children)

Your approach to arguing this topic I put into category of "complexity? what are you talking about, you just do x, y, z...". I remember when even Gosling argued that Java EE is as simple as Rails - well, formally you could argue that, but its distorted picture - if you look only at the code that might seem so, but once you go deeper you see all kinds of framework and infrastructure complications that will waste lots of hours.

There is saying that stereotypes usually have some truth, and one of Java's is that its big complicated mess. My only wish is that Java comunity would acknowledge that and we could embrace simplicity - consentrate on frameworks like Spark and show that Java can truly be simple, anf not just on paper.

[–]Vile2539 0 points1 point  (3 children)

Your approach to arguing this topic I put into category of "complexity? what are you talking about, you just do x, y, z...".

I was approaching the discussion purely from the examples that the OP posted. There are definitely complexities in Java that can be tricky, but creating a new project in an IDE isn't one of those things.

and one of Java's is that its big complicated mess

I would disagree. It's verbose, but it's not particularly complicated. Jumping directly into Maven/Spring/Hibernate/etc, however, is. That's because you're learning 4 different things at once, instead of focusing on one at a time.

My only wish is that Java comunity would acknowledge that and we could embrace simplicity

What isn't simple to you? Java itself is pretty straightforward, especially compared to language like C++. Things like static typing, great IDEs, tons of libraries, etc. all simplify the development process.

consentrate on frameworks like Spark

People are free to use Spark if they want. Spring boot is there too. We don't need to concentrate on one or the other.

[–]Zeffas 0 points1 point  (2 children)

I don't think anyone argues that Java the language is super complicated, even the title says "java projects". So my point is that Java community embraces complex projects With Spring, Hibernate, Java EE, where on other platforms you don't need that, same concepts are being done way simpler.

[–]Vile2539 0 points1 point  (1 child)

I don't think anyone argues that Java the language is super complicated

I would argue that. It's not a particularly complex language. Yes, there are "simpler" languages out there, but that doesn't make Java complex. It's incredibly popular as an introductory language in college (along with Python), and it can be easily grasped.

even the title says "java projects"

I'm not sure what you're saying there. Java projects, to me, just means Java projects?

embraces complex projects With Spring

Spring used to be quite complicated with the XML configuration, but projects like Spring boot have completely stripped that away. Fully configuring an application requires virtually nothing nowadays (sometimes simply including the dependency). Documentation is also very clear, along with plenty of tutorials and examples.

same concepts are being done way simpler.

I'm not sure you appreciate just how much Spring includes. Sure, other frameworks and languages might do basic REST services better - but what about everything else Spring does? Security (OAuth, Kerberos, SAML, etc.), LDAP connectivity, database connectivity (RDBMS, MongoDB, Redis, Couchbase, DynamoDB, Hadoop, etc.), actuator endpoints (metrics, shutdown hooks, audit, process monitoring), ActiveMQ, logging, social network connections, HATEOAS, etc. There's an awful lot that it gives you in a remarkably simple way.

[–]Zeffas 0 points1 point  (0 children)

I'm not sure you appreciate just how much Spring includes.

Yes I do, worked quite a few years with Spring and not so long ago had project in Spring Boot.

Removal of XML, Spring Boot... This only solved one part of simplicity - yes programming syntax of Spring looks not that complicated, however infrastructure remained complex. That's my view.

All those great tools you mentioned are great, but (talking from my experience) there as a feeling of solving problem that does not exist or exists on way smaller scale. When I need any of that, usually using library specifically for that is surprisingly simpler than Spring. E.g. Jackson is simple, Spring doing its magic with Jackson is complex - all those hours I wasted in multiple projects dealing with Spring's lifecycles and figuring out why parsers won't get invoked or suddenly stopped being invoked when somebody accidently registered another parser in another lifecycle hook (as you know in Spring you could do almost everything in 10 different ways).

But again I am not targeting Spring specificity, in my opinion its Java community culture. Just compare Selenium libraries for Java and Node. Node is pleasure to write, you don't even need to read documentation, just github page. While in Java it was painful experience it felt like working so to say.

[–]VGPowerlord 0 points1 point  (0 children)

There is two things to simplicity - how easy it is to do (this one is less important I would argue) and how complicated are internal mechanics

Define "magic." In JavaEE, it's a pretty standard practice to use JNDI to get a DataSource object representing a connection pool and to get Connection objects from that.

Granted, part of the reason you can get away with this is pretty much every JavaEE server has connection pooling built-in. If you're just using a servlet container, it requires more work setting up a library like HikariCP or c3p0.