Why Java is the 1st choice of Finance industry ?

Piyush Gupta
4 min readFeb 7, 2021
Java

1. Security

C/C++:

  • Uses pointer values to manage application memory & garbage collection. It is done manually using malloc, calloc & free. This gives users access to the memory of program. Unfortunately, pointers can be used by hackers to access confidential information. Pointers cannot verify users that request data. As a result, pointers will grant memory access to a hacker without first checking their authorization.
  • Private keyword is used for abstraction of data & hence avoid access of data from outside the class.
  • Statically typed: Every variable in the program is checked at compile-time. Compiler also checks every variable in a program threats that would affect unboxing.
  • Error checker built into the compiler

Java:

  • Ever heard of pointers in java ? Java uses automatic dynamic memory allocation & garbage collection with the help of reference counting. Java pointers are implemented internally & programmers have no control over them. It automatically free the memories whenever the need arises, so we don’t have to do it ourselves. This enables blocking of any unauthorized data access & hence systems are much more difficult to infiltrate.
  • Private keyword allow a programmer to hide vital information during program execution without worrying about other outside data overriding it.
  • Statically typed: Every variable in the program is checked at compile-time by the Java compiler to thwart threats during unboxing.
  • Data input in every variable is wrapped into a safe class in Java. Wrapping each variable allows Java an additional layer of protection against hostile programs.
  • Error checker built into the compiler.

Python:

  • Python also uses reference counting for automatic dynamic memory allocation & garbage collection.
  • Although (__) is used for private variables but still they can be accessed using className.__variableName. Python internally doesn’t provide any method to restrict the access of private variables from outside the class.
  • Dynamically typed: Python performs datatype checking at runtime which makes it threat prone.
  • Error checker built into the compiler

Node.js:

  • Automatic dynamic memory allocation & garbage collection
  • Dynamically typed: Performs datatype checking in runtime which makes it threat prone.
  • Similar to python, javascript doesn’t stop anyone from accessing any of the properties of an object.
  • Lack of default error handling, ex- hoisting is allowed: a function or a variable can be used before declaration.

Here, Java is the clear winner.

2. Performance

Blocking & Non-blocking I/O:

  • There are two types of I/O calls: blocking (synchronous) and non-blocking (asynchronous). Blocking IO means that a thread cannot do anything more until the IO is fully received. A thread assists a request and enters a wait state until this request is completed. Blocking provides linear programming, easiness to code and less control. Non-blocking IO means that while a thread assists an IO request, it can handle the others, without waiting for the implementation of each. It allows a thread to continue processing another request until the operation is complete, and decreases the time of implementation. Non-blocking is parallel programming, more difficult to code and provides more control.
Source: twitter.com
  • Node apps are asynchronous and non-blocking.
  • Other frameworks such as ASP.NET and Django are synchronous and blocked. We can make them asynchronous, but it will require extra efforts.
  • In Java, both synchronous and asynchronous processes are available (depending on the method, class, and object being called).

Single-threaded vs Multi-threaded:

  • Node.js is Event-driven & single-threaded, means that we have one thread to deal with all requests. Once a request arrives, that thread is used to handle it. If you need to query a database, a thread doesn’t need to wait for a database to return the data. While a database is executing our query, that single thread will be used to serve another request. When the database finished its job, it puts a message in the Event Queue. Node is continuously monitoring this queue, and after it finds the event, just takes it out and process it. This kind of architecture makes Node ideal for IO intensive apps that include a lot of disk/network access. And we can serve more clients, without the need of throwing more hardware making Node applications highly scalable. But disadvantage is, while performing the calculations to serve one client, other clients have to wait. For that reason Node shouldn’t be used for CPU-intensive applications.
Source: twitter.com
  • Java is multithreaded, means that several tasks may be performed simultaneously within a program. Multithreaded programming has been smoothly integrated into Java. In other languages, OS-specific procedures have to be called in order to enable multithreading. Multithreading helps applications perform better. So, for large-scale projects that involved concurrency, Java is highly recommended whereas Node.js does not handle the thread as well as Java does.
Source: twitter.com

Conclusion: From the above discussion it is clear Java provides better security, better performance for CPU intensive tasks & more control which are often requirements of finance industry.

Hence, Java is the the 1st choice of finance industry.

--

--

Piyush Gupta

CSE Undergrad IIIT Pune. Exploring & Experiencing technologies at my best.