Become a contributor to Esoteric-Assembler
.
- GitHub conventions
- Documentation
- Creating functions
- Library headers
- Global variables, macros and types
- Coding conventions
- Present ideas
- README.md and CONTRIBUTING.md should be updated or checked for updates with every new commit.
- Most lines should be commented, even if you think its purpose is obvious.
- Important functions must have a multi-line comment before the declaration, specifying its purpose, arguments, and return value.
- Single line comments if put on same line must be aligned with all other S.L. comments.
- Please don't put S.L. comments below your line of code.
- No hardcoding. If you realise you've hardcoded over 5 lines over 3 times, you better make a function for it.
- General functions should rest in misc.c.
- Do not create a function if a similar one exists already in any of the source files.
- This applies for even library functions.
- For example, use
allocateMem()
formalloc()
orcalloc()
and usereallocateMem()
forrealloc()
. - All project functions must be declared in headers.h.
- Apart from library headers whose
non-inclusion
gives awarning
, no other library header can be included. - This means
functions
,typedef
s andmacro
s of headers vizstdlib.h
,stdbool.h
,string.h
, etc. are to be declared. - These declarations must be put only in libheaders.h file.
- Note that
stdio.h
is included as its non-inclusion gives warnings even if its contents are declared in libheaders.h file. - This is done to exclude extra stuff that gets included if a library header is included.
- This in turn
reduces size
of object file and often the binary executable.
- All
macro
s,typedef
s andlibrary headers
(standard or third-party) must be included only in headers.h. - No library is to be included in other files. main.c can only have the project specific header files.
- All
global variables
must be defined only in global.c. - Every variable of an inbuilt type must be initialised in main.c using function
initialize()
.
- All identifier name should clearly convey its purpose.
- Use of
scanf()
andgets()
for input is strictly forbidden regardless of data type. - Use
scanStr()
defined in input.c in association withstrtol()
for integer inputs. - In the case of using an obscure technique, mention why it was used, precautions (and if possible, the alternative) in comments with the word
OBSCURE:
when starting the comment. OBSCURE
techniques are meant to be tricky to handle, even risky. Bug squashing in these can be very difficult.
- If you wanna present an idea (feature requests) or report a bug, create an issue with the proper template.