[Info-vax] Python for x86?
Dave Froble
davef at tsoft-inc.com
Wed May 10 15:52:54 EDT 2023
On 5/10/2023 11:08 AM, Chris Townley wrote:
> On 10/05/2023 16:00, Arne Vajhøj wrote:
>> On 5/10/2023 9:16 AM, Johnny Billquist wrote:
>>> On 2023-05-10 11:59, Chris Townley wrote:
>>>> On 10/05/2023 04:39, Dave Froble wrote:
>>>>> The defaults in Basic are LONG integers and Single FP. A number, such as
>>>>> 1, is treated as a single precision FP, so that makes not being specific
>>>>> even worse.
>>>>>
>>>>> Note, I really don't like the FP default. Any program I write specifies
>>>>> the defaults for both integers and FP. Something like:
>>>>>
>>>>> OPTION SIZE = ( INTEGER WORD , REAL DOUBLE )
>>>>
>>>> Our coding standards insisted on
>>>>
>>>> OPTION TYPE = EXPLICIT
>>>
>>> That actually don't solve the problem observed here.
>>> That only makes the compiler give errors if you don't explicitly declare
>>> variables. However constants are still being of the default type defined.
>>
>> I am not a Basic person so not sure how much my opinion
>> should count, but I think it would be nice with:
>>
>> $ BASIC/VAR_TYPE_DEFAULT=EXPLICIT/LITERAL_TYPE_DEFAULT=INTEGER ...
>>
>> Arne
>
> When using Basic, it is not difficult to get in the habit of using %, or if
> valid FP use, for example, 1.0
> Within my team I would always check for this in code reviews
>
If explicitly declaring variables and constants, the "%" and "$" are not
required. Regardless, unless numerics are declared, then the language defaults
do affect things.
So if I declare Long one, and use one instead of 1, that can be avoided. If
not, better know exactly what one is doing. So even while some do not like
using the "%" suffix, it really helps one from making a mistake.
Yes, the 1. or 1.0 does basically (sic) specify the data type. A reasonable
practice.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list