Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!DECWRL.DEC.COM!joel From: joel@DECWRL.DEC.COM Newsgroups: comp.windows.x Subject: Object-oriented programming and the X toolkit Message-ID: <8801230105.AA28529@gilroy.dec.com> Date: 23 Jan 88 01:05:33 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 As the one who gave the X toolkit its object-oriented flavor, I understand and sympathize with the trepidations expressed by S. Chu and K. Kimbrough. Yes, it is all done by convention; no, C doesn't help a bit. As I stated at my talk, I wouldn't choose C as the first choice for any programming task. The lack of type-checking causes me to waste large amounts of time when I actually try to debug my C code, and waste even more time if I have to change a parameter list. (Don't even mention lint, or I start foaming at the mouth.) But there are certain unavoidable facts of life to be considered. I referred to C as "the MacDonalds of programming languages." While I wouldn't want to eat (oops, use) it everyday, it is available in every UNIX installation, those installation generally have reasonable debugger support, and lots of people know how to program in it. I can't say the same about C++, nor Objective C. And anyone who used the early C++ releases knows how hard it was to debug the output of the preprocessor, so I'm not happy about that suggestion. I find programming anything in C painful. I find programming widgets using the toolkit slightly more painful than normal, because lint can't tell you that you assigned the wrong procedure to a class record, or that you are calling a class procedure with the wrong parameters. But note I said only "slightly more painful" and not "an order of magnitude more painful." I would rather have written the toolkit in Modula-2 if given the choice, even though the lack of initializers would have made writing class records a gross annoyance. Better, I would rather have first designed a strongly-typed object-oriented programming language, then written the toolkit in that. I would rather have used C++ than C. But we didn't consider any of those as viable options then, nor do we consider them so now. All of Athena software goes out "free," and is written in C to make it as widely usable as possible. The toolkit is no exception. - Joel McCormack (joel@decwrl.dec.com)