Thread overview | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 14, 2015 Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
yes,java is good lang,but i dont think it's better than c#,if no oracle or google support java will less and less. C# is a good and easy lang. i like C# . but,C# cant compiled to native code. So far, I have been searching for a language, like c # write efficiency, but more secure than that of c #, more efficient (runs), stronger (system-level, driving level) |
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to dnewer | On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
> yes,java is good lang,but i dont think it's better than c#,if no oracle or google support java will less and less.
> C# is a good and easy lang.
> i like C# .
> but,C# cant compiled to native code.
>
> So far, I have been searching for a language, like c # write efficiency, but more secure than that of c #, more efficient (runs), stronger (system-level, driving level)
An other one is C# must rely on the CLR. but I prefer like Delphi that will need to be compiled into the exe or DLL.
so!hope D Lang is a good Select!
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to dnewer | dnewer:
> but,C# cant compiled to native code.
Soon you will be able to compile C# natively.
Bye,
bearophile
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Saturday, 14 March 2015 at 10:04:15 UTC, bearophile wrote:
> dnewer:
>
>> but,C# cant compiled to native code.
>
> Soon you will be able to compile C# natively.
>
> Bye,
> bearophile
i know some thing about .net native.
but its too late.i dont think microsoft will rranslate all libiary to native.
and even c# can be compile natively.
i dont think C# will support to can be used to write a driver!
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to dnewer Attachments: | On Sat, 14 Mar 2015 10:08:23 +0000, dnewer wrote:
> and even c# can be compile natively.
> i dont think C# will support to can be used to write a driver!
and you just don't need to write drivers.
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to dnewer | On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
> yes,java is good lang,but i dont think it's better than c#,if no oracle or google support java will less and less.
> C# is a good and easy lang.
> i like C# .
> but,C# cant compiled to native code.
>
> So far, I have been searching for a language, like c # write efficiency, but more secure than that of c #, more efficient (runs), stronger (system-level, driving level)
What has led you to this conclusion? I don't personally find D very much like Java. It definitely doesn't push OO design on you like Java (even where it isn't needed), and code is much more concise in my experience. I also find D very much more flexible.
I don't have any C# experience so I can't compare those languages much, but I've heard people say their are D / C# similarities.
Anyway, this isn't a criticism of your comment, I was just curious what (other than the shared C++ syntax heritage) you find so Java-like in D?
Cheers,
Craig
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On Saturday, 14 March 2015 at 13:52:13 UTC, Craig Dillabaugh wrote:
>
> I don't have any C# experience so I can't compare those languages much, but I've heard people say their are D / C# similarities.
>
> Anyway, this isn't a criticism of your comment, I was just curious what (other than the shared C++ syntax heritage) you find so Java-like in D?
>
> Cheers,
>
> Craig
I've been using C# pretty extensively for the last year or so. Superficially, at least, C# and D are pretty similar, eg auto (var), foreach, lambdas, classes and structs. C# is more biased towards OO than D.
Metaprogramming is significantly weaker in C#. This is probably the one area where I've wished for some of D's functionality.
Reflection is all runtime.
C# has some AST capabilities that D doesn't. This is probably the main area where I envy C# when using D.
And C# has LINQ, which when combined with the last point is fricken awesome.
|
March 14, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer wrote:
> And C# has LINQ, which when combined with the last point is fricken awesome.
what does LINQ offer that UFCS-style functional programming does not?
|
March 15, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to weaselcat | On Saturday, 14 March 2015 at 23:57:33 UTC, weaselcat wrote:
> On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer wrote:
>> And C# has LINQ, which when combined with the last point is fricken awesome.
>
> what does LINQ offer that UFCS-style functional programming does not?
LINQ basically is a UFCS-style api. AST reflection is what makes it nice.
consider:
X.Where(x => x.Members.Count() == x.Admins.Count())
straightforward in both D and C# when X is an array or container type.
When X is a table in a database, things get tricky for D.
C# can interpret the lambda as an Expression<Func> (an AST type), so the implementation of X can reflect over the body of the lambda and use it to generate the appropriate SQL. ORMs such as entity framework and nhibernate do this now.
|
March 15, 2015 Re: Dlang seems like java now,but why not let d more like C# Style? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | On Sunday, 15 March 2015 at 00:56:24 UTC, Ellery Newcomer wrote:
> On Saturday, 14 March 2015 at 23:57:33 UTC, weaselcat wrote:
>> On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer wrote:
>>> And C# has LINQ, which when combined with the last point is fricken awesome.
>>
>> what does LINQ offer that UFCS-style functional programming does not?
>
> LINQ basically is a UFCS-style api. AST reflection is what makes it nice.
>
> consider:
>
> X.Where(x => x.Members.Count() == x.Admins.Count())
>
> straightforward in both D and C# when X is an array or container type.
>
> When X is a table in a database, things get tricky for D.
>
> C# can interpret the lambda as an Expression<Func> (an AST type), so the implementation of X can reflect over the body of the lambda and use it to generate the appropriate SQL. ORMs such as entity framework and nhibernate do this now.
Somewhat off-topic, but you could theoretically embed SQL directly in your D code using string mixins and have it statically checked at compile time (this would be pretty advanced usage, though).
mixin SQL!q{
INSERT INTO Person(name, age, occupation)
VALUES ('John', 25, 'Programmer')
};
|
Copyright © 1999-2021 by the D Language Foundation