Recommendation for hugo include file name extension

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Recommendation for hugo include file name extension

Post by Tdarcos »

The use of .h for Hugo library or include files has bothered me because they can be confused with C language header or include files.

Also, naming include files with .hug is confusing with the "main program," or rather, the controlling file that pulls all the other files in to construct the game. So I believe I have found a useful solution to these potential confusions.

For all my Hugo programs from now on, all include files related to Hugo code, object declarations and anything except grammars and the control file, will now have a file name extension of .hi, which is short for "Hugo Include." The control file will be the only one in the project with a name ending in .hug (excepting unmodified 3rd-party libraries and other resources), and the extension .h will not be used for Hugo code files (except as just indicated). Grammars will continue to be stored in files whose names end with the .g extension.

Also, the "one project, one folder" (or directory) rule will be used. Disk space is ultra cheap, so it's critical to be separating projects so that all the files for a particular application (and no others) are kept in a specific directory and files from different applications do not mix in the same directory. Library files needed for development may be included in the same directory or (preferably) may be referenced from a master library location.

I encourage others - especially those working with C language sources - to use .hi for Hugo source code include files instead of .h or .hug, as I believe it will reduce the possibility of confusion. Also using one project per directory will help in this fashion, if you aren't already doing so.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Jizaboz
Posts: 4811
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: Recommendation for hugo include file name extension

Post by Jizaboz »

Hm. Well, I do know at one point someone scolded me for comparing Hugo to C. It’s just that compared to Inform7 it just is to me. I’d rather keep .h because it’s not as if that ever confuses me despite also working on Vectrex shit and such in C.

I agree on the basics of your folder concept though. My big Hugo project is basically self contained like you describe.
(╯°□°)╯︵ ┻━┻

Post Reply