React vs Java
The two projects have nothing in common. When I work on one, I'm using Java. When I work on the other, it's all React. It's hard to directly compare the two, since productivity measures in the Java application are very different from the React app. In Java, a "success" can be anything from creating a new API that reads from a database, fixing an API to properly update the data, or modifying a certain procedure to do some extra thing. In React, a "success" is usually just building the UI, and using various tools to read data from the backend, and making sure everything updates correctly. 4 hours in Java is not the same as 4 hours in React.
What is really being compared
Single-threaded vs Multithreaded
Compiled vs Interpreted
This usually only matters when there is a syntax error and I'm wondering why nothing works even though I swore it would work this time. I examine the block of code I was editing and scratch my head. An hour later I realize I had accidentally saved the file after typing "f" on some random line 200 lines above where I was working. Typing "me" usually follows.
That sort of thing never happens in Java, though to be honest sometimes to a fault. What if I just want to quickly debug something? Do I really have to return an empty String or new Array<String>() just to print some feedback?
Loosely-typed vs strongly typed
I prefer Java on this one. It's really nice to know what something will be when you try to use it.
Rule: A Strength in Java is a Weakness in React, and Vice Versa
After I get into the groove with React, I start to appreciate how quickly I can get a lot of data moving from the frontend to the backend. I can set up a form quickly and send it to the backend without feeling like that's what I'm doing. I can do a fetch when the component mounts to feed it the data it needs to display a list. Really, React does a great thing by managing the data in the frontend and making sure it connects to the components. The only catch is that you have to use the React framework and coding patterns.
- A small project is easy in React, but React can actually be overkill if it's a very small project.
- React is best with medium-sized projects.
- A large project is still very difficult to manage with React.
- Java makes small projects, medium projects, and large projects feel like medium projects. There is no middle ground, or rather, there is only middle ground.
Leave a Comment