Journal Articles

CVu Journal Vol 10, #6 - Sep 1998 + Francis' Scribbles from CVu journal
Browse in : All > Journals > CVu > 106 (12)
All > Journal Columns > Francis' Scribbles (29)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Members' Experiences

Author: Administrator

Date: 05 September 1998 13:15:27 +01:00 or Sat, 05 September 1998 13:15:27 +01:00

Summary: 

Body: 

CodeWarrior Revisited by Francis Glassborow

While I was exploring Borland C++ Builder I discovered that it gave full support for console applications including such functions as kbhit() (test keyboard to see if a key has been hit). For excellent reasons this functionality is not part of Standard C but it is commonly provided in environments where it can be used sensibly. Actually I wish language standards would provide provisional APIs, that is ones that do not have to be provided but if they are they will meet a uniform specification.

Having got my code to work with C++ Builder I thought I would test for portability by trying it with CodeWarrior. I removed the specialised main() (see my Q&A column) and reverted main1() to main(). CodeWarrior declared that it could not find conio.h. No big surprise. I checked with help to discover that kbhit and getch() were declared in console.h. I changed the name and tried again. No go; the compiler could not find console.h.

Well the help definitely specified that these functions were supported for WIN32 as well as a whole list of other OSs. I tried using Windows 95 'Find file' but console.h was nowhere to be found. The nearest was console_io.h but the declarations in that header where not the ones I needed.

Finally I contacted Full Moon's technical support. Finally Metrowerks came back to say that there was no console.h for Windows. Now there are two things here. Why do the help files say that it is supported? And why isn't it supported? The former real annoys programmers who have wasted time looking for something that isn't actually there. The latter profoundly annoys programmers who know that it could be there and that that would make it easier for them. By the way, supporting it for the Apple Mac and not for Windows adds to porting problems (unnecessarily).

I hope Metrowerks take the time to fix this at the earliest opportunity (by adding the functionality).

Teach Yourself Linux in 24 Hours Applixware (Office Suite for Linux) from Francis Glasborow

The first is a book that includes a CD with Red Hat Linux 5.0 and the second item is software distributed by a book publisher. Rather than review them in my Bookshelf section of Bookcase it seemed more reasonable to cover my experiences here.

Soon after shipping the last C Vu to the printers I thought I had time to get up to speed on Linux and having Applixware on my desk added further motiva-tion. After all I am not so dedicated to Microsoft Office that I would not move to something better.

I found a spare IDE drive and inserted it in a mobile rack on a PC with 64Mb of RAM, an AMD K6 233 and Matrox Mystique 220 (it had a few other extras such as a NEC 4-disc CD autochanger, a 6Gb SCSI drive, a 4 speed SCSI CDROM and a I Gb Jax drive - in other words a reasonably high spec part of my network). I got out the TY book and started following instructions. In reasonable time I had Linux installed. Now all this took place fairly late in the evening so rather than go on to the fourth chapter I decided I would pack up for the evening.

Now I know that Unix systems do not like to be simply turned off but could not remember what to do. I tried everything I could think of to no avail. I can hear you muttering, 'just read the manual'. I tried. I looked everywhere in the book but nowhere could I find any hint as to how to get out of Linux. I finally gave up and decided to see how it would respond to a three-fingered salute (CTRL-ALT-DEL for the ignorant). The worst scenario was that it would leave me with having to reformat the IDE drive (that is why I like using racked drives). Now the developers of Linux are obviously aware of this maltreatment of operating systems by PC users because the system quietly did what I wanted, it unmounted all the devices, closed open software and closed down.

The next day I gave my son a call and he told me that I should have used shutdown. So the next time I tried that. Now do not laugh but that did not work either. Back on the phone to the younger generation who had the grace to apologise for forgetting to tell me that I needed to add the parameter 'now.'

When I related this to another Unix expert he turned a little pale and said that 'shutdown now' was hardly safe and I should have used some other parameter. I am afraid that by that time I was rapidly loosing both patience an interest.

Books for novices really must be test driven by novices before they are published. Test driving does not work if there is an expert present. You really do need to give the material to a novice and leave them to it. If they cannot cope then your book still needs more work. Whatever else you do, having got someone into a piece of software you must immediately show them how to get out of it again.

