Jump to content
Sign in to follow this  
jaberwacky

A couple of nitpicky things ...

Recommended Posts

jaberwacky

I have noticed a couple of things that I hope are not too nitpicky. I have a history of being really nitpicky.

You can do this:

Global $variable1 = True
If $variable1 = True Then ConsoleWrite("True" & @LF)

But not this:

Global $counter = 0
For $i = 0 To 9 $counter += 1

Also, this:

Global Const $variable = ''

But not this:

Global Const $variable

I'm not a computer scientist so I'm wondering what goes on behind the scenes to cause this. Discuss.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites
Richard Robertson

For loop doesn't work because there isn't a keyword or operator terminating the statement. This is a failing point of BASIC rather than AutoIt specifically.

Constants with no value make no sense. That's a failure on your part.

Share this post


Link to post
Share on other sites
Valik

What practical purpose does declaring an empty constant serve? It's constant, you can't change the value to something meaningful later. If it's empty and will always be empty (implied by it being constant) then you likely have some logic error in your code that is creating a situation where you would need an empty constant.

As for the For loop, that is merely a syntactic choice. We terminate things with explicit keywords. Other languages use curly brackets. Python uses indentation, et cetera. There is minimal need for supporting single-line For statements as most For statements are not so trivial.

Share this post


Link to post
Share on other sites
Richard Robertson

You should never rely on unassigned variables having any value. That's programming 101.

Share this post


Link to post
Share on other sites
jvanegmond

For someone who is a nitpick, you missed all the things which deserve being nitpicked over. AutoIt isn't perfect, but these are definitely not its imperfections.

Share this post


Link to post
Share on other sites
jvanegmond

Well, I wasn't criticizing AutoIt. AutoIt is a great language which I use daily. I was just curious is all.

I wanted to edit my post but I forgot, and doing so now means you probably wont see it. Here's what I wanted to add:

I challenge you to find some things in AutoIt worth nitpicking. You were curious about syntax, so that would be my first suggestion.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×