From fledgling Java (3 years) to Node.js (4 years). And the impression of returning to Java

As the title suggests, I'm back in Java.

The world you see is totally different. You only know when you get stronger. Did Java work like this? ?? Nice.

Thinking about infrastructure when adopting a new language for web application development

The mechanism means ↑.

Difference between fledgling and now


The situation at the time of my fledgling

There were many things to remember, and I had no choice but to write controllers and services without deeply understanding them. (If you think about it now, if a veteran pulls you in pair programming, you can use the highway theory and the growth rate will be different.)

For the time being, I did my best to read technical books during the lunch break.

However, when I think about it now, I think the level was quite low. (Because it's a fledgling, I think it's natural ...)

At present, the description is generally known.

In that state, I will write the good points and bad points of Java that I saw again, including comparison with Node.js.

environment


Good point


--Unlike Node.js, it's not asynchronous event driven, so it's easy to follow the code -Since there is a type, there is a sense of security that it will work relatively well as long as it compiles. ――Java is used and it is dead, so there is a sense of security. ――If you want to do it, you can write asynchronous processing ――If you google, various information will come out (the amount is too much and it is also noisy) --Since MongoDB is schemaless, it is very nice to be able to define the schema using types on the Java side.

bad place


--It takes time to compile ――I think there is a workaround, but it takes 2 minutes and 30 seconds at the moment of the project. --You can't develop without IntelliJ IDEA (Integrated Development Environment) (I want to do something about it ...) --In the case of Node.js, Vim and Visual Studio Code were free. --Test (JUnit) is harder to write than Node.js Mocha ――I want to explicitly write pre-processing and post-processing, but I have no choice but to write it in a mess in the test. --Difficult to implement due to Spring (situation where batch processing cannot be written properly) --If Spring just wants DI, there is also Google Juice -SparkJava I think it's simple -Is it because of the synchronous type? I don't know, but there is no performance at all ――In this regard, it is highly possible that the current project is not implemented properly. --Create a class even for objects with a short lifespan ――I think List and Map are good for VO class that is used only in 1 request path. --In Node.js, it seems that only List and Map are used, and it was still operational. ――If you can do test-driven development that prioritizes coding speed, I think you can go with List and Map. --Getter, Setter Don't you need it? --Maybe it's Maven, but the directory structure is awkward --Because of annotations, you may have a hard time not understanding how it works. -Does it work before the method? Does it work after the method? I don't know unless I see the implementation ――I don't think annotations are good because you can't understand the mechanism at a glance. -Lombok I think it's good

Summary


I think that what I wrote in a bad point can be changed at all depending on the implementation.

I feel that Java's traditional practices are just annoying.

Wouldn't it be interesting to try Node.js-like Java development? I think. (By the way, I think there was a person who was doing Node.js-like development using Play Framework when he was at CyberAgent.)

For me, in order to return early, I need to implement it quickly, so I want to create an environment where that can be done.

Recommended Posts

From fledgling Java (3 years) to Node.js (4 years). And the impression of returning to Java
I translated the grammar of R and Java [Updated from time to time]
How to write Scala from the perspective of Java
Java language from the perspective of Kotlin and C #
I tried to summarize the basics of kotlin and java
Get to the abbreviations from 5 examples of iterating Java lists
Command to check the number and status of Java threads
The road from JavaScript to Java
[Java] Various summaries attached to the heads of classes and members
Method to add the number of years and get the end of the month
I tried to summarize the methods of Java String and StringBuilder
[Java] How to convert from String to Path type and get the path
Output of the book "Introduction to Java"
Update JAVA to the latest version to 1.8.0_144 (when downloading from the web and updating)
The story of forgetting to close a file in Java and failing
[Java improvement case] How to reach the limit of self-study and beyond
From Java9, the constructor of the class corresponding to primitive types is deprecated.
[Java] The confusing part of String and StringBuilder
The story of adding the latest Node.js to DockerFile
[Java] How to get the authority of the folder
Java Welcome to the Swamp of 2D Arrays
[Promotion of Ruby comprehension (1)] When switching from Java to Ruby, first understand the difference.
[Java] Program example to get the maximum and minimum values from an array
Differences between Java, C # and JavaScript (how to determine the degree of obesity)
[Java] How to get the URL of the transition source
ArrayList and the role of the interface seen from List
A Java user over a dozen years ago tried to study the functions of Java8 (Generics).
From the introduction of devise to the creation of the users table
Convert Java enum enums and JSON to and from Jackson
Changes from Java 8 to Java 11
Sum from Java_1 to 100
[Java] I want to calculate the difference from the date
[Java] Types of comments and how to write them
The comparison of enums is ==, and equals is good [Java]
A memo about the types of Java O/R mappers and how to select them
Convert the array of errors.full_messages to characters and output
Organizing the current state of Java and considering the future
[Java] How to get the maximum value of HashMap
6 features I missed after returning to Java from Scala
From Java to Ruby !!
Java classes and instances to understand in the figure
I summarized the types and basics of Java exceptions
Java: Use Stream to sort the contents of the collection
[Ruby On Rails] How to search and save the data of the parent table from the child table
In Java, I want to trim multiple specified characters from only the beginning and end.
A Java user over a dozen years ago tried to study the functions of Java8 (Lambda expression).
Setting method to link Java of Eclipse and Github / September 2017
The story of raising Spring Boot from 1.5 series to 2.1 series part2
Java to fly data from Android to ROS of Jetson Nano
[Note] Java Output of the sum of odd and even elements
Generate and execute Jar file of Java file belonging to package
I didn't understand the behavior of Java Scanner and .nextLine ().
Find the address class and address type from the IP address with Java
[JDBC] I tried to access the SQLite3 database from Java.
Difference between Java and JavaScript (how to find the average)
20190803_Java & k8s on Azure The story of going to the festival
Java beginners briefly summarized the behavior of Array and ArrayList
How to get the longest information from Twitter as of 12/12/2016
How to write and notes when migrating from VB to JAVA
Correct the character code in Java and read from the URL
How to derive the last day of the month in Java