Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!aramis.rutgers.edu!topaz.rutgers.edu!mccarrol From: mccarrol@topaz.rutgers.edu (Mark C. Carroll ) Newsgroups: comp.lang.misc Subject: Re: Relationship between C and C++ Message-ID: Date: 21 Mar 90 20:31:08 GMT References: <8432@hubcap.clemson.edu> <5200048@m.cs.uiuc.edu> <2605a117.396e@polyslo.CalPoly.EDU> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 69 In article <2605a117.396e@polyslo.CalPoly.EDU> jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) writes: ] In article <5200048@m.cs.uiuc.edu> robison@m.cs.uiuc.edu writes: ] ]Why is pointer arithmetic denigrated so much? ] ] ] ]Can anyone clue me as to the basis for pointer paranoia? ] ] I look at it as relating to the temperament of the programmer. Different ] people just respond better to different approaches. It is exactly the ] same issue as the debate between the Mac and the PC. Some like a system ] that provides you with a Good Way to do whatever you want to do (i.e. ] the Mac and Ada) and others like a system that lets you pick your way ] of doing it (i.e. the PC and C). The first way gets the job done and ] doesn't let you make mistakes. The second way gives you a lot more ] flexibility, but you have to learn more and maybe work a little harder ] to get it right. ] Sorry. I couldn't let this float by. Unrestrained pointers are the data structures equivalent of uncontrolled GOTOs. A language like C that lets you do anything in the world that you please with pointers is very similar to a language like BASIC that lets you arbitrarily jump to anyplace you want to in your code. Sure, there's a lot of power in that! But there's a lot of unnecessary "danger". ] There are many different ways to map a problem onto a computer-based ] solution. Different programming backgrounds lead a programmer to ] find his solution in a different way. ] ] I really think that those who are opposed to C, pointers, and all that ] goes with it, are more motivated by a desire to have programming done ] by grunt laborers in a DP shop environment, and have better productivity ] than has been had in the past with Cobol and Basic. Those who like ] C are more of the craftsman type that like to produce finely wrought ] masterpieces. ] This is something that's always annoyed me. Pure language snobbery! "People who program in MY language are the craftsmen", etc. Craftsmanship in programming is largely independant of the language that you program in. I happen to like Eiffel a lot, and I think that some of my Eiffel code is rather beautiful, in a strange way. But this doesn't mean that it's a natural property of Eiffel that people who write beautiful code are going to gravitate towards it. The fact that the C language allows complete, unrestrained manipulation of pointers is, in my opinion, a severe disadvantage to the language. Defenses of it remind of some papers that I've had to read defending the GOTO. I sincerely believe that higher level control constructs are prefereable to GOTOs; I equally sincerely believe that higher level data-structures (like the Eiffel implicit references) are preferable to unrestrained pointers. ] Of course this is just my point of view... ] And this is just mine. If it sounds a little bit harsh, I'm sorry. I don't mean for it to come off as a flame. ] John Dudeck -- \ Mark Craig Carroll: |"Don't believe what your eyes are telling you. / / Student SysProg - LCSR | All they show is limitation. Look with your \ \ Rutgers University | understanding, find out what you already know,/ / mccarrol@topaz.rutgers.edu| and you'll see the way to fly." -Richard Bach \