digitalmars.D.learn - moving from c++ to D is easy?
- ayush (3/3) Mar 12 2015 Is D a lot like c++ ? I am currently midway through learning c++
- Dennis Ritchie (5/8) Mar 12 2015 You can study both together, although it is better to focus on
- ayush (2/10) Mar 12 2015 So on which language should I focus(learn) first
- Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d-learn (4/20) Mar 12 2015 D is much easier to learn so I will start with it. And then you can
- Dennis Ritchie (3/6) Mar 12 2015 Yes, but in D for beginners little literature, so I would
- "Jacques =?UTF-8?B?TcO8bGxlciI=?= <jacques.mueller gmx.de> (5/11) Mar 12 2015 There is no need for dozens of books.
- ketmar (4/10) Mar 12 2015 there are alot of books on C++ 'cause C++ is insanely complicated and=20
- Dennis Ritchie (3/8) Mar 12 2015 Well, in principle, can be started with a D, but personally, I
- weaselcat (4/8) Mar 12 2015 D is very much like C++, but the biggest issue I found moving
- ketmar (3/6) Mar 12 2015 D is like C++, but made by human beings for human beings. and C++ is mad...
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (19/24) Mar 12 2015 I came to D from C++. I remember the following being notable differences...
- Dennis Ritchie (2/5) Mar 12 2015 О, yeah.
- Namespace (6/16) Mar 12 2015 This is a common mistake. In 99 percent of cases you want to use
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (11/30) Mar 12 2015 Agreed. Here is an excerpt from a comment from one of our header files:
- Namespace (4/39) Mar 12 2015 You could also pass raw pointers around. Since they have no owner
Is D a lot like c++ ? I am currently midway through learning c++ and I also want to learn D . So should i focus on one or learn both together? Will I find learning D easy if I already know c++ ?
Mar 12 2015
On Thursday, 12 March 2015 at 13:01:31 UTC, ayush wrote:Is D a lot like c++?Enough.So should i focus on one or learn both together?You can study both together, although it is better to focus on one.Will I find learning D easy if I already know c++?Yes.
Mar 12 2015
On Thursday, 12 March 2015 at 13:13:40 UTC, Dennis Ritchie wrote:On Thursday, 12 March 2015 at 13:01:31 UTC, ayush wrote:So on which language should I focus(learn) firstIs D a lot like c++?Enough.So should i focus on one or learn both together?You can study both together, although it is better to focus on one.Will I find learning D easy if I already know c++?Yes.
Mar 12 2015
On Thu, 12 Mar 2015 13:35:18 +0000 ayush via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Thursday, 12 March 2015 at 13:13:40 UTC, Dennis Ritchie wrote:D is much easier to learn so I will start with it. And then you can try learn C++ if you still want and need it.On Thursday, 12 March 2015 at 13:01:31 UTC, ayush wrote:So on which language should I focus(learn) firstIs D a lot like c++?Enough.So should i focus on one or learn both together?You can study both together, although it is better to focus on one.Will I find learning D easy if I already know c++?Yes.
Mar 12 2015
On Thursday, 12 March 2015 at 13:44:50 UTC, Daniel Kozák wrote:D is much easier to learn so I will start with it. And then you can try learn C++ if you still want and need it.Yes, but in D for beginners little literature, so I would recommend starting with C++.
Mar 12 2015
On Thursday, 12 March 2015 at 13:56:29 UTC, Dennis Ritchie wrote:On Thursday, 12 March 2015 at 13:44:50 UTC, Daniel Kozák wrote:There is no need for dozens of books. I would even go as far as to say that the existing ones are more than enough. http://wiki.dlang.org/BooksD is much easier to learn so I will start with it. And then you can try learn C++ if you still want and need it.Yes, but in D for beginners little literature, so I would recommend starting with C++.
Mar 12 2015
On Thu, 12 Mar 2015 13:56:28 +0000, Dennis Ritchie wrote:On Thursday, 12 March 2015 at 13:44:50 UTC, Daniel Koz=C3=A1k wrote:there are alot of books on C++ 'cause C++ is insanely complicated and=20 inconsistend. D design is *MUCH* better, so D doesn't need so many books=20 teaching arcane art of programming.=D is much easier to learn so I will start with it. And then you can try learn C++ if you still want and need it.=20 Yes, but in D for beginners little literature, so I would recommend starting with C++.
Mar 12 2015
On Thursday, 12 March 2015 at 14:47:22 UTC, ketmar wrote:there are alot of books on C++ 'cause C++ is insanely complicated and inconsistend. D design is *MUCH* better, so D doesn't need so many books teaching arcane art of programming.Well, in principle, can be started with a D, but personally, I started actually with ANSI C.
Mar 12 2015
On Thursday, 12 March 2015 at 13:01:31 UTC, ayush wrote:Is D a lot like c++ ? I am currently midway through learning c++ and I also want to learn D . So should i focus on one or learn both together? Will I find learning D easy if I already know c++ ?D is very much like C++, but the biggest issue I found moving from C++ to D was trying to apply C++ idioms that only existed to work around ugly C++ warts(i.e, CRTP)
Mar 12 2015
On Thu, 12 Mar 2015 13:01:29 +0000, ayush wrote:Is D a lot like c++ ? I am currently midway through learning c++ and I also want to learn D . So should i focus on one or learn both together? Will I find learning D easy if I already know c++ ?D is like C++, but made by human beings for human beings. and C++ is made=20 by martians for monkeys.=
Mar 12 2015
On 03/12/2015 06:01 AM, ayush wrote:Is D a lot like c++ ?I came to D from C++. I remember the following being notable differences: - In D, classes have reference semantics. I quickly realized that this is not an issue because so many of my C++ types were hand-reference-typified :p by this idiom, almost everywhere: class C { /* ... */ }; typedef boost::shared_ptr<C> CPtr; void foo(CPtr c); - Garbage collector took longer to get used to. There are some issues with the spec or implementation that some objects may never be destructed (or is it finalized?). Other than issues like that, everything in D feels like a fresh air.I am currently midway through learning c++If you are a mortal like myself, you may find out years later that you are still at the midway point. Happened to me several times when I was learning C++. :)and I also want to learn D . So should i focus on one or learn both together?Economically, C++ may make more sense. But if you are learning just for yourself, perhaps for fun, then I recommend D.Will I find learning D easy if I already know c++ ?I think so. Ali
Mar 12 2015
On Thursday, 12 March 2015 at 18:57:51 UTC, Ali Çehreli wrote:If you are a mortal like myself, you may find out years later that you are still at the midway point. Happened to me several times when I was learning C++. :)О, yeah.
Mar 12 2015
On Thursday, 12 March 2015 at 18:57:51 UTC, Ali Çehreli wrote:On 03/12/2015 06:01 AM, ayush wrote:This is a common mistake. In 99 percent of cases you want to use a std::unique_ptr. std::shared_ptr is rarely common and often an indication of an error in design. In general, there is exactly one owner only. But I think you know that already. :)Is D a lot like c++ ?I came to D from C++. I remember the following being notable differences: - In D, classes have reference semantics. I quickly realized that this is not an issue because so many of my C++ types were hand-reference-typified :p by this idiom, almost everywhere: class C { /* ... */ }; typedef boost::shared_ptr<C> CPtr; void foo(CPtr c);
Mar 12 2015
On 03/12/2015 01:19 PM, Namespace wrote:On Thursday, 12 March 2015 at 18:57:51 UTC, Ali Çehreli wrote:differences:On 03/12/2015 06:01 AM, ayush wrote:Is D a lot like c++ ?I came to D from C++. I remember the following being notableAgreed. Here is an excerpt from a comment from one of our header files: "We could not use boost::unique_ptr because the version of the Boost library that we currently use does not include it."- In D, classes have reference semantics. I quickly realized that this is not an issue because so many of my C++ types were hand-reference-typified :p by this idiom, almost everywhere: class C { /* ... */ }; typedef boost::shared_ptr<C> CPtr; void foo(CPtr c);This is a common mistake. In 99 percent of cases you want to use a std::unique_ptr.std::shared_ptr is rarely common and often an indication of an error in design. In general, there is exactly one owner only.Of course. We had definitions like the following as well, where the C objects are stored in: typedef vector<CPtr> MyCs;But I think you know that already. :)I think so. :) Maybe we should pass weak_ptrs around instead of shared_ptr. Anyway... That's old code and this is a D newsgroup. Ali
Mar 12 2015
On Thursday, 12 March 2015 at 21:41:07 UTC, Ali Çehreli wrote:On 03/12/2015 01:19 PM, Namespace wrote:You could also pass raw pointers around. Since they have no owner it's fine. Or references.On Thursday, 12 March 2015 at 18:57:51 UTC, Ali Çehreli wrote:differences:On 03/12/2015 06:01 AM, ayush wrote:Is D a lot like c++ ?I came to D from C++. I remember the following being notablethat this- In D, classes have reference semantics. I quickly realizeduse ais not an issue because so many of my C++ types were hand-reference-typified :p by this idiom, almost everywhere: class C { /* ... */ }; typedef boost::shared_ptr<C> CPtr; void foo(CPtr c);This is a common mistake. In 99 percent of cases you want tostd::unique_ptr.Agreed. Here is an excerpt from a comment from one of our header files: "We could not use boost::unique_ptr because the version of the Boost library that we currently use does not include it."std::shared_ptr is rarely common and often an indication of an error in design. In general, there is exactly one owner only.Of course. We had definitions like the following as well, where the C objects are stored in: typedef vector<CPtr> MyCs;But I think you know that already. :)I think so. :) Maybe we should pass weak_ptrs around instead of shared_ptr.Anyway... That's old code and this is a D newsgroup. AliAgreed.
Mar 12 2015