Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 07 Jun 2012 02:51:30 -0500 From: "Chris Uppal" Newsgroups: comp.programming References: Subject: Re: If "rigid rules" are the wrong way... Date: Thu, 7 Jun 2012 08:50:45 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 46 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-cbjTcUchNGzUT4u6qxAHkvnOd3RL84lvV+lCCj11BpMtBYkUXmLqBFkFtOp+dZbl86rMSJoJTsJTGhu!EWjkds9Y+T5nm/5VBZRGXata5J+Ub+6CZnEnGF7tc5G3qNvH+ZiJQfLw2dGfOqr4ELv2jzFihv4= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3557 Xref: csiph.com comp.programming:1735 mike3 wrote: > [..] So where does > one get that knowledge, so that one can then actually do it right, and > after doing it right, not worry so much about "smells" and the like, > since then one will be able to know when to apply the rule and when > not to. Which books would one need? But I suspect also a lot of it is > practice work. But first you need to know the right thing to > practice... otherwise you can end up developing bad habits. How does one learn to write good English ? It's certainly not a matter of memorising the "rules" of English (either the real grammar or the long list of forbidden forms that people do actually use). How does one learn to write good poetry, or a good news report ? Obviously practise is part of it. Good examples too. But they are much more easily found in English than in programming -- if only because reading a good book is more fun than reading a good program. OTOH nobody is paying you to learn to write better (or speak better) English. Probably. But two other things, equally important in my view: One is to accept fully that programming is an act of communication (talking of "instructing the computer to do something" is simply missing the point). Think of your code (and comments) as yourself addressing the hypothetical audience, explaining your understanding of the problem domain, and your approach to solving the various issues that arise. "Programming as oratory", you might say ;-) This is the core and the heart of the subject. Second is that practise by itself is not worth a lot. There has to be a continuous, conscious, effort to learn from the practise. To analyse what you are doing in terms of what is right (works well in all ways you are aware of) and what is not (ugly, convoluted, slow, misleading, brittle, etc. etc). Aim for perfection -- making the results "good enough" is fine (by definition, in fact), but the you should be /judging/ the code against perfection, even when you aren't aiming for perfection in actual results. I don't think books (and similar) help a lot, except perhaps as a source of ideas. If you do read a book (article on the web etc) treat it as an exercise. Surround it, in your mind, with the words "This author claims that ...", "... Discuss.". You can do the same with any "rules" you come across. -- chris