PROGRAMMING LANGUAGES

What is Platform Independence in Java & .net?

By Isha Sharma

Platform independence “write once, run anywhere”:

What do we mean by platform??

It is a combination of the underlying Hardware and software of a system.

A Software that can run on any hardware platform (PC, Mac, SunSparc, etc.) or software platform (Linux, MacOS, Unix, Windows, etc.) is called as platform independent.

Platform is nothing but a base. Hardware platform is determined by the processor. In the beginning, the programming was at microprocessor and microcontroller level which used instruction sets, this type of programming is called assembly language programming. Assembly language program was very big for simple things like addition and subtraction. The relationship between the hardware and assembly language is that each hardware has a different set of instruction sets. The instruction set varies for each processor and this is where the problem arises. Programs written in high-level languages are translated into assembly language or machine language by a compiler. Assembly language programs are translated into machine language by a program called an assembler so that it can be run on a processor. The problem is that after compilation if we take that .exe file and run it on another processor, that processor will not accept it, since the instruction set varies for each processor.

Before proceeding further, If you’re interested in Java Full Stack Development, then master front-end frameworks, back-end technologies, and database management. Consider joining GUVI’s Java Full Stack Development Career Program. With placement assistance included, you’ll master the Java stack and build real-world projects to enhance your skills.

Well, we can solve the above problem by converting the high level language program in to middle level language instead of assembly language. So when we run this middle level language program in any processor, it will be converted into assembly language and the program can be executed without any problem. This is how Java solved the platform dependence problem. Java language supports interpreter and compiler. The source program is first compiled and generates BYTE CODE which is common for all platforms. The Byte code is given to JVM (Interpreter) each platform has its own JVM. This converts byte code into machine language that can be understood by the particular machine only. Once the machine has JVM it can run any java program. In C, and C++ the source program is directly compiled into machine code, which is platform-dependent. Combination of byte code and JVM makes Java program platform independent. Write once run everywhere was Java’s mantra when it started ruling programming world.

platform independence - java

Similarly an open-source cross-platform version of Microsoft .NET (a framework for applications and programming languages) called Mono is also platform independent. Multiple languages can be used with the Mono platform. The Mono project provides C#, Basic, and Ilasm compilers, and there are both open source and commercial compilers that can be used with Mono. It’s important to note that any language that compiles to pure IL should work under Mono. Some languages such as Microsoft’s Managed C++ do not always compile to pure IL, so they will not always work as expected, since they are not truly platform independent.

platform idependence - .net

Table of contents


  1. The Benefits of Platform Independent Applications
    • Cross-Platform Apps = Greater Reach
    • Easier Marketing with Platform-Independent Apps
    • A Uniform Look and Feel
    • Cross-Platform Apps are Easier to Maintain

The Benefits of Platform Independent Applications

Applications are developed for two key reasons: to deliver high quality engagement to a market and to acquire as many users as possible. The challenge for developers and marketers is that today’s app market is incredibly diverse. There are now more than eight major platforms for applications, including iOS, Android, BlackBerry OS, Windows, and more, and each one of these platforms presents its own programming paradigms and languages. Providing a high-quality experience to as many users as possible requires platform-independent application designs, or cross-platform apps.

MDN

Cross-Platform Apps = Greater Reach

The more platforms an application can run on, the more people it can reach. Although Google’s Android and Apple’s iOS dominate the app landscape worldwide, other systems are quickly gaining ground and it seems like more and more pop up every year. Developing applications that run flawlessly across platforms lets you tap into your greatest marketing potential.

Easier Marketing with Platform-Independent Apps

Instead of creating multiple ad campaigns to cater to specific sets of device users, you can market your application through more generalized messages when you invest in platform-independent apps, making it easier and less expensive to reach the masses.

A Uniform Look and Feel

Few developers are experts in multiple programming languages, making it difficult to perfectly match the look and feel of two or more apps. Because platform-independent apps run on a single code, it is easier to maintain consistency in appearance and function across different devices.

MDN

Cross-Platform Apps are Easier to Maintain

Would you rather maintain one single application or multiple apps? Platform-independent applications are easier to maintain because updates are synced immediately across all platforms and devices, saving you time, money, and energy.

Begin your career journey with GUVI’s Java Full Stack Development Career Program, providing placement assistance. Master essential technologies including Java, Maven, Eclipse, HTML, CSS, MongoDB, and more while working on practical real-world projects to enhance your expertise.

Career transition

Did you enjoy this article?

Schedule 1:1 free counselling

Similar Articles

Loading...
Share logo Copy link
Free Webinar
Free Webinar Icon
Free Webinar
Get the latest notifications! 🔔
close
Table of contents Table of contents
Table of contents Articles
Close button

  1. The Benefits of Platform Independent Applications
    • Cross-Platform Apps = Greater Reach
    • Easier Marketing with Platform-Independent Apps
    • A Uniform Look and Feel
    • Cross-Platform Apps are Easier to Maintain