Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library Import Style #1

Open
KamalAwasthi opened this issue Feb 20, 2016 · 6 comments
Open

Library Import Style #1

KamalAwasthi opened this issue Feb 20, 2016 · 6 comments

Comments

@KamalAwasthi
Copy link
Contributor

I think libraries and codes(like. functions) from other files should be included separately under a declarative comment like:

/*
**********************************
 libraries used
***********************************
*/ 
#include libcrypt.ahk
#include tf.ahk

either at the top of the file or at bottom as per the need.

@joedf
Copy link

joedf commented Feb 20, 2016

I put them at the top as per the C/C++ convention.

@aviaryan
Copy link
Owner

I would have put them at the top but as AHK is a scripting language and runs from top to bottom, putting a lib on top scares me that lib code may get executed at startup. You see AHK has no main() method like those. But this is so silly 😜

@joedf
Copy link

joedf commented Feb 20, 2016

Well that is true, libraries are to (or should) be written in a way that it does not disrupt the script no matter where they are included. This point could be added to this "style" guide.

@aviaryan
Copy link
Owner

I don't know. Maybe it's too advanced level for this guide. You know, writing a library, that kind of thing. Also there is no package manager for ahk. You just copy the code and paste it to a new file, or download something from GitHub. The lib code is not inaccessible like Python/Go/Java. Also library authors are sensible enough to not include auto-execute stuff in their scripts. If they have, you can always remove it when you have downloaded it locally.

@ttnnkkrr
Copy link

I never include i always use stlib

@joedf
Copy link

joedf commented Feb 21, 2016

Still trying to get ASPDM going, right now it's functional, it's just that the website isn't exactly complete and some small things here and there... :p

Repository owner deleted a comment from yehyabelhadad Jan 2, 2024
Repository owner deleted a comment from Allen0517 Feb 14, 2024
@github-staff github-staff deleted a comment Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@ttnnkkrr @joedf @aviaryan @KamalAwasthi and others