Recommendation for hugo include file name extension

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Recommendation for hugo include file name extension

Re: Recommendation for hugo include file name extension

by Jizaboz » Fri Dec 06, 2019 10:52 pm

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.

Recommendation for hugo include file name extension

by Tdarcos » Fri Dec 06, 2019 12:49 pm

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.

Top