Looking for a language to hang my hat on.

lobo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 16 15:48:07 PST 2015


On Monday, 16 November 2015 at 22:39:17 UTC, Dan wrote:
> I am a very new c++ programmer, having just learned the 
> language this year.
>
> A few months ago I completed a course on Coursera that dealt 
> with the security aspect of c (which I don't know, but it is 
> similar enough):
>
> https://class.coursera.org/softwaresec-008
>
> The course highlighted just how dangerous c/c++ can be. My 
> reaction to the course has been an increased use of shared/weak 
> pointers over standard pointers, more judicious use of "assert" 
> and increased use of destructors, where class pointers are 
> destroyed via the destructor so I don't need to worry about 
> memory leaks as much (all of my non-vector arrays are 
> created/destroyed via a class w/ template).
>
> Some of this slows programs down, but in reality it does not 
> have much of an impact. But doubt will always linger that I 
> caught every vulnerability. Therefore I am shopping for a 
> language that codes like c++ but is safer.  It sounds like D 
> may fit that requirement.
>
> My platform of choice is 64-bit Fedora using Code::Blocks (yes, 
> I use an IDE as a crutch). It seems that D supports this combo.
>
> I have been lurking on this site over the past few weeks trying 
> to decide when (and if) to make the transition. Can anyone here 
> who has already made that transition tell me how smoothly it 
> went? Any major unexpected problems? Advice?
>
> thanks!
> Dan

Start using D now. It's not all or nothing so you don't have to 
give up on C++. I have several projects that contain both C++ and 
D intermixed.

D will make you a better C++ programmer, but especially C++ 
template programming. D metaprogramming is so easy to read, write 
and understand compared to C++ and many of the patterns still 
apply when you're standing knee deep in C++it.

I also find the D standard library, Phobos, is a great codebase 
to learn from. Compared to the STL (except perhaps the original 
[1]) it's a great example of how performant D code can still be 
readable and maintainable.

bye,
lobo

[1] http://www.stepanovpapers.com/butler.hpl.hp/stl/stl.zip



More information about the Digitalmars-d-learn mailing list