Re: Radnen's Sphere Studio v1.1.5.0
Reply #132 –
I don't know if you have any exposure to LINQ, but it's basically awesome. You can do stuff like this:
var enemyUnits = from unit in battleUnits where unit.type == "enemy" select unit;
foreach (BattleUnit enemy in enemyUnits) {
// ...
}
The first thing I noticed is the similarity with Common Lisp:
(loop for unit in battle-units when (eql (unit-type unit) :enemy) do
(do-stuff-with unit))
Cool.
I'm glad C# programmers get something like this. Why Microsoft didn't settle for filter/map/reduce methods, I'll probably never know. Haskell, ML, Common Lisp, Ruby, Python, Perl, JavaScript, Erlang, and probably a lot of others have had this sort of thing for a while, just under the admittedly somewhat intimidating name of higher-order functions.
That's kinda jQuery-looking to me.
var enemyUnits = $(".battleUnits[type='enemy']").each(function(e,i){
// ...
});
Granted, most of the jQuery I end up writing is still web-oriented but theoretically the library can be modified to work with more generic object models than the DOM, as previously shown with Prototype (Scrototype) and MooTools for Sphere.
Seems like y'all are starting to head towards a discussion of programming philosophy, which would probably be better suited to a separate topic unless it's directly related to Sphere Studio.