What do you do when you live in a "dead spot"? That's what AT&T told me. I live in a dead spot. It all started when I learned that for a flat monthly fee I could get a cell phone that includes some number of minutes of long-distance calls from anywhere to anywhere in the continental U.S. and no roaming charges. My current service does not include the long-distance feature and I pay roaming charges whenever I use the phone outside the reaches of BellSouth Mobility. Some simple arithmetic revealed that my average monthly long-distance bill and my local cell-phone charge would be more than offset by the AT&T all-encompassing monthly charge. The roaming charge removal was an added incentive because I travel a lot.
I called the local AT&T rep and signed up. He sent me a pocket-sized cell phone with instructions on how to set it up. It seemed to work except that my voice and the voice of whomever I called broke up a lot, so much so that meaningful conversation was not possible.
"Hell..."
"Hi, thi...i...Al.
"Wha...?"
"Can I spea...to Char...?
"Wha...? I ca...hear...You're break... ...p."
I called the AT&T sales rep who told me to call tech support (on my land line, of course). The nice lady who took my call began by asking how many stair steps do I have? This is a one-story house, I answered, no stairs. No, no, she said, the cell phone has a little LCD stair step display to indicate the signal strength. The picture of the phone on the box it came in had five stair steps. I didn't have any stair steps on my phone. We discovered that if I went to different parts of the house I could get one or two stair steps intermittently. Not enough consistent stair steps to complete a call. Do I have a tin roof? No, but I have a cat. She sent me out into my yard (my land line has a portable handset, so I took her outside with me). From my driveway I could get two stair steps more frequently than not. Would I be willing to make all my calls from the driveway? No, we get a lot of rain.
Finally, we agreed that I just don't get a strong enough signal at my house. She asked where I live exactly and then blamed the problem on my proximity to Kennedy Space Center (15 miles away) and Orlando International Airport (40 miles away). All those antennae and low-flying aircraft and space shuttles, she said. I said that was silly. People use their cell phones all over the airport and at the Space Center. You see them walking around making important calls all the time. After sending me a replacement phone to try, which did not work either, AT&T decided that I live in a "dead spot" and asked for their phone back.
This is depressing. First, you are told you live in a dead spot, and you go into denial. This lasts for a while as you see others using their cell phones in their cars and at the mall, people who obviously do not live in dead spots. Eventually, you realize that you need help. The first step toward recovery is to admit to yourself that you live in a dead spot. After that it's one day at a time. I can't find any support groups or programs for people who live in dead spots. If anyone of you has the same problem maybe we can get together and help one another. When you feel the effects of living in a dead spot getting the better of you, you can call me any time of the day or night. I'll hurry over to your house and stay with you until the crisis passes, during which we can get drunk together. Speaking of cell phones...
About 50 years ago, the Ink Spots sang, "I love coffee, I love tea. I love the java jive and it loves me." Java jive. How prophetic. I thought Java was an improved programming language that looks something like C++ but with a more object-oriented programming model and fewer of the legacy C idioms that trip up programmers, a language intended to be interpreted and platform-independent so that programs written in Java can be run without dependence on a specific platform. That's what I thought.
The "Preface" to The Java Application Programming Interface, Volume 1, (Addison-Wesley, 1996) by James Gosling, et al. says, "Java is a general-purpose object-oriented programming language." The book goes on to explain that Java evolved from a language designed to write consumer device embedded applications into one for writing platform-independent applets that could be run from within HTML pages by Java-enabled web browsers. This three-year-old explanation tends to reinforce what I thought.
Recently on 60 Minutes, Scott McNealy, CEO of Sun Microsystems, said something that challenges that idea. When CBS correspondent Lesley Stahl asked if Java was going to make Windows obsolete, he said, "Windows is obsolete," and went on to say that people don't need Windows anymore, that all they need is Java as the engine that drives their computer-based appliances. He illustrated this notion with a cute little cell phone that opened like a clam shell to expose a tiny screen and keyboard similar to a Windows CE HPC device. Only it wasn't Windows CE, it was something else. Java, we are led to believe, running a Swiss Army personal information and communication device.
In an unrelated article about Microsoft's problems with the Department of Justice, Charles Cooper of ZDNet Tech News said, "...this was a time when excitement was building [at Microsoft] around Java as an alternative to Windows."
What? What are these guys talking about? Java can't be an alternative to Windows. Windows is one of the foundation platforms that support Java. The alternatives to Windows are UNIX, OS/2, the Mac OS, the embedded OS of your favorite appliance, and so on. But these spin doctors seem to be telling us that Java is itself a full-blown operating platform and not a programming language that rides on some other language-independent platform. I've seen TV ads that convey that same false impression, too, as if there is some need to persuade the public to get on board and embrace Java instead of Windows. But then I read Sun Microsystem's own Java Platform web page (http://www.sun .com/java/platform.jhtml), which says:
If you're reading this in a web browser on a personal computer or workstation, you've probably already got the Java platform. It's incorporated into all major web browsers.
So what am I missing? Give someone a computer and Java and what do they have? Nothing useful. Java needs more, something underneath, doesn't it? Java all by itself does not understand display devices, file systems, pointing devices, and so on. In other words, it's no more or less an operating platform than C++ or Basic are operating platforms. You have to have an operating system. You have to have an operating environment. "All major web browsers" implies not only an operating system, but device drivers and a graphical user interface to integrate the display and input devices into a common user interface and onto the hardware platform. Then you need the web browser software itself on top of the operating environment and underneath Java. Which says that Java is at least two layers removed from Windows in the hierarchy of what you need to run programs on a PC.
Am I wrong? No, I'm right, according to Sun, itself. In "What is the Java Platform?" (http://java.sun.com/docs/white/platform/ javaplatform.doc1.html), Sun says:
The computer world currently has many platforms, among them Microsoft Windows, Macintosh, OS/2, UNIX and NetWare...what sets the Java Platform apart is that it sits on top of these other platforms... [italics added]
There is nothing particularly new and innovative about a language translator that sits on top of an operating system and interprets bytecodes (remember Pascal? SmallTalk?), but the point is that Sun's own online documentation contradicts what McNealy spoon-fed to 60 Minutes viewers.
Agreed, you don't need Windows specifically to run Java applets, but, on a PC, what are the alternatives? Linux and OS/2 come to mind, but that's not McNealy's point when he says Windows is obsolete. He implied that his little multifunction cell phone and all the other Java-enabled consumer appliances -- TVs, pagers, electric toothbrushes, vibrators, whatever -- have eliminated the need for desktop PCs, which is why, in his view, Windows is obsolete. Windows is obsolete, he says, because you don't need the machine that Windows runs on. Maybe someone should make McNealy do a spreadsheet on that tiny keyboard; or write a report; or view anything of substance on the web. Maybe someone should explain to him the difference between his own Java Base Platform and the still-evolving Embedded Java Platform, which are described in the same web page.
What I saw on 60 Minutes was typical flim-flam: McNealy confessing his technically challenged background; McNealy giving a speech while cruising the stage on rollerblades; McNealy playing hockey to show what a hard-driving, competitive guy he is; McNealy talking down-home trash and taking advantage of the relative technical naiveté of the viewing public to promote his company's agenda, which these days is to bash Microsoft. Lesley Stahl bought it hook, line, and sinker, so maybe others will, too. Not us programmers, I'll wager.
I do not mean to belittle the importance of Java as a development platform that spans operating platforms and runs applications identically everywhere with the Internet as the ultimate operating platform. I hope and believe that Java, or something that falls out of it, will achieve that objective. But Java as an alternative to Windows? That's like buying a steering wheel instead of a car.
In January, I introduced the Editor project, a programmer's editor that I will eventually integrate into Quincy 99, the Windows-hosted IDE that serves as a front end to a GNU C/C++ compiler, a project that I launched in December (http://www. midifitz.com/alstevens/quincy99/). I built a custom editor class to support large text files, which CEdit does not do, to provide a comprehensive undo/redo feature, which CEdit and CRichEdit do not have, and to have an editor that is independent of the Win32 API in case I decide to port Quincy 99 to a different platform some day. Having struggled with text editors in the past and being aware of their particular problems, I wanted to use the std:: container classes to implement text documents in memory. It seemed that such an approach would make the problems of accounting for lines of text simpler to manage. I found that to be true.
By now, several readers have downloaded the editor (http://www.midifitz .com/alstevens/editor/) and experimented with it. Some sent comments and bug reports, which I addressed in code and uploaded. The most prominent problem was caused by my requirement to support longer files than CEdit could manage. Whereas I addressed the CEdit limit of file size based on byte count, I failed to address a problem in the Win32 API that shows up with files that have a lot of lines of text. Until I heard from the readers, I didn't even know that the bug was there. The solution is simple but was also unknown to me.
The problem is with scrollbars and scroll thumbnail buttons. A program typically uses the CWnd::SetScrollRange function to set the range of values that represents the length (and width, too; I'll just discuss the vertical scrollbar here) of a document as it relates to the scrollbar. Text documents represent their lengths in lines of text. The program does this when it loads the document and whenever the number of lines of text changes because of editing actions by the user. The program then uses the CWnd::SetScrollPos to set the position of the thumbnail button to be some value within the range, usually the line number of the line of text that is displayed at the top of the window. The program does this whenever the user scrolls or pages the document. The problem is that those functions use int parameters to represent the range and position, and ints under the Win16 compiler were 16 bits. Since the run-time part of the API has to support Win16 programs, the arguments are kept within the range of a 16-bit integer even though an int under Win32 is 32 bits. The CWnd::OnVScroll and CWnd::OnHScroll message notification functions similarly report the scroll position as a 16-bit quantity.
The solution, for which I am indebted to readers Ben Constable and Gerald Schwartz, is to use CWnd::GetScrollInfo and CWnd::SetScrollInfo. The application's overridden OnVScroll and OnHScroll functions ignore the UINT nPos argument that Win32 passes and call CWnd::GetScrollInfo to get the nTrackPos data member into a SCROLLINFO structure to use as the scrollbar's position. To set the thumbnail position, the program initializes the nMin and nMax data members of a SCROLLINFO structure and passes the structure's address to the CWnd::SetScrollInfo rather than calling CWnd::SetScrollRange.
Ben and M. Werner both reported a problem with how I was dealing with the size of the text font, a problem related to platforms other than what I have here. They both offered code to correct the problem. I really like this kind of beta testing; the testers not only find the problems, but they fix them too. Doesn't leave much for me to do.
Thanks also to reader Jean-François Paillard for reporting and fixing a really stupid bug. When I implemented the text search feature I included the ability to search forward and backward like most text editors do. The only problem was that I didn't bother to test the backward operation when searching for a string that does not exist in the text. Naturally, that was the operation that killed the program. Well, what else could you expect from a programmer who lives and works in a dead spot?
DDJ