From: bill AT cafe DOT net (Kaz Kylheku) Newsgroups: comp.os.msdos.djgpp,comp.lang.c Subject: Re: Scripting language library Date: 16 Dec 1997 05:01:20 GMT Organization: Internet Direct Lines: 26 Message-ID: <6751v0$t6d$1@brie.direct.ca> References: <348e5375 DOT 789931 AT news DOT xs4all DOT nl> <3494eaf4 DOT 492512 AT news DOT xs4all DOT nl> <67453a$t1v$1 AT home DOT edu DOT stockholm DOT se> <3495ac96 DOT 1274644 AT news DOT xs4all DOT nl> Reply-To: kaz AT cafe DOT net NNTP-Posting-Host: 204.244.119.1 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <3495ac96 DOT 1274644 AT news DOT xs4all DOT nl>, Hans 'the Beez' Bezemer wrote: >ulric AT evelin DOT edu DOT stockholm DOT se (Ulric Eriksson) wrote: > >>The problem is that your solution (make the newbie learn Hans' Version >>Of C Which Looks Like Pascal) is worse than the problem (make the newbie >>learn C). >Well, that is a point for debate. I'm sure I've prevented many errors by using >these constructions (together with a standard and a list of pitfalls). First >make it work (let 'em write acceptable programs) then improve it (teach 'em >just another way to write the same thing). Defining begin to stand for { and end to stand for } buys you absolutely nothing. All you are doing is polluting the macro namespace. If some header file uses 'begin' or 'end' for any purpose, it will break. Macros should not be used frivolously. If you must define macros in some module's header file, they should be prefixed in such a way that they are identified with the module. An identifier such as 'end' is a poor naming choice for a globally used macro. #include "pascal.h" static char *fill(char *beg, char *end); /* oops */ As far as teaching newbies go, teaching them preprocessor abuses is not a good way to start into the language.