What is Platform Independence – Java & .net – “write once, run anywhere”
Platform independence “write once, run anywhere”:
What do we mean by platform??
Its 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 microcontroler 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 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 could 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.
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 in to 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 that generates BYTE CODE which is common for all platform. 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 having JVM it can run any java program. In C, 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.
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.
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.
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.
Cross-Platform Apps are Easier to Maintain
Would you rather maintain one single application or multiple apps? Platform-independent applications are easier maintain because updates are synced immediately across all platforms and devices, saving you time, money, and energy.
Lets share and learn at www.guvi.in