Jump to content

Recommended Posts

Posted

Boooo, resist and multiply, speculatively!

  Reveal hidden contents

Posted

Okay, lets speculate it slows a script down in ms, that's really nothing if you ask me, when I would favour readability over micro-optimisations.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

sure, and now i am curious as to the penalty of adding a CONST udf without tidy (which is seen wayyy too much).  Where the user declares a whole bunch of stuff they never use because its easier to just add the include line without learning all the directives to clean up the resulting script on compile.

Is the penalty only on call, and do you take that penalty every time its called?

Edited by iamtheky

  Reveal hidden contents

Posted (edited)

@iamtheky, Your post made very little sense to me. What does Tidy have to do with anything? Are you actually familiar with the internals of AutoIt, especially when it comes to including files? What point are you trying to actually make here?

Pre-optimisation is a terrible thing in development, which is what you're suggesting developers should do (if I understood correctly).

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

because declaring a bunch of shit, and adding a bunch of functions and declarations you never use doesnt affect anything, it most certainly does slow things down, and I have had to break up scripts into smaller pieces to improve performance repeatedly?  I just dont know how constants work, and admittedly neither do you, so my words not making sense would be expected.

Your preference for magic strings over magic numbers is greatly discussed elsewhere, I just dont know if AutoIt tries to convert all those variables back to numbers it can use on build, or on execution.  I dont even know if the dreaded D word would shed any light, but I will go try now.

I also didnt want to assume that tidy wouldnt clean up unused constants and be corrected by Jos.  So I assumed it does, because so far there is no one who can prove how Const's work :)

Edited by iamtheky

  Reveal hidden contents

Posted
  On 6/5/2016 at 4:24 PM, iamtheky said:

neither do you, so my words not making sense would be expected.

Expand  

Wrong. I do now

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

It also makes me wonder why you actually use AutoIt if you care about performance? As for how const works, AutoIt just flags the variable as being that of a const and throws an error if you try and write to it.

But hey, if you want to make life harder for yourself by making code difficult to read, then be my guest. Just don't enforce bad practices on the Forum is all I am suggesting.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

Hi,

Let us try and keep this civil, please. I, for one, am interested in the discussion and it would be a pity to have to lock the thread. Thanks in advance.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

I like @czardas answer.

http://stackoverflow.com/a/2953630 agrees ;)

It used to be a Heap or Stack thing, but here would be style of coding, unless someone with knowledge of the source code can explain different.

Edited by argumentum
mainly to add a search link to "Heap or Stack"

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

I have always maintained that the way you write code is dependent on purpose. If you are sending a small craft out beyond the solar system, you'll need to adopt the optimal minimalistic approach, regardless of coding practices anywhere else in the universe. You should always employ the best terrestrial coding practices unless you have a good reason to break convention. Sometimes you might want to ignore naming conventions: perhaps they produce confusing character sequences or even lead to collisions. Consistency in design is also important. Is the expression 'ix' equivalent to 9 or 10 in roman numerals?

Posted (edited)

This is just one rare example in which a widely used convention makes the code harder to understand. Hungarian notation is meant to make code easier to understand, not the opposite. You would need to have a very good reason to use Roman numerals as variable names though: it's generally a bad idea. I think there will always be a few exceptions, perhaps similar to this.

Edited by czardas
Posted

 

  Quote

 

It also makes me wonder why you actually use AutoIt if you care about performance?

 

Expand  

 

I use AutoIt mainly for the speed in which I can author solutions, not the speed with which they can be run.  This steers me towards the numbers rather than the strings, as they tend to be significantly shorter in character count.  It is no less poor practice to use 1 and 0 for boolean returns than it is to use 0 for the OK msgbox, it is merely preference.  And if it is proven faster to scrap constants in favor of the same, then they go in the bucket too.  And if emojis end up being faster, I am about to start using emojis.

  Reveal hidden contents

Posted

Hungarian notation isn't designed for statically typed languages.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

@Dcoder - I blame you for this interesting conversation. :P

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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
×
×
  • Create New...