www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Wiki page: Coming From C++

reply "Jakob Ovrum" <jakobovrum gmail.com> writes:
I've done some preliminary work on a wiki page that attempts to 
convince C++ programmers who are on the fence about D, who need 
to know what D provides over C++11 and C++14.

http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article

I don't know if a Coming_From page is the right place for this 
kind of information. What is the target audience for Coming_From 
- programmers who are already learning D, or programmers who are 
investigating D to decide whether or not to try it? If the 
former, where should we place information for the latter?

Contributions to the page are very welcome. I think D's syntax is 
intuitive enough for C++ programmers that we can use commented D 
code examples. I could need some help filling up the sections and 
proposing new sections.
Apr 11 2015
next sibling parent reply "ponce" <contact gam3sfrommars.fr> writes:
On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote:
 I've done some preliminary work on a wiki page that attempts to 
 convince C++ programmers who are on the fence about D, who need 
 to know what D provides over C++11 and C++14.

 http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article

 I don't know if a Coming_From page is the right place for this 
 kind of information. What is the target audience for 
 Coming_From - programmers who are already learning D, or 
 programmers who are investigating D to decide whether or not to 
 try it? If the former, where should we place information for 
 the latter?

 Contributions to the page are very welcome. I think D's syntax 
 is intuitive enough for C++ programmers that we can use 
 commented D code examples. I could need some help filling up 
 the sections and proposing new sections.
You should mention stack variables and members initialized by default. This avoids many release-only bugs.
Apr 11 2015
parent reply "ponce" <contact gam3sfrommars.fr> writes:
 You should mention stack variables and members initialized by 
 default. This avoids many release-only bugs.
Also: if (cond); // D won't allow that, but C++ will statement(); Almost every C++ programmer encounter this in its carreer.
Apr 11 2015
parent "ponce" <contact gam3sfrommars.fr> writes:
On Saturday, 11 April 2015 at 11:02:47 UTC, ponce wrote:
 You should mention stack variables and members initialized by 
 default. This avoids many release-only bugs.
Also: if (cond); // D won't allow that, but C++ will statement(); Almost every C++ programmer encounter this in its carreer.
And the improved resolution of name conflicts and the fact order of declaration is by and large not important.
Apr 11 2015
prev sibling next sibling parent reply "David Nadlinger" <code klickverbot.at> writes:
On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote:
 http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article
*Un*signed integer overflow isn't undefined in C/C++ either. — David
Apr 11 2015
parent "Jakob Ovrum" <jakobovrum gmail.com> writes:
On Saturday, 11 April 2015 at 16:02:53 UTC, David Nadlinger wrote:
 On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote:
 http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article
*Un*signed integer overflow isn't undefined in C/C++ either. — David
I removed the section on undefined behaviour for now, I'm not familiar enough with it to really write something convincing. Help would be appreciated.
Apr 11 2015
prev sibling next sibling parent "Laeeth Isharc" <nospamlaeeth nospam.laeeth.com> writes:
On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote:
 I've done some preliminary work on a wiki page that attempts to 
 convince C++ programmers who are on the fence about D, who need 
 to know what D provides over C++11 and C++14.

 http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article

 I don't know if a Coming_From page is the right place for this 
 kind of information. What is the target audience for 
 Coming_From - programmers who are already learning D, or 
 programmers who are investigating D to decide whether or not to 
 try it? If the former, where should we place information for 
 the latter?

 Contributions to the page are very welcome. I think D's syntax 
 is intuitive enough for C++ programmers that we can use 
 commented D code examples. I could need some help filling up 
 the sections and proposing new sections.
Thanks for doing this. Maybe link to Andrei's talks and articles (and Ali's book) on iterators and ranges. Learning D vs investigating whether to try it is not such a binary choice because many people who try a language give up early. Maybe start with the selling points and have a second section below - 'here is how to do stuff'. Some examples, and links to other relevant material.
Apr 11 2015
prev sibling next sibling parent reply "Jakob Ovrum" <jakobovrum gmail.com> writes:
Thanks for the feedback, I think I've incorporated all the 
suggested changes.

Also added a section on how D deals with object slicing.

I can't seem to get the compiler to error on dangling else. I 
tried the examples in the original PR[1], but they seem to 
compile without error with DMD 2.067. Is anyone able to make the 
compiler error on dangling else?

[1] https://github.com/D-Programming-Language/dmd/pull/336
Apr 11 2015
parent "anonymous" <anonymous example.com> writes:
On Sunday, 12 April 2015 at 03:51:50 UTC, Jakob Ovrum wrote:
 I can't seem to get the compiler to error on dangling else. I 
 tried the examples in the original PR[1], but they seem to 
 compile without error with DMD 2.067. Is anyone able to make 
 the compiler error on dangling else?

 [1] https://github.com/D-Programming-Language/dmd/pull/336
It's a warning.
Apr 12 2015
prev sibling parent "Jakob Ovrum" <jakobovrum gmail.com> writes:
I moved it out of draft status since I think it's respectable 
enough as it is[1], but improvements and additions should still 
be made.

However, the Coming From pages seem to have been renamed "D for X 
programmers". I don't think this article fits that moniker.

 From where should we link this kind of article?

[1] http://wiki.dlang.org/Coming_From/C_Plus_Plus
Apr 27 2015