************************************* * * * DB/C Newsletter * * August 2001 * * * ************************************* News and Comments We've changed the DB/C Newsletter web page at www.dbcsoftware.com to be more useful for finding information about sample programs and other topics that have been discussed in previous newsletters. A wealth of information is available there. Microsoft recently made the decision to not include Java in its upcoming release of Windows XP. Reactions from industry pundits have been wide ranging. My feeling is that it is a good thing. As a result of Microsoft's lost civil case with Sun regarding Java licensing, the only version of Java that Microsoft could legally include in XP was quite old (Java 1.1.4). To get Java functionality into Windows XP, end users or hardware vendors (like Compaq and Dell) will need to install a Java Virtual Machine. That could be problematic for consumers, but isn't much of an issue for business users. The reason I think this is a good thing is that now programmers can assume that a current release of Java is available, thus allowing programmers to use newer features of the Java platform. The result should be better performance and more useable applications. Through the years, I've occasionally mentioned that portability was DB/C's most important feature. This month we revisit and update that discussion in light of current events such as the Microsoft/Java issue. don.wills@dbcsoftware.com ****************************************************************************** Portability The measure of portability is a fundamental aspect of programming languages and operating environments. Portability isn't black and white. It isn't easy quantify. It is multi-dimensional. And unfortunately, it is also one of the most misrepresented aspects of programming languages and operating system platforms. Portability has always been a hallmark of DB/C software products. A bit of history - Subject, Wills & Company has provided programming services to customers in the Chicago area since the late 1970's. By the early 1980's, SWC had developed a fairly comprehensive set of accounting modules (AR, AP, GL, payroll) using the Datapoint Corporation DATABUS programming language to run on Datapoint's line of computers. In the 1970's, Datapoint was a fast growing company. DATABUS was integral to Datapoint's early success. Around 1982, several things occurred that made it clear that Datapoint's glory days were over. It became nearly impossible to convince potential customers to purchase Datapoint computers. SWC's future was in peril. From several options, SWC's decision was to write a compiler and runtime for DATABUS that would run on the newly-introduced IBM PC. It was also important that SWC expertise and programs would never again be dependent on a single computer vendor. Thus, at the outset, portability was a key feature of DB/C. Through the years, DB/C programs have run on many operating systems - MS-DOS, SuperDOS, MacOS, AOS, and too many UNIX variants to recall. Today, DB/C DX programs run on Windows and many UNIXes. DB/C JX programs run on Java platforms, which include such platforms as OS/2 and Mac OS X. In the near future, DB/C DX will run under OS/390 on IBM mainframes. And further out, I suspect DB/C will be running on platforms yet to be built and named. An interesting observation to be made is that portability is not a universal good. Portability is in the best interest of owners of software. But generally, portability is not in the best interest of hardware or operating system vendors. For example, through the years, IBM made sure that its brand of RPG would only run on its AS/400 computers. Although the RPG language was a 'standard', programs written in IBM's RPG were very hard to move to other platforms. Oracle has played the same game with SQL. Oracle heartily embraces the 'SQL standard', but Oracle's added features make it hard to move to a competitor's SQL database. Microsoft attempted to do the same thing with Java by adding its own features to the language, but Sun's contract with Microsoft precluded such action and a judge agreed. Microsoft's response was to build their own language (C#) and immediately declare it 'standard', all the while making sure that actual, useful C# programs can't possibly run on any platform other than Windows. Is a 'standard' language portable? Just what does portability mean? And is portability really that important? There a lots of answers to these questions, and the answers depend on one's situation and prejudices. If support for multiple platforms is a requirement of an application, then portability is very important. If support for multiple platforms is not a requirement today or in the near future, then portability may be less important. Here are four general measures of portability: 1. Source language portability 2. Executable program portability 3. Supporting library portability 4. Data files portability The first type of portability, source language portability, can be used to show that 'standard' does not mean 'portable'. The C programming language was standardized many years ago. Its standard is well accepted and all of today's C compilers implement it well. Here's an example: int a = 0x01020304; char * b = (char *) &a; printf("the first byte is %d\n", *b); Some computers will print "the first byte is 1" and others computers will print "the first byte is 4". Thus, 'standard' does not mean 'portable'. Generally, source language portability is the easiest to accomplish. DB/C, Java, C# and several other languages exhibit excellent source language portability. C/C++ does not. Before Java came into existence, only some of the niche languages (such as DB/C) addressed the executable program portability issue. Java (via the JVM) exhibits a high level of executable program portability. Microsoft will allow third parties to build Common Language Runtimes for platforms like UNIX, thus C# programs can potentially exhibit a high level of executable program portability in the future. The supporting library portability is an area where there are huge variations. Java has done a good job in this area, except for its support of GUI applications where the result has been less than a rousing success. Java's decision to move from AWT to Swing instead of enhancing AWT was a big mistake. They seem to be addressing this issue in the 1.4 release of J2SE. The issue of supporting library portability shows where Microsoft's claim of C# portability isn't to be taken seriously. No one expects to be able to run a typical Win32 C# GUI program on Solaris or Linux. The creation of the SQL standard was an attempt to address the issue of data file portability. It has generally been a success, particularly in the syntax of the file access statements. But because SQL isn't a programming language, it only provides part of the solution. In actual practice, COBOL and DB/C are clearly superior in their level of data file portability between disparate platforms. So why wouldn't all programmers and IT managers embrace portability? Here are some of the shortcomings of being truly portable: 1. Inability to use operating system specific features 2. Performance may be slower 3. More training is needed for people to support multiple platforms Of these three issues, the first one is by far the most important. Microsoft has used its control of the various Windows APIs to offer new, non-portable features for Windows for many years. These features can be quite attractive, particularly to customers that use only Windows. Performance was an issue in the past, but isn't generally a problem today. (Do you may remember the scare tactic of describing DB/C as slow because it was 'interpreted'?) And yes, it may cost more and more training will be involved if you need to support both UNIX and Windows. The positive results of using a portable language and platform are many. Here are four of them: 1. Security of investment 2. Maturity of application 3. End user choice 4. Changes can be evolutionary instead of revolutionary Applications are expensive to build. If they have to be thrown out and rebuilt every few years, the total cost over the lifetime of a system will be much higher. Portability assures longer lifetimes for application systems. It has been said that applications aren't really good until they are ten years old. For many systems, it takes that long to incorporate the collective wisdom of all of the people who have used the system to get it to a point where it really reduces costs and enhances revenues. If a system is rebuilt every few years, it may never mature sufficiently to become truly valuable. Portability implies choice. When the end user can choose platforms, everyone is happier. Finally, if your application is portable, there won't need to be any 'big bang' days where an entire application is replaced by something new. There are stories of companies that have gone out of business because of just such failed implementations of new computer applications. Portability is not static - it is not only about the choices that exist today. Rather it is about the promise of a secure future for application systems. Embrace it! ****************************************************************************** DB/C Class Schedule Class: DB/C DX and JX Language Fundamentals Date: September 24-26, 2001 Location: Oak Brook, Illinois For information, send email to admin@dbcsoftware.com. ****************************************************************************** Subscribing to the DB/C Newsletter If you don't already have the DB/C Newsletter delivered to your email address and would like to have it emailed to you monthly, just send an email message to 'dbcnews-subscribe@dbcsoftware.com'. The newsletter will be delivered to the email address from which the message was sent.