DWUTKA at marlow.com
DWUTKA at marlow.com
Wed Aug 11 15:40:45 CDT 2004
JC, have you ever gone to the DMV, or some other beauracratic office, and spent hours doing something that should have taken 10 seconds? Ever been in a store, or office where you sit and watch someone go through torturous paths on some developed software, because you want to change your phone number in there records? These are the after effects of someone's 'deemed' best practices. If I had a contract job, like the one you discussed below, I would do as the client asked. But when developing other software, which did not have such client restraints, then I would use the method that I work the fastest in, and find the most convenient to use. That saves my clients time and money. It's not lazy, in fact, you could say that you're being lazy, in applying one clients 'demands' on all of your clients, so that you don't have to change mindsets. <Grin> Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John W. Colby Sent: Tuesday, August 10, 2004 9:06 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Naming Conventions >would you really want: Dim lngFieldCollectionCounter As Long No, I'd want lngFldCnt. In my world: lng is an abbreviation for long (everywhere) Fld is an abbreviation for Field (everywhere) Cnt is an abbreviation for Count or counter (everywhere) I DO use EXACTLY that syntax in that situation. I would NEVER use i in that situation. I do NOT switch on and off my use of naming conventions "because it's just a little piece of code". A million line program is nothing more than 100,000 little pieces of code. I wrote code for a small company out in Carlsbad, CA called Puritan-Bennett. They make ventilators. That is life support equipment. They do things differently simply because the FDA (or some such government agency) forces them to. If your code fails someone could die. They do code reviews. Three man teams that look at EVERY line of code. You take notes, which are published. You fix ALL issues found in the code review. You do another code review. You review the code line by line, looking for issues, but also looking for fixes to the issues found last time. You take notes which are published. You fix every issue found in the code review. Repeat until no issues found. They have written guidelines. Things like: No magic numbers (you must use named constants). ALL case statements have an else that logs an error message if you ever get there. Comments! Naming conventions ALL the time. Dimming all variables, always, with explicit data types. Comments! Using exactly the data type needed. NO automatic coercion (no depending on the compiler to get it right). If you want to coerce a variable you do it explicitly. Comments! Etc. and many many more! You do it that way or you find another job. The things they do are not bad, in fact they are very useful. A little extreme sometimes but very useful. You learn good programming practices and you use them. ALWAYS, not just when you feel like it. 10 (no, closer to 15 years) later I still use many of them. I would love to do code reviews but they just aren't possible in the situations I find myself in nowadays. By the way, these things mentioned above (and more) are simply known as best practices and you can find white papers and even books that describe them in detail. I did not make them up, nor did Puritan-Bennett. They exist because companies found that the costs of best practices are far outweighed by the costs of fixing the bugs that lack of best practices allow to exist. You make up some example to justify lazy programming. There is no justifying lazy programming, just admit that you don't feel like doing it (and nobody is forcing you to do it) and get on with life. John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com Sent: Tuesday, August 10, 2004 4:58 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Naming Conventions Okay JC, if I did this: Dim i as Long Dim rs As Recordset Dim strFieldNames as String ....(Opening Recordset) For i=0 to rs.Fields.Count-1 strFieldNames=strFieldNames & rs.Fields(i).Name & ", " Next i strFieldNames=Left(strFieldNames, Len(strFieldNames)-2) would you really want Dim lngFieldCollectionCounter As Long ????? Give me a break! Drew -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com