Is Java Windows for Unix?

By | April 7, 2008, 3:15am PDT

Summary: The key conceptual difference between C and Java as used in business applications development and run-times is simply this: the C you learn in school is the C you find in things like Solaris, but the Java you learn in school has very little, if anything, to do with the Java you see in things like Sun’s identity management packages.

Java is an incredibly successful toolset - but what is it really and how did it get to be so popular?

To understand what it is and how it got this way you have to start with the problem it was meant to solve: manufacturers working on digital consumer products like cell phones and set top boxes (intended to add internet connectivity to television sets) wanted their software to be updateable in use and able to run unchanged on multiple hardware generations.

Although digital TV has now brought the set top business back in volume, it was the cell phone that saved Java at the time - and because Java gives companies making those exactly what they need: a standardized software platform that’s essentially independent of the hardware, it’s now used on more than a billion such devices.

Think of the problem the phone makers faced as platform instability induced by rapid hardware change and it’s obvious that the PC software makers faced the same problem: platform instability, in their case brought about by Microsoft product churn. In response Sun released Java for Windows, got into a licensing deal with Microsoft, and advertised Java as the write once, run everywhere target of choice for developers.

It didn’t work out that way largely because developers soon discovered that memory and processor limitations on the average user computer coupled with bandwidth restrictions pretty much crippled the downloadable applications idea.

In response people did the obvious: moved their code from the slow and and distant client to the fast and local server - but when that worked didn’t follow through by abandoning Java.

Instead people who wanted to hang onto to working code and what they’d learned writing it presured Sun to incorporate increasingly complex libraries, work-arounds, methodologies, and related kludges into the standard release - thereby eventually producing what we have today: an enormously successful, absurdly over-complicated, utterly out of control monster devouring resources at an ever increasing rate.

In an ironic parallel Sun replicated this process with its own transition from the JavaStation to the Sun Ray. When the JavaStation, a “client” intended to run applications downloaded as Java byte codes for local execution, failed miserably because of bandwidth, local performance, and compatibility limitations Sun responded by abandoning its planned MAJC based smart display to create, instead, the Sun Ray -essentially a JavaStation with all processing moved back to the server.

Thus I’d argue that the use of Java in handhelds and digital TV support makes perfect sense: i.e. that its success in this role has been fairly earned because it’s the right tool for the job. But, I’d also argue that the rationale for the use of Java in business computing applications vanished as soon as the execution environment for those applications moved from the client back to the server - or, in other words, that it makes no sense at all to incur the overheads associated with trying to run downloaded applications on a Windows client when the application you’re writing will actually run on your Solaris server.

More generally, I’d argue first that the Unix mindset calls for spare, elegant, simple programming languages encapsulating principles that are easy to learn and can be widely applied; and second that “business Java” doesn’t meet this standard. Thus the C you learn in school is the C you find in complex applications like Solaris or Apache but the Java you learn in school isn’t what you get in heavyweight business applications where frameworks get piled on libraries piled on methodologies - producing about as convoluted, localized, over-complicated, and resource inefficient a mashup as you can get short of the Windows/BASIC pairing.

Notice that this isn’t generally true for Java as used in cell phones and similar devices. There the existence of space constraints and the lack of generality means that new hires have to learn company standards, a custom API or two, and a development framework but then work with recognizable Java code on the actual applications.

Unfortunately the image of crap piled on crap is the bottom line for business applications developed and maintained using Java tools - if you ever have the misfortune of having to deal with multiple Java development frameworks in large organizations or just get lumbered with trying to make something like Sun’s all Java identity management work you’ll soon learn exactly what I mean: this stuff isn’t Unix like at all - it’s windows like: byzantine, often disfunctional, defined by exceptions, and ultimately dependent, not on your ability to learn, but on your willingness to memorize.

Kick off your day with ZDNet's daily e-mail newsletter. It's the freshest tech news and opinion, served hot. Get it.

More from “Managing L'unix”

Topics

Paul Murphy (a pseudonym) is an IT consultant specializing in Unix and related technologies.

Disclosure

Paul Murphy

I do not work for, or otherwise receive anything from, any of the companies I write about. I have some money in a number of funds that bet on the markets, including the technology market, but have no direct control over how these funds are administered or what investments are made. I use Sun and Apple technology both at home and at work.

Biography

Paul Murphy

Originally a Math/Physics graduate who couldn't cut it in his own field, Paul Murphy (a pseudonym) became an IT consultant specializing in Unix and related technologies after a stint working for a DARPA contractor programming in Fortran and APL. Since then he's worked in both systems management and consulting for a range of employers including KPMG, the government of Alberta, and his own firm. In those roles he's "been there and done that" for just about every aspect of systems management and operation.

