On 19/03/2024 9:53 am, Pew, Curtis G wrote:
You get used to the “significant indentation” thing pretty quickly. It really
makes sense: you should be indenting blocks anyway to make them easy to read,
so why clutter things up with braces or keywords?
Most scripting languages (including REXX) don’t require declaring variables.
Since there’s no separate compile step you get the errors when they happen in
any case, so declaring variables doesn’t buy you much.
I probably would get used to significant indentation, although I do
indent for readability and I'm not sure I want to be mixing readability
and logic in the same construct.
Explicitly declaring variables has a number of advantages:
- it flags errors due to e.g. misspellings
- it flags errors when you intend to create a new variable but reuse an
existing one
- it checks data types, e.g. for SMF data if you have a ZonedDateTime
you can't assign/compare a LocalDateTime without specifying the time
zone. So the class designers can protect you form a whole heap of common
errors, and flag them before the program starts.
--
Andrew Rowley
Black Hill Software
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN