November 20, 2019
On Wednesday, 20 November 2019 at 14:02:22 UTC, IGotD- wrote:
> Memory safety is not a deal breaker but nice to have for example GC helps speeding up development as you get one less issue to think about but leaking programs are easy to debug.

Automatic memory management makes the initial design phase easier, restructuring carefully designed manual memory management code at the early stage can be costly/annoying. True.

> Bounds checking is the most important safety feature as these bugs can manifest themselves so differently and can be hard to find.

Right, I think there are some tools to do it for C/C++ as well, but it isn't the default. Well, it is the default if you use the array.at(index) member, but I guess people tend to forget that it exists. It probably should be the default in basic debug builds.


November 20, 2019
On Wednesday, 20 November 2019 at 20:32:27 UTC, Ola Fosheim Grøstad wrote:
> On Wednesday, 20 November 2019 at 14:02:22 UTC, IGotD- wrote:
>> Memory safety is not a deal breaker but nice to have for example GC helps speeding up development as you get one less issue to think about but leaking programs are easy to debug.
>
> Automatic memory management makes the initial design phase easier, restructuring carefully designed manual memory management code at the early stage can be costly/annoying. True.
>
>> Bounds checking is the most important safety feature as these bugs can manifest themselves so differently and can be hard to find.
>
> Right, I think there are some tools to do it for C/C++ as well, but it isn't the default. Well, it is the default if you use the array.at(index) member, but I guess people tend to forget that it exists. It probably should be the default in basic debug builds.

It is the default in Visual C++ debug builds, on Solaris SPARC, and on Android as of the latest NDK release.
November 21, 2019
On Tuesday, 19 November 2019 at 08:51:49 UTC, Pavel Shkadzko wrote:
> But why are so few C++ devs actually do it remains a mystery to me.

I've not read the rest of this thread.

But in my experience, it was entirely that C++ programmers still need to work with their C++ codebases and need a way to hook in to that.

See D++ and Binderoo for different approaches to the problem there, but they're both still not mature enough for what would actually be needed for C++ programmers to start moving their codebases to D.
November 22, 2019
On Tue, 2019-11-19 at 17:23 +0000, bachmeier via Digitalmars-d wrote:
> 
[…]
> There's a bit of a sample selection issue. Anyone open to GC moved to Java long ago. These days anyone still using C++ either has a good reason to fear the GC (certain real-time applications) or an irrational fear of the GC. The D of today would have had great success at recruiting C++ programmers 20 years ago, but by about 2005 or so, Java had already sucked up all the potential converts.

I am not sure I agree totally, but it is a very good hypothesis.

The upshot really though is D should give up trying to win over C++ programmers as a strategy. Being able to wrap C+ libraries such as Qt is still a good goal though.

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



November 22, 2019
On Wed, 2019-11-20 at 01:34 +0000, Laeeth Isharc via Digitalmars-d wrote:
> […]
> 
> Look at the pace at which the pool of programmers is growing. I'm not sure that some of the programmers I work with were even programming at all in 2005.  Myself, I wouldn't have picked up programming again if it had to be Java or C++ because life is too short.
> 
[…]

Also all of the hypothesis around about decline in use of C++, are missing a crucial factor. In 1995/1996 universities stoppped teaching students languages such as C++ and taught only Java. So come the millennia, all new programmers entering the job market knew Java and little else.

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



November 22, 2019
On Friday, 22 November 2019 at 08:22:19 UTC, Russel Winder wrote:
> The upshot really though is D should give up trying to win over C++ programmers as a strategy.

The advantage in appealing to C and C++ programmers is that people who have an interest in compilers and performant libraries tend to also know either C or C++. I essentially don't think it matters so much how many users D has, as long as it can draw in people that pull in the same direction.

It doesn't really help to have a gazillion low quality do-nothing packages like npm... Stuff like Mir does help, but that is on the C-end of programming, not on the Java-end.

I think there is way too much emphasis on the number of libraries or users a language has.

November 22, 2019
On Friday, 22 November 2019 at 08:26:54 UTC, Russel Winder wrote:
> On Wed, 2019-11-20 at 01:34 +0000, Laeeth Isharc via Digitalmars-d wrote:
>> […]
>> 
>> Look at the pace at which the pool of programmers is growing. I'm not sure that some of the programmers I work with were even programming at all in 2005.  Myself, I wouldn't have picked up programming again if it had to be Java or C++ because life is too short.
>> 
> […]
>
> Also all of the hypothesis around about decline in use of C++, are missing a crucial factor. In 1995/1996 universities stoppped teaching students languages such as C++ and taught only Java. So come the millennia, all new programmers entering the job market knew Java and little else.

