TweetFollow Us on Twitter

Dec 89 Letters
Volume Number:5
Issue Number:12
Column Tag:Letters

Letters

By David E. Smith, Editor & Publisher, MacTutor

There IS an OOP Book

James Plamondon

San Mateo, CA

I have just received and read my copy of the September issue of MacTutor, and was pleased to discover that it was up to its usual high standards. Unfortunately, I was horrified to see one piece of misinformation presented -- however unintentionally -- as fact, when the truth could be of great use to your readership.

In the article MacOOPs!, by Jean-Denis Muys-Vasovic, on page 102, in the first paragraph, the author says that “Algorithms + Data Structures = Programs”, by Niklaus Wirth, was the book that established the case for structured programming in the seventies. This is entirely correct.

Unfortunately, the author goes on to say that ‘This technology [OOP] has not yet got its “Algorithms + Data Structures = Programs” ’, meaning that there is not yet any single book on OOP that explains its concepts, advantages, implementation, and so on. This statement has not been true for more than a year.

Everyone who has an interest in OOP should run -- not walk -- to the nearest computer bookstore and buy a copy of Bertrand Meyer’s book, “Object-Oriented Software Construction”, published in 1988 by Prentice Hall (about $40). It is without a doubt the most comprehensive, concise, and yet readable book on Object-Oriented Design and Programming to date -- and I have no doubt that it will soon be considered to be as important to the success of OOP as Wirth’s book was to structured programming.

Just as Wirth’s book explained and made the case for block structuring, strong typing, and functional decomposition, Meyer’s book explains and makes the case for object-oriented design, based on considerations of correctness, robustness, extendibility, reusability, and compatibility. Meyer’s book, like Wirth’s, combines the rigorous precision of computer science with the practical aspects of software engineering. Wirth used his own, new language, Pascal, to present his ideas, because the other languages of the time were inadequate. Likewise, Meyer uses his own language, Eiffel, to present his ideas, because no other existing language so elegantly addresses both the theoretical and practical issues of object-oriented design.

Pascal went on to become one of the major computer languages of the seventies and eighties, due to its close association with structured programming. Its commercial use was hampered by the fact that it was designed to be a teaching aid, not a language for software engineering. Eiffel, on the other hand, was designed from the first to be a practical tool for the development of commercial software. Its future is unlimited.

In every discipline, its practitioners struggle for years on the fringes of great breakthroughs -- gravity, natural selection, relativity, plate tectonics -- until some author comes along and puts it all together. That is what Wirth did for structured programming, and that is what Meyer has done for object-oriented programming. I was a geologist during the battles that led to the acceptance of plate tectonics, so I’ve learned to recognize a paradigm shift when I see one.

If knowledge is power, and the future of programming is OOP, then this book will give you the power to control the future of programming. Take the day off, grab the company credit card, go to the nearest computer bookstore, buy Meyer’s book, and don’t listen to another word about OOP until you’re done reading it.

Stop reading this letter! Get moving! Run!

What, you’re still here?

Virus?

George Patail

APO New York

I am new to Mac programming and an avid reader of MacTutor and need your help regarding Mac viruses and their eradication. My system (a Mac II with an 80MB HD) had a bad case of the “hangs” lasting for 15-20 minutes on bootup and when launching applications. I cleared out all the files and reinstalled them after examining each one with ResEdit. I installed Vaccine on my system and it seems to keep a vigilant eye on any attempts to add additional CODE resources. It warns me and asks for the usual permission to let it add or deny access to the CODE resource.

However running LS Pascal 2.0, it asks for permission with the usual message for every source file I try to add to a project. I launched ResEdit and examined my System Folder for any telltale signs of Scores or nVIR viruses following Max Rochlin’s instructions (Mousehole Report, MacTutor June 1988). None were found! However, the LS Pascal application’s CODE id=0’s eleventh word displays ‘038A’ and the tenth displays ‘4EED’. According to MaxR this is a sure sign of Scores infection! But I could not locate any additional CODE segments corresponding to 038A which is two higher than the next, nor atpl id 128, data id -4001, inits 6, 10, 17, _Desktop and Scores files in the System Folder. I checked the master LS Pascal 2.0 disks I got from Think and they too display the same anomalies with 4EED and 038A. Is the LS Pascal infected, or is it normal code for LS? Do you think it is a new strain? It does not seem to spread to other applications so far. But I am at a loss as to how to combat this other than turning Vaccine off, which I don’t want to do knowing if it is safe to run LS Pascal. I am stationed in Heidelberg Germany and the local Apple reps could not answer anything beyond the most elementary questions.

[LS Pascal adds code resources to its project file each time you compile, so naturally Vaccine will intercept the attempt to add a code type resource, like CODEs and CDEFs. My copy of LS Pascal also contained the same words in CODE 0. I have been using VIREX by HJC Software and Vaccine before without a hint of virus troubles. A quick call to Symantec said that the jump table is beyond that point and those are the words that should be there. So my opinion is that you don’t have a virus. I would suggest your ‘hangs’ are due to INITs. One of them is likely to be giving you problems.

If you are worried about virus problems, may I suggest that VIREX or another commercial virus program. It is my understanding that Vaccine is not continually updated as other commercial programs. -ed]

To Paul Onstad

John Baxter

Port Ludlow, WA

As others have noted, the solution to Paul Onstad’s question about opening a resource fork in a desired folder is straight forward (especially for those of us who have been “around” the Mac since the early days). Simply save the current default volume with GetVol, then set the default volume to the “volume” (actually a working directory in most cases) returned by the SFPutFile call (or earlier SFGetFile call if replacing a file). Then use the old resource file opening calls without concern. When completed, set the default volume back.

