You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lately I've been thinking over configuration file related things, and I haven't really liked any of the ideas I've had so far. The biggest things that have stuck out to me is that if we're going to have a configuration file (And I really think we should, I don't see any reason why we wouldn't want it), we'd best start implementing functionality for it now rather then patch it in later. Internally the configuration would be something used fairly universally across the program, and once main.c grows into something more then just displaying a simple page of links and of comments, the configuration's going to define a lot about how it all fits together.
One of the bigger things that stuck out to me is that if we chose to simply write our own configuration file parser, it'll take some time, and during that time working on main.c to improve it would be somewhat stalled. At the same time, I haven't really found any really decent config file parsing libraries for C that looked like they'd work for our purposes. Ideally we'd want to simply compile it in to the project like with jsmn, so we don't have another external dependency (Especially since this one would probably be pretty obscure to install). I haven't seen any parser that fit the bill though. If anybody has recommendations on config file parser or has experience with one I'd love to hear your take.
As far as config syntax, I've personally imagined cReddit's release-ready interface to be very similar to mutt's interface, and configuration similar (Though we could probably manage much better defaults then mutt). Mutt's configuration is more of a command-based configuration, where you can define variables, key macros, colors, etc... It's very flexible, allowing configuration of pretty much every part of the program, but it's fairly complex and would be hard to do. Considering this is a Reddit client, that may be a bit to extreme. The other end is basically just a straight file with 'variable = value' lines for everything. Much less options there, but in general most configuration could probably be managed in this fashion. A mix somewhere in the middle would probably be best.
Finally, it's also important to consider what's configurable. I'd say at the bare minimum, colors should be configurable and displayed strings should be configurable (So, Ex. you can change the information displayed for each link on the selection screen, or each comment on the comment screen). I personally think that something similar to an internal printf which can take sequences like '${text}' from the configuration file strings and handle them with an appropriate action would be very beneficial to the program as a whole. It would allow for lots of configuration without having to add to much after writing the base code for it. The possibilities here will grow as the program grows, which is why I consider it important to decide on this now rather then later.
Thoughts? I've got a few planned commit's this weekend, but other then that I should have some free time to make-up a simple prototype config system if anybody has any ideas they'd like to see in it.
The text was updated successfully, but these errors were encountered:
Lately I've been thinking over configuration file related things, and I haven't really liked any of the ideas I've had so far. The biggest things that have stuck out to me is that if we're going to have a configuration file (And I really think we should, I don't see any reason why we wouldn't want it), we'd best start implementing functionality for it now rather then patch it in later. Internally the configuration would be something used fairly universally across the program, and once main.c grows into something more then just displaying a simple page of links and of comments, the configuration's going to define a lot about how it all fits together.
One of the bigger things that stuck out to me is that if we chose to simply write our own configuration file parser, it'll take some time, and during that time working on main.c to improve it would be somewhat stalled. At the same time, I haven't really found any really decent config file parsing libraries for C that looked like they'd work for our purposes. Ideally we'd want to simply compile it in to the project like with jsmn, so we don't have another external dependency (Especially since this one would probably be pretty obscure to install). I haven't seen any parser that fit the bill though. If anybody has recommendations on config file parser or has experience with one I'd love to hear your take.
As far as config syntax, I've personally imagined cReddit's release-ready interface to be very similar to mutt's interface, and configuration similar (Though we could probably manage much better defaults then mutt). Mutt's configuration is more of a command-based configuration, where you can define variables, key macros, colors, etc... It's very flexible, allowing configuration of pretty much every part of the program, but it's fairly complex and would be hard to do. Considering this is a Reddit client, that may be a bit to extreme. The other end is basically just a straight file with 'variable = value' lines for everything. Much less options there, but in general most configuration could probably be managed in this fashion. A mix somewhere in the middle would probably be best.
Finally, it's also important to consider what's configurable. I'd say at the bare minimum, colors should be configurable and displayed strings should be configurable (So, Ex. you can change the information displayed for each link on the selection screen, or each comment on the comment screen). I personally think that something similar to an internal printf which can take sequences like '${text}' from the configuration file strings and handle them with an appropriate action would be very beneficial to the program as a whole. It would allow for lots of configuration without having to add to much after writing the base code for it. The possibilities here will grow as the program grows, which is why I consider it important to decide on this now rather then later.
Thoughts? I've got a few planned commit's this weekend, but other then that I should have some free time to make-up a simple prototype config system if anybody has any ideas they'd like to see in it.
The text was updated successfully, but these errors were encountered: