Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!uakari.primate.wisc.edu!ames!ig!arizona!robert From: robert@cs.arizona.edu (Robert J. Drabek) Newsgroups: comp.lang.c Subject: Re: C style peeve and knowing the rules Summary: opinion Message-ID: <19356@megaron.cs.arizona.edu> Date: 25 Mar 90 04:12:08 GMT References: <2205@osc.COM> <340018@hplvli.HP.COM> Organization: U of Arizona CS Dept, Tucson Lines: 28 In article <340018@hplvli.HP.COM>, boyne@hplvli.HP.COM (Art Boyne) writes: > jgk@osc.COM (Joe Keane) writes: > >Here's my biggest C style peeve. For some reason, many C programmers insist > >on always putting parentheses around return values, even when they're not > > Also, 'while', 'for', 'if', etc., > all *require* parenthesis, so it's a reasonable habit to acquire. But as Joe Keane said, these constructs require the parenthesis for a particular reason and few people understand that reason. Also, Joe Keane made the point that many people put parenthesis in simply because they see other people do it. And there are those who believe return is a function and hence required! I require my students to use the absolute minimum number of parenthesis until they have ALL the rules down pat. After leaving my courses (or in the privacy of their own PC) they'll do whatever feels good, but I will have done my job as well as I can by getting them to understand these details. Please, I know parenthesis are sometimes an aid in producing readable code and they are also clutter which can make for less-readable code. -- Robert J. Drabek robert@cs.Arizona.EDU Department of Computer Science uunet!arizona!robert The University of Arizona 602 621 4326 Tucson, AZ 85721