Talkback Most Recent of 98 Talkback(s)

  • Amen brother!
    Java completely violates the Coupling/Cohesion rule of software quality. A "module" in Java consists of 5/6+ files containing interfaces, beans, functions, etc. This makes for low cohesion (BAD!). All of these files also need to be connected to each other plus those "frameworks". This introduces a high degree of coupling (BAD!).

    The smartest thing the US government ever did with computing was to create Ada. It was designed for software quality, to be provable, and to scale to millions of lines of code. They achieved their goal with the language Ada - and relatively quickly made the mandate that ALL future US government code would be written in Ada.

    That (almost) never happened! Ada was new and was not taught in schools. C coders were used to having plenty of rope (to hang themselves) - like untyped pointer addition, while Ada took ALL of the rope away. NO POINTERS? HOW will I get my job DONE? No department of the government took the Ada mandate seriously, and kept on coding in C (or FORTRAN) - so the promise of a better way was squandered.

    As bad as untyped pointer addition is, writing several files to do ONE thing in Java is worse.
    ZDNet Gravatar
    Roger Ramjet
    7th Apr 2008
  • Ada...
    I worked on a project once with:
    ~3 million lines of Ada
    ~30k lines of C
    ~30k lines of Java

    Pretty much all of the errors were in the C portion, and the
    errors in the C portion were by far the hardest squash.

    I'm not sure why anyone in their right mind would write
    business applications in C.
    ZDNet Gravatar
    Erik Engbrecht
    7th Apr 2008
  • ZDNet Gravatar
    DonnieBoy
    7th Apr 2008
  • "Ada programmer" vs "C programmer"
    Most software engineers I know can competently program in
    a variety of languages. If someone strongly identifies
    themselves with a particular language, it's almost a sure sign
    that they aren't much of a professional.

    And no one was trying to prove that Ada was good and C was
    bad. The existence of C (and Java) in the codebase were
    reflective of limitations of Ada.
    ZDNet Gravatar
    Erik Engbrecht
    7th Apr 2008
  • Still, you have some Ada programmers try to write C code, they have a bad
    attitude about C, and it is the trickiest part of the project (that is why you could not do it in ADA). The results are not necessarily unexpected, a not necessarily a reflection on C.

    I am not convinced that you had the right people doing the C programming.
    ZDNet Gravatar
    DonnieBoy
    7th Apr 2008
  • ~200 software engineers at the peak
    I think we could have found some solid C developers in
    there...
    ZDNet Gravatar
    Erik Engbrecht
    7th Apr 2008
  • Actually - probably not
    Donnie boy's right about this - if a few tens of thousands of lines of C had most of bugs found in a 3E6+ line project, it's pretty clear that your C guys weren't that good.

    In my experience C is so simple that it takes a near genius to understand and use it correctly - you probably didn't have one of those.
    ZDNet Gravatar
    murph_z
    7th Apr 2008
  • Too many cooks spoil the broth ...
    ... you may have had some fantastic C programmers in there, and then a less experienced one uses a (***) to the wrong place, just happy that he got his bit "to work" ... wink
    ZDNet Gravatar
    fr0thy2
    7th Apr 2008
  • Of course we could have more competent C programmers.
    Alas, the problem goes right up the tree to the teaching material. I've seen highly regarded programming books with entry-level mistakes in them, bad explanations, bad code from people who's primary field is, for example, mathematics and all sorts of skimming over important details.

    Maybe this explains why I see so much abuse of preprocessor directives, cludges, workarounds where simple solutions are already available and some of the worst abuse of the stack this side of 1999 with up to four nested intrinsics or, in the case of one FOSS graphics effort, MMX code borrowed from elsewhere with the 16 byte alignment being done after the ASM, which had already done the alignment as this is required prior to the movaps.

    Yes, assembler is essential to efficient programming, it helps you understand why interleaving and loop unrolling work so well and why dividing by the same number more than once is a waste of CPU cycles.
    ZDNet Gravatar
    odubtaig
    8th Apr 2008
  • Learning C makes you a better [anything] programmer
    because you get to learn wtf is actually going on.

    A bit like riding a motorbike makes you a better car driver.
    ZDNet Gravatar
    fr0thy2
    7th Apr 2008
  • Learn assembly first
    I've met people who've worked in C and didn't understand what was going on. It happens all the time. The reason being that C tends to fool people into thinking they're programming in a HLL, when they're really programming in a high level assembly language with strict type checking and high level structures. To see what I mean, check out "Top 10 Ways to be Screwed by C" at http://www.andromeda.com/people/ddyer/topten.html

    Some of the problems described come from the fact that whoever wrote this "top 10" list didn't understand the language that well. I suspect the author came to C from Python. One of the example "bugs" in C's design is its "weird indentation rules". There's nothing weird about them as far as I'm concerned. If people don't like them, use curly braces, for god's sake!

    What I say is learn assembly language first, then you'll REALLY understand what's going on in C.
    ZDNet Gravatar
    Mark Miller
    7th Apr 2008
  • Yes, good point Mark ...
    ... that way learning C becomes a lot easier, and is much more productive too .. happy
    ZDNet Gravatar
    fr0thy2
    8th Apr 2008
  • LOL, I remember my first C class
    That was funny. This list should be more properly titled "Top 10 Beginner C Mistakes". Most would be exposed by lint or any halfway decent programming editor with syntax highlighting.

    I am ambivalent about learning assembly first. I'm not even sure it's necessary to learn C nowadays, but then again I prefer to leave memory management and pointer handling to the machine.

    doug in Seattle
    ZDNet Gravatar
    SnoopDougEDoug
    9th Apr 2008
  • I don't know about learning
    Assembly first, but it is definitely advantageous to learn Assembly regardless of what language you use. To be fair though every language has its gotchas. Even VB.net as simple as it is has several gotchas. I've been burned by an expression like this:

    iif(x=0,0,y/x)

    in c if you write
    if you write: x==0?0:y/x;
    the y/x will never get executed if x is zero; however, vb evaluates both expressions regardless of the value of x so that you end up with a runtime execution. Also enums in vb have given me headaches since the default toString() for the enum is to print the label and not the value. You have to cast the enum to the value type to get it to print out right.
    ZDNet Gravatar
    alaniane@...
    9th Apr 2008
  • Assembly?
    Real men don't need no stinkin' assembler! Real men just
    need ones and zeros.

    ...and REAL CS programs teach machine language, tell you
    what an assembler is, and then tell you to go write one!
    ZDNet Gravatar
    Erik Engbrecht
    9th Apr 2008

Talkback - Tell Us What You Think

Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

White Papers, Webcasts, & Resources