Furthermore, when rewriting a file as a result of Save, it is not necessary to erase the old file. It is sufficient to set the EOF of the data fork to zero before writing the new data. This will leave the resource fork, the creation date, and the position within the folder as seen by Finder unchanged. Only for Save As should it be necessary to copy the resource fork. [It’s actually only necessary to set EOF to the new value, and then only if the old file is larger. if the new EOF value is known before starting to write the data, this might be preferred.] The SetEOF call takes the file’s reference number and the desired new EOF value, extending or truncating the file as needed. Inside Macintosh, Vol. II, pg. 93.

More Paul Onstad

John H. Roth, Jr.

Chicago, IL

Your new cover style almost lost you a reader-I found your August issue on the magazine rack by accident. For a while I thought you had gone under (perish the thought).

By now, you’ve probably got a dozen letters about Paul Onstad’s resource fork problem. The error from OpenRFPerm is because the new resource fork doesn’t have a resource map. This can be corrected by a call to CreateResFile, after the call to Create but before the call to OpenRFPerm. The sequence of calls is crucial; odd things can happen if Create is not called first. This is explained in Tech Note 101.

The basic misconception seems to be that the Create call builds both forks of the file. Actually, it builds an empty directory entry. For the data fork, Open is then sufficient, but for the resource fork, initialization data has to be written into it before the Resource Manager can do its thing.

THINK C 4.0 Bugs

William Modesitt

Kaneohe, HI

There are two known bugs in the new THINK C 4.0. Both involve scanf. When using the standard library ANSI, scanf will not work correctly for float values less than .1. When using the library ANSI_881, scanf in general does not work correctly for float values. I was told by THINK C technical staff that these were the only known bugs, and they were both rather nasty. The fixes are shown below.

Buggy version:

case -2:
 if (c >= ‘0’ && c <= ‘9’) {
 F.valid = TRUE;
 if (c != ‘0’ || D.sig[0]) {
 if (D.sig[0] < sizeof D.sig - 1)
 D.sig[++D.sig[0]] = c;
 if (F.dot)
 --D.exp;
 }
 }

Correct version:

/* 1 */

 if (c >= ‘0’ && c <= ‘9’) {
 F.valid = TRUE;
 if (c != ‘0’ || D.sig[0]) {
 if (D.sig[0] < sizeof D.sig - 1)
 D.sig[++D.sig[0]] = c;
 } /* paren was moved here from two lines below */
 if (F.dot)
 --D.exp;
 }

Buggy version (881):

register struct decrec *d;
void *p;
{
 short  excp class, c = ‘0’;
#ifdef _MC68881_
 register short *q = p;
 
 p = q + 1;
#endif
Correct version (881):
register struct decrec *d;
void *p;
{
 short  excp class, c = ‘0’;
#ifdef _MC68881_
 register short *q = p;
 
 if (code == FFEXT)  /* add this line */
 p = q + 1;
#endif

Buggy version (881):

#ifdef _MC68881_
 q[0] = q[1];
 q[1] = 0;
#endif
 return;

Correct version (881):

/* 2 */

#ifdef _MC68881_
 if (code == FFEXT) { /* add this line */
 q[0] = q[1];
 q[1] = 0;
 } /* add this line */
#endif
 return;

Once these changes have been made, you should “make” all four ANSI libraries by choosing the make option, check scanf.c, then “make” it. Any projects that you have will automatically load the new ANSI library for you next time you update.

And now for something completely different. I have tried to find a way to determine the current volume reference number or working directory reference number for my current application during run time so I can write to it’s data fork. Along the same line, I think, I would like to do the following: Implement SFGetFile, exit, find out where I am, move to the parent directory, and implement SFGetFile again in the new (parent) directory. What I need is a function called “WhereAmI”. Any help would be greatly appreciated.

Linear Equation Error

Wilfred Long, Jr.

Montgomery Village, MD

In C. H. Friend’s Linear Equations True Basic examples from January’s letters column, he couldn’t produced the output shown in the Multiple Linear Regression” segment by running the source as listed. All the errors are on page 109 in the last third of the program following the REM statement depicting how H-P Basic allows solution of the linear system.

In the MAT PRINT USING formatter for “Coefficients” there should be three leading dashes instead of two and the comma should be a period.

The LET statement in the vector dot-product loop following “residuals:” is incomplete-no product is indicated. It should be written either:

LET Y2(I) = Y(I,1) * Y(I,1)

or

LET Y2(I) = Y(I,1)^2

In the second from the last PRINT USING statement, the variable SSR should be SSA in both instances. There is no variable SSR, but SSA produces the value 399.454 shown in the last results-output line attributed to SSR.

Finally, in the last PRINT USING formatter for variable ES2, the comma again should be a period.

There are a couple of incorrect values in the results-output, but they’ll be obvious when the corrected program runs.

Fulfilling A Dream

Natalia Kolodziejska

Wroclaw, Poland

I am an 11-year old Polish schoolgirl dreaming of an Apple Macintosh.

Poland is full of personal computers. There are many Atari, Commodore, IBM and Sinclair/Timex computers.

There also are other computers in use. However, the Apple Macintosh is absent in Poland. Anyway, I was lucky enough to see and use this computer some times. I am sure it would be my best friend.

However, I have a very little chance to come into its possession by myself. I simply lack the proper means. So, perhaps somewhere in the world there are people or institutions that have one superfluous (used) Macintosh which could be donated to me. (I would also welcome a printer and some software.) Please forward this letter to your readers and friends. Everyone can contact me, even if he or she can help me to only some extent.

Using the Macintosh I could better prepare myself for life in the next century.

My best greetings,

Natalia Kolodziejska

ul. Drzewieckiego 16/4

PL 54-129 Wroclaw

Poland

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.