Path: utzoo!attcan!uunet!husc6!mailrus!ames!elroy!cit-vax!chi From: chi@cit-vax.Caltech.Edu (Curt Hagenlocher) Newsgroups: comp.sys.mac.programmer Subject: Resource Manager (was Design Philosophy) Summary: I (heart) the Resource Manager! Keywords: resources Message-ID: <7146@cit-vax.Caltech.Edu> Date: 5 Jul 88 03:19:31 GMT References: <434@dogie.edu> Reply-To: chi@cit-vax.caltech.edu (Curt Hagenlocher) Organization: California Institute of Technology, undergrad slaves Lines: 43 In article <434@dogie.edu> terranova@vms.macc.wisc.edu writes: > A friend of mine recently expressed his disapproval of the standard >Macintosh program design. Rather than putting windows, menus, icons, >def procs, strings, controls, etc. in resources he would prefer to >hard code everything into the program and make heavy use of #define >statements. He would change the #defines instead of the resources. >"That's why they made the preprocessor." > > I am interested in other peoples thoughts on this. In my opinion, the Resource Manager is the one of the best ideas implemented on the Macintosh. This is for many reasons, including the possibility of modifying programs without recompilation, but mostly for the extremely easy to use interface. I think that concept deserves its own sentence. The Resource Manager is just plain easy to use! The Mac is almost based around the Resource Manager. Windows, menus, palettes, icons, patterns, controls et. al., are all set up to work smoothly with it. Programs such as ResEdit allow one to create resources simply, and modify them with a minimum amount of effort. Things just don't get any easier! > His method is simpler to get some code running. In fact, I use >quite regularly for this purpose. Then, once the code runs the way I want >it, I move data and def/filter procs into a resource and change NewControl() >to GetNewControl() (for example). I don't share this opinion at all. All sorts of gross data structures have to be dealt with, and vast amounts of code are required to set up anything other than the simplest window. All this can be replaced to just a one-line call to the Resource Manager: "Handle = GetNewStructureOfYourChoice(resource #)". As to your question about "the REAL world," every program I've looked at uses the Resource Manager for all these things. I think it's actually required by the Apple Thought Police - er, I mean the Interface Guidelines. This is so that programs can be easily modified to work, say, for Arabic and Kanji. Finally, your friend was joking about the preprocessor, wasn't he? :-) -- ...!ames!elroy!cit-vax!chi "Although we held the whip, you chi@cit-vax.caltech.edu know we were the real slaves." Curt Hagenlocher -XTC