Teach Yourself Linux in 24 hours has the potential for being a good book but it still needs serious work before it can be used by even the most computer literate of readers. Traditionally Unix was learnt under the supervision of a network manager and/or local guru. Linux breaks that scenario and leads to people trying to set things up in complete isolation. Such products as the Red Hat ones make the installation pretty straight forward but as we have seen, this is only part of the problem.

What about the Applixware? I faithfully followed the printed instructions. I promise you, I did exactly what it told me to. However the results did not match those that the written documentation described. I did eventually get it to work but I do not have time to explore a product whose 'get started' documentation fails. What I saw made me think that the product is probably a pretty fair office suite but the time I had put aside to get familiar with it was burnt up in struggling with the installation. I could no longer risk using the product to do real work (which is the way that I test such products, if you cannot do real work with them without extensive training then they are not of much use).

There are clearly a lot of good features about the current incarnation of Linux. The existence of reasonably priced products such as Applixware make it more attractive. Students for whom low cost is more important than time will obviously find it attract-ive. Students also have a built in support structure. Their computing department probably has a Unix expert to hand and there will probably be a number of Linux enthusiasts around to sort out problems.

Brief Notes

Mobile Racks

My son tells me that the mobile IDE hard-drive racks from Scan are not the same as the ones that I get locally. I gather that the drawers are slightly shorter which makes them less convenient to use (getting a drive to fit is a bit of a struggle).

If you are coming to our conference and let me know before September 5th (yes that means that you need to act now, if you are not already too late) I can place an order for you with my local supplier. They will cost about £12 + VAT.

Falling by the Wayside

ymantec have effectively fallen out of the C++ market and their last version (7.5) is beginning to look too long in the tooth to merit use at any price (there are many features of C++ that it does not support).

Clarion have effectively killed their TopSpeed C++. They bought JPI when the TopSpeed range of compilers were amongst the best in the World but they have done very little with them since. They were clearly more interested in the compiler technology for their database product. Excellent though this still is, I am far less interested in it as a stand alone product. The original thing that made it stand out from the rest was the excellent mixed language programming facility (that included Pascal as well as C and C++). The mantle for supporting good mixed language tools has now clearly passed to Metrowerks (which has the added advantage of supporting several platforms).

Unless Sybase (Watcom) take rapid positive action their hitherto excellent C++ implementation will die because serious users of C++ will want features that it does not implement, Windows programmers have other alternatives and the support for OS/2 seems largely superfluous.

While I am on the subject, Salford Software also need to take urgent action if their C++ compiler is to be taken seriously by C++ programmers. It has a number of exceptional characteristics such as its debugging support and support for linkage to Fortran libraries (particularly important to those using numerical methods) but they need to add support for all the features developed and refined in C++ during the last five years. There aren't that many but what there are, are vital.

User Unfriendly

One of my clients recently bought a new machine. It had Windows 98 installed and he decided that he definitely wanted to go back to Windows 95. No big problem. However when I had finished the message 'Incorrect version in MSDOS.SYS' kept appearing. No big problem. I quickly checked the file, took a look at the ones on several of my machines and decided to replace the one giving errors with a copy of one from elsewhere.

I first renamed MSDOS.SYS (so that I had a copy) then I copied a new one from elsewhere on my network. Finally I rebooted the machine. Chaos. It could not get past DOS. I then remembered that I had installed Windows 95 in a directory WIN95 instead of the default Windows (being careful not to throw away the old installation until I had the new one working). When all had checked out, I had sent Windows 98 to the recycle bin.

Now the problem was that I knew what I needed to do. I just needed to edit MSDOS.SYS to change the directory names. Of course the command line version of Windows 95 is far to protective. It does all it can to protect silly users from correcting errors brought about by being allowed to replace MSDOS.SYS.

Why is attrib so pernickety about changing hidden, read only, system attributes? Yes I got there eventually but did it have to be so difficult.

Comments from Jim Barry

User Friendly?