Some universities.

Mine was quite strong in C++, and still teaches it to this day.

The only lectures that switched to Java in 1996/97 were compiler design and distributed systems, with artificial intelligent allowing it as alternative in addition to the Prolog/C++/Lisp trio for assignment work.

It is always a question of university quality level.

--
Paulo
November 22, 2019
On Tuesday, 19 November 2019 at 08:51:49 UTC, Pavel Shkadzko wrote:
> This spring I started looking into D and trying it for some of the data analysis and scripting tasks. So, I am fairly new to the language and all its toolset (mainly using Python and Scala at work). I don't know C++. We do however have C++ engineers so I asked them around. I was quite surprised that none of them knew or even tried to use D. They of course heard about the language but that's it.



I was a C++ programmer for a while in various set and settings. And I was very much interested in D since the first day of my first job with C++!

One of the common feature of the places using C++ is, for lack of a better word, conservativeness. The fact is that the part of C++ programmers that were most interested in new techniques moved long ago to C# or Java, because they _do_ fix a lot of the C++ problems.

When being a C++ programmer you are subtly trained to think C++ is all that ou need and "there are no alternatives". It is because everything takes longer, so you like the result of you work (pain?) with more passion.

At this point in time the set of people who genuinely should only use C++ (because only that compiler is provided) are mostly the embedded engineers, and people stuck in legacy.

Conservativeness affects the organization to the point it is also more likely to be a follower and react to the market, rather than innovate. C++ers in innovative companies takes up D very quickly.

With C++ you are also stuck in forever learning mode. Maybe learning the new move constructor stuff is going to make life easier? C++ is updated way faster than practionners can handle, strangely enough D has more respect for your time.

It's not very surprinsing that it takes a new language (Python) to foster macjine learning on the front stage.

You can read up on "diffusion of innovation" to see the social structures involved and the particular mindset of late adopters (versus "early adopters" like forum users here).

https://books.google.fr/books?id=4N4_MUkcQy4C&lpg=PA13&ots=82-BfO7WWP&dq=Scratch%20the%20surface%20and%20you%E2%80%99ll%20find%20these%20real-world%20inhabitants%20are%20filled%20with%20pessimism%20and%20despair&hl=fr&pg=PA13#v=onepage&q&f=false
November 23, 2019
On Friday, 22 November 2019 at 14:31:46 UTC, Guillaume Piolat wrote:
> With C++ you are also stuck in forever learning mode. Maybe learning the new move constructor stuff is going to make life easier? C++ is updated way faster than practionners can handle, strangely enough D has more respect for your time.

Actually, that is a myth. There have been very few language changes in C++, and they are basically non-breaking. Most of the changes have been on a library level or as syntactical sugar.

- Lambdas er wrapped-up objects. So mostly syntactical.

- Stackless coroutines are wrapped-up promises.

- Move semantics is type casting (they added && with some peculiar rules to avoid some user errors).

- Type traits are mostly library constructs.

The basic problem with C++ is that it cannot take on breaking changes, so it is stuck with some seemingly arbitrary exceptions and restrictions, and unification can sometimes be difficult to understand.

This is really a consequence of C++ being primarily C with some extras like OO, exceptions, overloading and most code written prior to 2011 was C code with some OO stuff and simple templating where OO fell short in terms of performance.

The biggest issue many have with C++ is that C++ cannot clean up their syntax and semantics.

D can though.

November 23, 2019
On Fri, 2019-11-22 at 13:39 +0000, Paulo Pinto via Digitalmars-d wrote:
> On Friday, 22 November 2019 at 08:26:54 UTC, Russel Winder wrote:
> > 
[…]
> Some universities.

Good point, I was wrong to imply the claim all universities.

> Mine was quite strong in C++, and still teaches it to this day.

I had been teaching C++ in term 2 (term 1 was using Miranda) at UCL and we switched to Java in both terms with a suitable change of content to do much more on algorithms and data structures. Then I moved to KCL and we switched Modula-2 to Java in terms 1 and 2 with roughyl the same course content as at UCL (I wonder why? :-) ).

> The only lectures that switched to Java in 1996/97 were compiler design and distributed systems, with artificial intelligent allowing it as alternative in addition to the Prolog/C++/Lisp trio for assignment work.
> 
> It is always a question of university quality level.

And indeed country. It was the top flight universities in the UK that made the switch to Java.

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk