Well House Consultants Ltd

Search site for:

Further Information:
Home
What's New
Resource Centre
WHC Library
Opentalk Forum
About Us

AA AA AA AA
Accessibility
Solution Centre

Please follow this link to find out about our solutions and this link to go to our solutions centre home page

Historically, programs have been operating system dependent with a
distribution that runs on (say) Windows NT not being suitable for 
use on Solaris.   Or, in current operating systems, an XP distribution
being unsuitable for Linux or OS X.

This has changed somewhat with more modern langauges such as Java
and Perl, but the "model" of how this works - and thus the ideal
application - differs between the two. 

How are Perl and Java portable?

Java code runs in a virtual machine - a piece of software that is 
operating system dependent which provides an environment in which a 
system independent distribution can run.  You'll need to install a
"JRE" (Java Runtime environment) that includes this virtual machine
on any system on which you want to run Java, or use a JVM that's
supplied as part of something else such as certain browsers before
you can run Java on a computer.

Java provides device independence by working at a level above the
operating system, so it is NOT an ideal language for system admin,
backup scripts and similar utilities.  It's great for larger "OO"
projects that run for months or years, with teams of programmers
working together.

Perl can run on all major operating systems.  In order for a Perl
script to run on a computer, a version of Perl specific for the
operating system must be installed (just like Java needs a JRE).
Once Perl is installed, the same distributions should be able to
run on any platform if the code was written suitably.

The vast majority of Perl code *is* portable. I've quite happily
written code without even thinking about the target OS, and all 
our training examples work on Windows, Linux, OS X and Solaris
quite cheerfully.  In practise, Perl is very "Unix like", but 
where something's required that is of necessity operating system
dependent, the Windows implementation (for example) mimics the
Unix behaviour and does what we describe as the "moral equivalent".
In that way, Perl code will typically run cross platform in a
far wider range of applications that Java which simply cannot do
certain things practically.

A warning - it IS possible to write operating system dependent Perl;
if you say "run the following OS command" and ask it to run 
something that doesn' exist on some OS, then it's bound to fail.
But Perl scripts aren't accidentally written like this, and can 
check.

Can I learn to program in Perl / Java as my first language?

Yes, and knowledge gained of one will make learning the second
easier.  We're quite used to running "learning to program in Perl"
and "learning to program in Java" courses - and the way we teach
newcomers to programming is different to the way we teach people
who are converting from other languages.

Having said that, both Perl and Java have a huge range of 
facilities and neither is the easiest of languages for the
newcomer ... but then you end up being able to do really 
useful, portable things after your course.

Visibility of Perl and Java

You'll see a lot more information around about Java and you'll
feel that it's a much more popular language.   It probably does
have a bigger user base (see my comments earlier about how great
it is for huge applications), but it's also been very much over
sold by its originators who push it perhaps wider that they should.

Perl is an Open Source language. It's not really sold but has
enthusiastic advocates who, however, will tell you its stengths
and also its weaknesses - they have no income to make from 
overselling it.  Thus it's a bit of a "hidden secret" compared
to Java.



See also Courses for newcomers to programming
Our ref: pvj/melksham-new-to-programming-portable-code-perl-or-java
At Well House Consultants, we provide training courses on subjects such as Perl, Java, Tcl/Tk, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this directory. Please also see Our privacy policy and copyright statement.

If you would like to learn more about us, this web site also includes a Listing and schedule of public courses, and information about Specially Run Courses and Private Courses.


WELL HOUSE CONSULTANTS LTD
404, The Spa • Melksham, Wiltshire SN12 6QL • United Kingdom
PHONE: 01144 1225 708225 • FACSIMLE 01144 1225 707126 • EMAIL: info@wellho.net
You are currently on our United States site. Change your country
Updated Thursday, April 18th 2024 Privacy and Copyright Statement © 2024