Re: null terminated strings
- From: Dave Froble <davef@xxxxxxxxxxxxx>
- Date: Fri, 10 Feb 2006 16:23:34 -0500
Karsten Nyblad wrote:
Dave Froble wrote:
Karsten Nyblad wrote:
Dave Froble wrote:
I'm in the minority on this issue. I'm aware of that. Most of my career has been writing new stuff, and most of the maintenance is on stuff I wrote. Not declaring variables hasn't been a large problem for me. That said, I'll agree that it's safer, and better in many instances.
When using local temporary variables, it is nice to not have to declare such.
Even a programmer with a poor typewriting does not use that much time typing the code his writes. The programmer uses much more time for reading, debugging, and understanding the code. Thus languages should make code readable, easy to understand, and as many errors should be caught before debugging. Say your finger slips, such that you get a new implicitly declare variable. It will take you much longer time finding that bug with a debugger than if it is reported by the compiler.
Well, it can be caught by the compiler. I have utilities that will parse the /LIST output of the compiler, and report on variables that are referenced only once. I can then check out such, and determine whether it's a typo, or something brought in with some boiler-plate sections of code.
Well, then you had better not make the same typo twice. Being bad at spelling I could easily make the same spelling error twice. I have a hunch that writing and using that utility has taken you a sizable fraction of the time you have save not writing declarations.
I have been very successful without declaring variables. You may have different experiences.
Further, you will have to use more time for proofreading your code, because you have to look for faulty typings.
Proof reading your code is a bad thing ??????????
Certainly not, but proofreading to find errors that could be found automatically is a waste of resources. And you can look for only so many different types of errors at a time.
At last it will not be as easy to maintain, because later programmers
will have more problems finding out how and for what purpose variables are used.
When very descriptive variable names are used, this is less of a problem.
> Further, declaring an obscure name for a variable is no help to later
programmers. This is a red herring. The declaration of a variable is
> of no help in determining what a variable is used for.
All programmers have their own way of writing very descriptive variable names. Unfortunately what is very descriptive to one programmer may not be it to an other. Thus the variables and their use should still be documented. The declaration is an appropiate place for a comment doing that.
So now I need to declare a variable, and document it's use? As I said, I know I have the minority opinion, but I have been successful with it.
Is there no room for more than one style, or should we all don jackboots and all march to the same tune?
And if all variables are declared then you know that you can find the declaration. You will not search for a variable's declartion that is not there or worse: Search for a declaration that is there, but you fail to find it and think the variable is not declared.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. Fax: 724-529-0596
DFE Ultralights, Inc. E-Mail: davef@xxxxxxxxxxxxx
170 Grimplin Road
Vanderbilt, PA 15486
.
- References:
- RE: null terminated strings
- From: Dan Allen
- Re: null terminated strings
- From: Bill Gunshannon
- Re: null terminated strings
- From: Dave Froble
- Re: null terminated strings
- From: JF Mezei
- Re: null terminated strings
- From: Dave Froble
- Re: null terminated strings
- From: Bill Gunshannon
- Re: null terminated strings
- From: Dave Froble
- Re: null terminated strings
- From: Karsten Nyblad
- Re: null terminated strings
- From: Dave Froble
- Re: null terminated strings
- From: Karsten Nyblad
- RE: null terminated strings
- Prev by Date: Re: null terminated strings
- Next by Date: Re: null terminated strings
- Previous by thread: Re: null terminated strings
- Next by thread: Re: null terminated strings
- Index(es):
Relevant Pages
|
Loading