Difference between revisions of "Coming From"

From D Wiki
Jump to: navigation, search
(Specific Language)
(Porting)
Line 30: Line 30:
 
If you are interested in converting your code to D start by looking at the [[PortingOverview | Porting Overview]].
 
If you are interested in converting your code to D start by looking at the [[PortingOverview | Porting Overview]].
  
 +
Walter Bright has observed that when you first start writing D you tend to write it like the existing languages you are familiar with.  In time you may choose to make use of the higher-level features of D that make writing D code a pleasure rather than a chore.  But programming is about using a tool to solve a problem, and there is no dogma in D that there is only one way to do it.  Very often you don't need to make use of advanced D features like metaprogramming, templates, and compiler time function execution to achieve a useful result quickly.
 +
 +
So it's often initially satisfying to start by porting the code as is, and then over time refine it or write a higher-level wrapper (you can start by wrapping only a few bits and build up over time).
  
 
== Related ==
 
== Related ==

Revision as of 14:43, 6 May 2015

When coming from another language it is good to find out where D stands in relation to it. There is the feature list which states if a feature exists or not and possibly an explanation. For a side-by-side comparison of many languages: Languages vs D or you can look at code snippets of from Rosetta Code.

A very superficial way to find out the popularity of D in relation to other languages can is at the Tiobe Index website.

For information about syntactical differences or gotchas when coming from another language choose your language below.


General Comparison

Specific Language

Porting

If you are interested in converting your code to D start by looking at the Porting Overview.

Walter Bright has observed that when you first start writing D you tend to write it like the existing languages you are familiar with. In time you may choose to make use of the higher-level features of D that make writing D code a pleasure rather than a chore. But programming is about using a tool to solve a problem, and there is no dogma in D that there is only one way to do it. Very often you don't need to make use of advanced D features like metaprogramming, templates, and compiler time function execution to achieve a useful result quickly.

So it's often initially satisfying to start by porting the code as is, and then over time refine it or write a higher-level wrapper (you can start by wrapping only a few bits and build up over time).

Related