From: boris Date: 2002-01-16T00:29:36+09:00 Subject: Re: Small Methods - a ramble On Tue, Jan 15, 2002 at 11:33:05PM +0900, Ron Jeffries muttered... : On Tue, 15 Jan 2002 13:12:02 GMT, Chris "boris" Ross : wrote: : : >My teacher at school alway wittered on about meaningful identifiers (this was : >in pascal) and so I then made a point to make each variable name 256 : >characters. He was less than pleased - but it was readable : >BecauseWeHadToWriteThemLikeThis :) But even to this day I still stick to : >hacking out a method using bad identifiers and then go back and give them the : >correct names (once I actually know what they are for) - most people seem to : >forget the second step =P : : Maybe sometimes even /you/ forget the next step: I know I do. Oh of course it's inevitable that I will forget - I'm human aswell. : So as I program, I think about what I'm intending to do. If I'm : intending to create a variable that contains all interesting file names, : I call it something like interestingFileNames or interestingNames or at : least fileNames. I dont tend to do things that way - I tend to hit the problem by writing code - and adding variables to make it work. I then review what those variables I have added (usually because they have been given some short name) - if the name works and follows convention (eg. i, j, k for loops) I leave them. : I find that focusing on my intention makes my code better, and writing : down my intention makes it less necessary to clean up after. I find that starting off with meaningful identifiers and making sure that I get those right from the outset tends to remove my focus on the issue - which is getting a block of code working. I am by no means saying that I am correct :) Just highlighting the way I (badly?) go about things :) Regards, Chris -- Chris Ross (boris) [ chris@darkrock.co.uk, http://www.darkrock.co.uk ] [ (chris|boris)@ferite.org, http://www.ferite.org ] "Sign: "Salesmen welcome - dog food is expensive.""