Your problem with font files not showing up in Explorer reminded me of a related problem that I had recently. I have a dual-boot machine with Windows 98 in c:\windows and Windows NT in c:\winnt. Explorer seems to be rigged so that if, running in WinNT, I go to look at c:\windows\fonts then what I actually get shown is the contents of c:\winnt\fonts. As in so many other situations, I have to open up a command prompt and 'dir' to see what is really going on.

The problem may be related to font files having the system attribute set, but I think it is more than this.

I had a similar problem to yours with Word 97 which recently crashed on me after several hours of editing. I have auto-recovery switched on so I was not too worried until I fired up Word and got nothing more than the usual blank document. I did manage to track down the auto-recovery file in my temp directory. It was locked, but I was able to copy it, rename it with the .doc extension, and load it into Word. I later discovered that the original instance of Word was still there in the Windows NT Task Manager - despite having crashed with an Access Violation! I killed this 'zombie' process and the next time I ran Word, my document was auto-recovered. It seems that the auto-recovery feature is defeated by an application that cannot even crash properly! I am not impressed.

Thanks for the added evidence. It seems to happen to me when I create a new file and then do not save it for some time. My horrible fix is to close everything else that is running and then switch off without closing down. In Windows 95 that just leaves me with a run of scandisk when I reboot. Your solutions seem better. Though we would agree that the problem should never happen. By the way, I noticed on a recent occurrence that, though I had only had one file open, I now had 40 temporary files.

CodeWarrior Professional 3.0

I was a little confused about the problems you experienced. MFC's "home-brew" exception handling was changed to use native C++ exception handling quite some time ago. The __try keyword is actually a Microsoft C extension, so I assume the code in question was written before the Microsoft compiler started supporting proper C++ exceptions. Presumably, changing __try to try would have been the right thing to do, rather than just commenting out the offending lines. You didn't give the number of the unsupported #pragma so I don't know about that.

When I get some time I'll try experimenting, but what do I do about __except and __finalise? The #pragma was comment(lib, "libcpmtd")

Programmers' Editors from David Wright

Like many other programmers I have to work with several compilers and several languages. Fortunately I only have to deal with DOS and Windows, so at least I can easily edit all the files from one operating system.

For a while I had been considering trying out one of the purpose designed Windows based programmers editors with a view to getting a degree of consistency of editing and hopefully a few productivity gains thrown in for good measure. After seeing a tempting looking advert for Codewright I decided to download some of the evaluation versions that are to be found on the www and give them a try (URLs are shown at the end of the article). My plan was to use each editor for a week.

I don't intend to give a feature by feature comparison, but I thought that a commentary on my experiences might be of interest to others.

Since the advert was for Codewright, that seemed like a good place to start. The download page was preceded by a registration form requesting various details, including email address (I later received a "welcome" email, including the support email address). The download page offers a choice of options. For Win32 you can download an 8MB "everything but the kitchen sink" or a <2MB "just the essentials". If you go for the smaller download, the other features can be downloaded later, in 1-2MB chunks (if you book mark the download page there is no need to fill in the registration form every time). I chose the smaller download, but ended up collecting most of the rest eventually. The evaluation period is 30 days (though it said 15 days on the website).

Installation went smoothly and, as planned, I used the program for most of my editing for a week. There were lots of nice productivity features such as keyword & construct completion, selective display, templates, links to compiler or toolkit help files, integrated project aware ftp and a spellchecker that only looks at comments and strings. The program is heavily customisable. Ease of use was such that even during the early stages I was at least as productive as with my normal mix of editors. One of my favourite features was the ability to indent and un-indent selected lines using specific characters. This made it very easy to comment out blocks with // and then just as easily remove the comments. The revision control features were easily adapted to suit my particular choice of RCS.

Since I planned to test several editors I did not go to the bother of setting up each one to work with my compilers, The facilities for compiler support seem fairly common and I found that just switching applications was adequate at the testing stage.

After a week I gave Codewright eight out of ten; very good, but missing that little extra something.

Next in line was ED for Windows (EDW), a less than 2MB download for a 45 day evaluation of the whole thing. No personal details were required before the download could be obtained.

Sadly the first attempt turned out to be a 45 second evaluation as EDW was convinced that my trial period was already over the first time I used the program. I uninstalled the program (at least that worked ok) and sent an email to support to see if they had any suggestions.

I then turned to Visual SlickEdit (VSE). Again there was a registration form to fill in and this time the download was a single ~8MB file for the Win32, 30 day evaluation version. VSE is a multi-platform editor, with versions also available for several other operating systems.

My first and lasting impression was that "slick" was definitely the appropriate word to describe the program. In addition it was every bit as customisable as Codewright. A particularly nice feature is that VSE keeps the last 15 copy buffers (the number is of course customisable) and allows you to paste back from any of them.

My favourite feature had to be the project toolbar. When I loaded my first cpp file into the edit window and the program automatically (and almost instantly) scanned the file to produce a list of class functions in the project toolbar I was truly gobsmacked. ☺ When I found an option to use a Win3.1 style file open (where typing part of the filename causes matching files to scroll into view) I was even happier.

Nice, but not essential, was the readily available "Beautify" feature, for tidying up the layout of C, C++ & Java files according to personal preferences (Codewright includes a similar but slightly less capable "Format Source" option).

There was a slight problem with VSE version control support since I use an older version of MKS RCS than the program was set up for, but (without documentation) I was able to find the appropriate version control definition file and add an additional command set for MKS RCS v5.1

After its week SlickEdit was awarded nine and a half out of ten; delightful to use, but I hadn't found a way of un-indenting with specific text.

By this time I had received further email from Soft As It Gets, the producers of EDW. Apparently there was a glitch in the timeout code of the evaluation version if initially installed during a certain time period. The email contained a small zip file that fixed the problem.

ED for Windows was duly installed and tested. EDW proved to be a very competent editor with great scope for customisation. Perhaps one of EDW's strongest points was inter-file mobility. However I had been spoilt by VSE's project toolbar and was further disappointed when I failed to find any support for working with a version control package. The fourth editor up for inspection was Multi-Edit for Windows (MEW) from American Cybernetics. Their evaluation version amounted to 2.6MB for the 32bit version and 1.2MB for Win3.1. A DOS version is also available.

Rather than being time limited, the evaluation version of MEW pops up a nag screen every 15 minutes. The spellchecker is not included in the evaluation version.

If MEW had cropped up earlier in my tests it might have done better, but by now I was spoilt. MEW was just as comprehensively customisable and feature packed as the other products, but the interface didn't appeal as much as VSE or Codewright. MEW had the most comprehensive "out of the box" support for my revision control system, but unlike Codewright & VSE I could not see a way to edit the revision control setup if you wanted it to behave slightly differently. The favourite feature would have to be "Load the file under the cursor". I later found an "open include file" in Codewright which served the same purpose.

MEWs automatic code expansion for C/C++ included an odd "feature" that I would have wanted to edit out if I had continued using the product. All the editors offered some form of automatic expansion of common constructs. Taking "if" as an example, typing "if" followed by a space usually produced something like:

if ()
{
}

Naturally there were options to suite various preferences regarding the positioning of braces.

MEW however produced:

if ('expression')
{  
  'statement'
}

In either case, after expansion, the cursor was placed ready to type the condition. In the case of MEW, the text 'expression' was highlighted, so as soon as you started typing it was deleted; the 'statement' text however needed to be selected and deleted. Whilst I can perhaps see some usefulness in the 'expression' and 'statement' text for an absolute beginner I imagine that even there its usefulness would be limited. As a standard feature (all be it one that can be edited out fairly easily) it seems strange in a product that aims to reduce the number of keystrokes required.

At the end of the trial Codewright and VSE were neck and neck. I almost decided to go for VSE but when I discovered that Codewright too had a "project" toolbar I decided that I had found the "little extra something" that I had been missing.

Overall, my conclusion is that any of these products could be someone's perfect choice; they are all impressive and all have particular strengths. I haven't even covered all the available editors, since I have just seen an article mentioning CRiSP, another multi-platform programmers editor.

I now await delivery of my full copy of Codewright and am hoping that it will get here before the evaluation version runs out. I have allowed a week, but when you live off the coast of North West Scotland you quickly learn just to smile knowingly when you hear the phrase "it should be with you sometime tomorrow, sir".

