Since the filosofy used is based on structure framework of files. The CSS programing style extends the base filosofy.
A simple example of the base files inherit. Since parts of variables may be used in more then one file instead of being in a file like "DTR" is up one level so that more files inherit. Is a base method used in the software.
- Main ->
- Standard Variables
- Standard Functions
- Standard Templates
- DTR
- Interactive Manual
- Lore
The CSS code style :
Got the ideia when i post the concept at Game Dev forums. People where doing all kind of tips. Then i though also hold be nice if the code do it. Then update it so that now is the basis of also the code style.
We can see in the example once we have: the file extension, error type, and path to files we no longer need to repeat this variables they are inherit. Like CSS code this allow to have highly complex rules width out re-writting to much stuff.
#include "variables.h"
#include "path.h"
#include "error.h"
path_folder = "\store_structures\";
file_name = "store_structure";
file_extension = ".h"
error_name = "unable to open file";
build();
file_name = "file_map";
build();
file_name = "variables_map";
build();
file_name = "color";
build();
file_name = "print";
build()
file_name = "type";
build()
For the last example we need another folder so is just a matter to change it. It assume
path_folder = "\includes\";
file_name = "font";
build()
Why is this good?
If we ever need to change something in the functions the setting are separated. As the MVC separated logic from presentation. The Separtion of settings from logic may also add a step in your capability to be modular and lather do changes.
// All files using application structures folder[/code]
Now we see 2 folders included width a CSS rule, store_structures folder and application structure. Error works for both since they are including files.
Can't auto include system libraries since they build auto include, so they are in the main folder, width main.c, they are just included directly. Let's say we are in a diferent operating sistem, that does not use “../” this type. It will work.
No comments:
Post a Comment