www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - c style coding on dmd

reply ViktorKrescvohn <blackwinter089 hotmail.com> writes:
i used to c-style pointer heavy programming, is it wise to code c-style on d
platfrom, i mean by turning off GC and stuff.
Nov 05 2008
next sibling parent Carl Clark <carlclark lavabit.com> writes:
If you're going to write C code in D, what's the point of using D? The 
GC is your friend, usually, and unless you really know a lot about its 
functions, just let it do its thing. Of course, if you're porting C code 
over, that's a different matter, but when writing new D code, try to use 
the language advantages as much as possible.

On 2008-11-05 17:22, ViktorKrescvohn wrote:
 i used to c-style pointer heavy programming, is it wise to code c-style on d
platfrom, i mean by turning off GC and stuff.
Nov 05 2008
prev sibling parent reply ore-sama <spam here.lot> writes:
ViktorKrescvohn Wrote:

 i used to c-style pointer heavy programming, is it wise to code c-style on d
platfrom, i mean by turning off GC and stuff.
I think, turning off GC is possible if you rewrite Phobos or get rid of it completely.
Nov 06 2008
parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Thu, Nov 6, 2008 at 2:04 PM, ore-sama <spam here.lot> wrote:
 ViktorKrescvohn Wrote:

 i used to c-style pointer heavy programming, is it wise to code c-style on d
platfrom, i mean by turning off GC and stuff.
I think, turning off GC is possible if you rewrite Phobos or get rid of it completely.
You can also do: GC.disable(); But giving up the GC means giving up some features, like array concatenation and associative, not because they wouldn't work, but because they would leak memory and there would be no way to free the garbage that they create. Long story short - why use D if you aren't going to be able to take advantage of the very things that make it cool?
Nov 06 2008
parent ore-sama <spam here.lot> writes:
Jarrett Billingsley Wrote:

 Long story short - why use D if you aren't going to be able to take
 advantage of the very things that make it cool?
Not only GC makes it cool. D has a number of other features.
Nov 07 2008