Opened 11 years ago
Closed 11 years ago
#2517 closed Feature Request (Rejected)
MustDeclareVars=1 as default
Reported by: | Raik | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | Severity: | None | |
Keywords: | Cc: |
Description
Because i stumbled over scripts again and again, throwing "variable used without being declared" over and over, i suggest MustDeclareVars=1 as default value, to get newbies learning a clean programming-style right from the start.
AutoIt anyway does not accept undeclared vars anymore, so its better to set this option on by default (and possibly remove it).
Attachments (0)
Change History (5)
comment:1 Changed 11 years ago by TicketCleanup
- Version 3.3.8.1 deleted
comment:2 Changed 11 years ago by Mat
AutoIt does still allow you to directly assign to undeclared variables, for example the following is still perfectly valid code:
$a = "Hello" MsgBox(0, "Test", $a)
But running with Opt("MustDeclareVars", 1) won't work.
Changing it to the default would break any old scripts that relied on this functionality, and I can't really think of an example where using this option would show something that is not obvious and isn't shown by Au3Check already.
comment:3 Changed 11 years ago by Jpm
Perhaps a good way is to have Au3Check default enforcing this verification.
I assume a lot of designer use SciTE
comment:4 Changed 11 years ago by James
Absolutely not. You're imposing restrictions on developers for no reason other than selfishness.
What might be a good idea is to instead set the default AU3 template to set MustDeclareVars, but not do it by default. It's nonsensical to turn it off, rather than on.
comment:5 Changed 11 years ago by James
- Resolution set to Rejected
- Status changed from new to closed
I'm marking this as closed since there has been no further responses.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Automatic ticket cleanup.