URLS:

Codewright (Premia) http://www.premia.com/

Visual SlickEdit (MicroEdge) http://www.slickedit.com/

ED for Windows (Soft As It Gets) http://www.getsoft.com/

Multi-Edit (American Cybernetics) http://www.amcyber.com/

CRiSP http://www.pacemaker.co.uk/crisphom.htm

Thanks, this is just the kind of material that adds value. I hope other members will now feel encouraged to contribute their experiences. For example, it would be nice to have a comparison between CRiSP and one or more other editors. I believe that CRiSP supports a degree of user selected colour coding. To what extent is this supported by other editors? Another thing that would be useful would be for members to list the features that they find most useful.

Perhaps our Webmaster can negotiate reciprocal links with the above sites as well as with other potential candidates.

Borland C++ Builder, a highly individual viewpoint from Allan Newton

I should preface this note by making it clear that I am physicist who programs from time to time, not a full time programmer. I accept that some of the problems I describe are associated with this as much as with Borland C++ Builder.

C++ Builder is a C++ version of Delphi, that is to say it is form-based and it allows the programmer to create useful, attractive and powerful user interfaces by dragging and dropping components onto forms. The components generally respond to user events or user code. C++ Builder makes it very easy to write code to follow these events, a few clicks of the mouse in the forms and the windows associated with the IDE and empty functions are placed in files ready for the user to insert the real code. A typical application of mine has, say, six input edit boxes, 10 output edit boxes and a "GO" button. The user enters the data, presses GO and the results come back. This is trivially simple and takes just a few minutes to create a workable user interface. Clearly a day or so devoted to the task will give a fantastic interface. Borland have helped the process by providing string classes with conversion functions to integer and double types, they even fit these functions with exceptions so that even the most novice of programmers can catch input errors, write a meaningful error message and allow the user to re-enter the data. For someone with my background to be able to take care of such important aspects with so little trouble is almost beyond belief. Facilities like this are so welcome that it seems churlish to mention that they do not work when running a program from the debugger, so you have to leave the IDE and run your program from Win95 to check your error trapping is correct.

However what is almost beyond belief is the status of some of the sample third party components supplied with the program. I am referring to Borland C++ Builder 3.0 which was released earlier this year. Reduced performance copies of several third party components are given away. These can be frustrating because the documentation often quotes example code in Pascal or Visual Basic, this can require a degree of translation that is annoying at the best of times and particularly frustrating in a product whose avowed aim is to make the creation of code simple and error free!!

The reduced performance includes aspects such as only a few points in a graph, not all functions implemented etc. Still one assumes that these items are given away to entice you to buy the full version, indeed one product does invite you to do exactly this. Having found two of the sample components that looked as if they could be particularly useful to me I decided to check that the full versions would come with printed manuals and code samples in C++ rather than Pascal or Visual Basic. The manufacturers reply was:

"The versions of our products supplied with Borland C++ Builder are older versions of our products. However, we do not currently test or support our products in this development environment. The new versions do come with printed users guides. Our website does have environment specific pages which do have some examples of code in C++ and Basic. Thanks for the inquiry."

In other words a sample product has been sent out with C++ Builder and I am invited to then buy the full product that is admitted to be untested and unsupported. Being aware of the problems with getting publicised support I guess my chances of support for this product in this environment are exactly zero.

This leaves me with a quandary, I like BC++ Builder for its ability to create user interfaces but the standard product does not cover all my requirements, the third party applications that I am invited to buy to fill in the gaps are not tested or supported. It is possible for me to write code for these purposes but the whole point of concepts like BC++ Builder is that I can do what I am good at (optics) and let other people do what they are good at (specialised OCX writing). I could move to Delphi but then I have to learn Pascal. Finally I could leave Borland after many years and buy Visual C++.

Overall I am left with a feeling of considerable frustration, a superb product that just misses the mark as far as I am concerned. I know that a proper professional programmer can code his way around these problems but then he could use OWL or MFC in the first place and does not need the special features of BC++ Builder.

Notes: 

More fields may be available via dynamicdata ..