|
Good Software ToolsWhat are the criteria that determine good software tools? Click for HTML. Which compiler?Brandt Irion asks via email: "Dear Mr. Roth: I read your review of the C++Builder 5 Developer's Guide in August's DDJ. I found it helpful. I would like to move up from the Borland TurboC++ for DOS compiler to a windows C++ compiler. When I compare MS-VisualC++ to the Borland C++Builder I wonder if Borland is at a disadvantage because the VisualC++ code writers at Microsoft have access to all of the source code, nuances, & "back doors" of the Windows operating system and the Borland code writers do not. Is this a valid and significant issue to consider when choosing compilers? Thanks. Brandt Irion." My response: Hi Brandt - Thanks for the kind words. As to
your questions: "It depends." What Language?What language should be used to write programs? Click for HTML. Delphi Informant Article Considered HarmfulThe article "object vs. class" by Aleksandr Gofen, "improved" by Dr Manfred Mackeben, [Delphi Informant Vol 5 No 7, July 1999] is a disaster. Besides being poorly organized, the article is incorrect in its statements on scope, global variables, the use of constructors and destructors, memory management, class hierarchy development, inheritance, and polymorphism. Given limited time and space, it is possible to comment on only a few flaws in detail. click for HTML Maps (Associative Arrays) in DelphiIn a recent project, I needed to reference material properties by the name of the material. I started off thinking something like this: type MaterialName = (steel, aluminum, bronze, copper); MaterialRec = record modulus: double; // other properties end; var Materials: array[steel..copper] of MaterialRec; Then, to set values into the array, I would fill a MaterialRec and install it at the appropriate index:
Using an array as a container is quite legible and maintainable. But the real problem I faced was how to deal with materials whose names I did not know. The clients of the code were going to provide their own strings as material names, so I needed some way to access properties by using a string as an index. This would allow me to write code like
An array with these properties is called a map or associative array. If youd like to learn how to build this data structure, click here to download both the text and the code. I presented this topic at the June 3, 1999 meeting of the Capital PC User's Group Delphi SIG. The Microsoft Word doc and the Delphi source code can be downloaded by clicking here. [ Note: this article is rated 'advanced'. ] PolymorphismPolymorphism is a slippery subject. Although I have had no time to work up text to go with this Delphi 3 code, & there are hardly any comments, (hey, it's free) you may download (3,352 bytes) it and experiment with the virtuality of various functions, especially CloneSelf. Note that I cannot support this code by email, but rather discussion should take place in the Borland newsgroups, preferably borland.public.delphi.objectpascal. Creating a Robust, Type-safe TList[Revised 2002 July 31] Edited from Delphi Developer magazine of Oct 97 (www.pinpub.com). Why and how to make your TLists type-safe in all versions of Delphi, and how to make your lists own their contents (or not). This is the theory behind TeoList and TeoOwningList, our TList derivative classes. You may download these classes for free. Note that Classbuilder for Delphi now optionally builds TLists for the classes it generates. Click here to download the article. Nice and NicerFirst published in the August 1997 issue of Delphi Informant magazine, this edited article and accompanying source code demonstrates the minimum requirements for high-quality Object Pascal classes. If you're thinking of investing in Classbuilder for Delphi or ClassBuilder++ for C++, this discussion of theory may prove helpful. Click here to download. Moving from Fortran to Object PascalAn attempt to explain object oriented programming from the Fortran perspective. Click here to download.Object Based Storage Management in Fortran77First published in The Fortran Journal, this article includes the code for a simple storage manager object, and shows how to use it to make your Fortran77 programs more robust. Click here to download. Automating Object Based Fortran programmingThe documentation and awk source code for waso and wado, the two tools that "automate" Object Based Storage Management in Fortran77. Note that these tools are offered as is; no support is available. That is: NO support. Click here to download. |