(04-23-2013, 08:43 AM)machine! Wrote: Okey, so is C agnostic, since it's not platform dependent, or is that another thing?
Completely unrelated, and theres such thing as a platform independent language (even if sun is doing their best to lie abt that ; )
Platform agnosticism it about running any random code on as many devices as possible. Agnostic software
design is a programming philosophy.
(04-23-2013, 08:43 AM)machine! Wrote: And also, your example with Health pickup seems strange, why not implement simply a pickup system into the codebase, then adding items that can be picked up using that system, and then adding Health, or is it what you meant?
I should perhaps have made up a example not so close to xonotic.. anyway, the reason would be that, with the traditional approach you would likely be looking at one function per item. thats fine for a few health pickups, a few guns etc. now add a few more pickups. suddenly you have to for some reason change how the pickups spawn. unfortunately that was not until there was another 500 of them added, quite a few with a snag or awkward code branching of one form or another that makes automizing the code change very precarious at best.
With a agnostic design there is one at least few functions/modules handling all items making any change to that subsystem a less painful ordeal. obviously writing it to begin with gets far more painful, and in this case would likely mean making it data driven by sth like reading entities.def to figure out what's what and how its supposed to work.
The "true agnostic program" would be capable of anything in one function with the programmer never having a clue what it would be used for.. that may take awhile to work out though
Personally i never seen any code written this way, sure i've read and written some fairly generalized code now and then but nothing at that level. I'm curious if anyone here has and if so, did it work out or it is just a pipedream? Like merlijn likes to say "assumptions is the mother of all screw ups" code that assumes as little as possible should ergo be less screw-up-o-genic.. maybe