OT: on IDEs and code writing on steroids

BCS ao at pathlink.com
Mon May 18 10:47:32 PDT 2009


Reply to Ary,

> BCS wrote:
> 
>> Reply to Andrei,
>> 
>>> I've repeatedly failed to figure out the coolness of C#, and would
>>> appreciate a few pointers. Or references. Or delegates :o).
>>> 
>> The coolness of c# is that (in order, IMHO) 1) the tools are world
>> class, 2) the support is back by MS, 3) the docs are great, and 4)
>> the language is highly consistent and conservative, e.i. nothing is
>> added until they've got it right.
>> 
>> Aside from #4, the *language* isn't anything to write home about.
>> 
> Have you seen Linq? That's *amazing*!
> 

LINQ is the only thing c# has the is a notable language feature, but I don't 
think it adds anything that puts it much above the rest of the crowd in any 
way. 

> You can deal with expression ASTs and do really cool stuff with that.
> Like doing:
> 
> var results = someObjectsThatAreGoingToBeTakenFromTheDb.Where(o =>
> o.Name == "Foo");

I think this will work:

int delegate(int delegate(ref T)) Where(T[] array, bool delegate(T) dg)
{
    struct Ret
    {
        T[] Array;
        bool delegate(T) Dg;

        int opApply(int delegate(ref T) idg)
        {
            foreach(ref T t; Array)
               if(Dg(t)) if(int ret = idg) return ret;
            return ret;
        }
        return &(Ret(array,dg)).opApply;
    }
}

If not, a little tweeking shloudl cover it.

There is a lib I played around with a whole back that showed that D can do 
AST manipulation with expressions.

> foreach(var result in results) {
> // There, the previous condition with the given expression has been
> // translated to SQL and executed.
> }
> I find C# a really nice language.
> 

I do  to, but mostly because of the tools





More information about the Digitalmars-d mailing list