August 02, 2019
On Thursday, 1 August 2019 at 20:02:08 UTC, Aurélien Plazzotta wrote:
[...]
> But don't fool yourself, D is not for beginners. Ali Çehreli is a very skilled programmer, ergo, he can't reason like a new/starting programmer anymore, regardless of his patience and kindness.

I am sorry, but this is very strange reasoning. Would you recommend a book on programming written by someone who is not a skilled programmer himself in any language? I certainly would not.

Besides, the OP has already expressed his appreciation for Ali’s writing.

Bastiaan.

August 02, 2019
On Friday, 2 August 2019 at 12:28:45 UTC, berni wrote:
> On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote:
>> Should I go for C and then when I become a better programmer change to D?
>> Should I start with D right now?
>
> In my oppinion C should have been deprecated about 50 years ago ...

I stopped there. How could you have deprecated a language 50 years ago since was first released in '72 (47 years ago).

C like it or not is still highly used today (Kernel, LIB, Embedded Systems).

If it was so terrible as you and others are saying it would be damned a long time ago.

It has flaws?

Sure, but like C++, D, Java, Go, Python has it owns flaws too and they all came later.

Sasha.
August 02, 2019
On Friday, 2 August 2019 at 13:45:17 UTC, Alexandre wrote:
> On Friday, 2 August 2019 at 12:30:44 UTC, berni wrote:
>> On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote:
>>> [...]
>>
>> In my oppinion C should have been deprecated about 50 years ago and it's not worth while to learn it if you are not interested in the history of programming or you have to learn it, because you need to maintain software which is allready written in C. But that's my oppinion; others may have a different sight.
>>
>> [...]
>
> Could you elaborate more about C being a burden? I have read so many people saying C gives a great foundation and should be everyone's first language. Now I am confused.

One example is this recent post: https://forum.dlang.org/post/yjgkatpbkdyyksldgrhf@forum.dlang.org

“[...] recently all the problems I am having with D are because D is actually superior to C and some assumptions I still have because of C should be uninstalled from my brain.”

If you plan on ending up with D anyway, I think that learning C first is an unnecessary detour and can be counter productive in some ways. And if your objective is to have fun, I would recommend against C (except for a masochistic kind of fun).

Don’t take the detour, take the D tour! :-)

Bastiaan.
August 02, 2019
On Fri, 2019-08-02 at 13:45 +0000, Alexandre via Digitalmars-d-learn wrote:
> 
[…]
> Could you elaborate more about C being a burden? I have read so many people saying C gives a great foundation and should be everyone's first language. Now I am confused.

C is a programming language created in the early 1970s to make writing UNIX easier. Early versions of UNIX (and Multics before it) were written in assembly language. Dennis Ritchie et al. wanted to use a programming language that had a higher level of abstraction than assembly language so as to make writing UNIX easier. BCPL gave many of the ideas for B which led to C, effectively a portable assembly language but with special eyes on the PDP-8, PDP-11, and later VAX-11 machine codes. C was hugely successful for writing operating systems because it was "close to the metal" and yet with better abstractions than assembly language. I spent many happy (and many unhappy) hours in the early 1980s writing device drivers for UNIX 6, UNIX 7, and BSD 4.0. C was the right tool for the job at hand at that time.

Many tools associated with UNIX were written in C, including the C compiler, since the only other option at the time in the UNIX context was assembly language. Already though there was the question: was C the right tool for the job of writing applications – as opposed to hardware controlling software. One could argue that "buffer overruns" was  clear evidence that C was the wrong tool for the job.

Unfortunately the obsession with C, even if it was not the right tool for the job at hand, had taken hold: if you didn't write your application in C you were somehow a second or third rate human being, let alone programmer.

Then came C++ (or then C with Classes) and the beginning of the rift between the C camp and the "we need a programming language with higher levels of abstraction" camp. I am sure many can write lots on the 1990s and 2000s and the various language wars, but here we are in 2010s entering the 2020s and we have D, Rust, Go, Java, Kotlin, Python, Ruby, C++, Lisp, Prolog, Erlang, etc. all of which have their problems, but all of which have their "sweet spots" for being the right tool for the job at hand. C is no longer the de facto standard language for writing all software. People are increasingly recognising that it is as if C were specifically created for writing software that controls hardware.

C still has a role in the world of programming, and it definitely has a status as one of the most important programming languages ever.

Moral of this story is that, for me, in 2019, if you are writing applications
software or software tools, C is not the right tool for the job.

-- 
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



August 02, 2019
On Friday, 2 August 2019 at 13:57:44 UTC, Bastiaan Veelo wrote:
> On Thursday, 1 August 2019 at 20:02:08 UTC, Aurélien Plazzotta wrote:
> [...]
>> But don't fool yourself, D is not for beginners. Ali Çehreli is a very skilled programmer, ergo, he can't reason like a new/starting programmer anymore, regardless of his patience and kindness.
>
> I am sorry, but this is very strange reasoning. Would you recommend a book on programming written by someone who is not a skilled programmer himself in any language? I certainly would not.

Even stranger when you consider the earlier recommendation to

> take pleasure in learning F*. It is a pure functional programming language based on logical-mathematical thought
August 02, 2019
On Thursday, 1 August 2019 at 22:36:06 UTC, Russel Winder wrote:
> On Thu, 2019-08-01 at 14:49 +0000, bachmeier via Digitalmars-d-learn wrote: […]
>> There's nothing wrong with Haskell if you want to take a deep dive into pure functional programming. I personally find Haskell to be more of a religion than a programming language. You can learn the same perspective from functional-first languages like Clojure, Scala, Ocaml, and F#.
> […]
>
> Whilst I agree that most "this is the one true programming language" people are quasi-religious, programming languages are not: Haskell is a just a lazy, pure functional programming language, some adherents show quasi-religious fervour, just as some adherents of C++, Java, C, Go, Rust, D, etc. do.
>
> I am not sure about F# (I do not know anything of it), but Clojure, Scala, and OCaml are very different from Haskell for various reasons, cf. lazy vs. eager, pure vs. impure. Haskell is a programming language worth learning for all programmers,along with Lisp, Prolog, and Erlang.
>
> I'll bet (but I have no experimental data, just a hypothesis) that any D programmer that knows Haskell writes better D than a D programmer who doesn't know Haskell.

This is getting somewhat off the topic of this thread, so all I'll say is that I agree with the recommendation to learn Haskell, but I don't think a beginner would get enough exposure to various approaches to programming. I did not personally see large benefits from Haskell, but perhaps I should have stuck with it longer.
August 02, 2019
On Friday, August 2, 2019 10:13:04 AM MDT bachmeier via Digitalmars-d-learn wrote:
> On Thursday, 1 August 2019 at 22:36:06 UTC, Russel Winder wrote:
> > On Thu, 2019-08-01 at 14:49 +0000, bachmeier via Digitalmars-d-learn wrote: […]
> >
> >> There's nothing wrong with Haskell if you want to take a deep dive into pure functional programming. I personally find Haskell to be more of a religion than a programming language. You can learn the same perspective from functional-first languages like Clojure, Scala, Ocaml, and F#.
> >
> > […]
> >
> > Whilst I agree that most "this is the one true programming language" people are quasi-religious, programming languages are not: Haskell is a just a lazy, pure functional programming language, some adherents show quasi-religious fervour, just as some adherents of C++, Java, C, Go, Rust, D, etc. do.
> >
> > I am not sure about F# (I do not know anything of it), but Clojure, Scala, and OCaml are very different from Haskell for various reasons, cf. lazy vs. eager, pure vs. impure. Haskell is a programming language worth learning for all programmers,along with Lisp, Prolog, and Erlang.
> >
> > I'll bet (but I have no experimental data, just a hypothesis) that any D programmer that knows Haskell writes better D than a D programmer who doesn't know Haskell.
>
> This is getting somewhat off the topic of this thread, so all I'll say is that I agree with the recommendation to learn Haskell, but I don't think a beginner would get enough exposure to various approaches to programming. I did not personally see large benefits from Haskell, but perhaps I should have stuck with it longer.

Using Haskell or other similar functional languages can be extremely beneficial towards improving how good you are at recursion, and it can make you much better at functional programming paradigms, because you really don't have much choice when using a language like Haskell. For a couple of years, Haskell was my go-to language for all of my side projects, and I got much better at the functional side of things (e.g. when I first used D templates, I had no problem with their functional nature to the point that I didn't realize that they were functional in nature until I read an article that compared Haskell to C++ templates). That being said, I'd _hate_ to use Haskell for anything serious or for any large projects. It's just too restrictive.

My feeling is that functional languages are likely to be a very poor place for most folks to start learning, much as I think that they're great for someone to learn and work with at some point. I have heard of beginning programming classes using functional languages and having it go very well, but it seems hard to believe to me. Imperative programming can already be a lot for beginners, but most people really don't think even vaguely in a functional manner. Even simple recursion tends to be a bit of a mind-bender for people at first.

- Jonathan M Davis




August 02, 2019
On Friday, 2 August 2019 at 15:51:25 UTC, Russel Winder wrote:
> On Fri, 2019-08-02 at 13:45 +0000, Alexandre via Digitalmars-d-learn wrote:
>> 
> […]
>> Could you elaborate more about C being a burden? I have read so many people saying C gives a great foundation and should be everyone's first language. Now I am confused.
>
> C is a programming language created in the early 1970s to make writing UNIX easier. Early versions of UNIX (and Multics before it) were written in assembly language. Dennis Ritchie et al. wanted to use a programming language that had a higher level of abstraction than assembly language so as to make writing UNIX easier. BCPL gave many of the ideas for B which led to C, effectively a portable assembly language but with special eyes on the PDP-8, PDP-11, and later VAX-11 machine codes. C was hugely successful for writing operating systems because it was "close to the metal" and yet with better abstractions than assembly language. I spent many happy (and many unhappy) hours in the early 1980s writing device drivers for UNIX 6, UNIX 7, and BSD 4.0. C was the right tool for the job at hand at that time.
>
> Many tools associated with UNIX were written in C, including the C compiler, since the only other option at the time in the UNIX context was assembly language. Already though there was the question: was C the right tool for the job of writing applications – as opposed to hardware controlling software. One could argue that "buffer overruns" was  clear evidence that C was the wrong tool for the job.
>
> Unfortunately the obsession with C, even if it was not the right tool for the job at hand, had taken hold: if you didn't write your application in C you were somehow a second or third rate human being, let alone programmer.
>
> Then came C++ (or then C with Classes) and the beginning of the rift between the C camp and the "we need a programming language with higher levels of abstraction" camp. I am sure many can write lots on the 1990s and 2000s and the various language wars, but here we are in 2010s entering the 2020s and we have D, Rust, Go, Java, Kotlin, Python, Ruby, C++, Lisp, Prolog, Erlang, etc. all of which have their problems, but all of which have their "sweet spots" for being the right tool for the job at hand. C is no longer the de facto standard language for writing all software. People are increasingly recognising that it is as if C were specifically created for writing software that controls hardware.
>
> C still has a role in the world of programming, and it definitely has a status as one of the most important programming languages ever.
>
> Moral of this story is that, for me, in 2019, if you are writing applications
> software or software tools, C is not the right tool for the job.

Do you thing D would be the right tool for the job at this point for me? Assuming I have 2 goals in mind: 1) become a better programmer and 2) want to make fun writing software for myself and if possible show something I might be proud of.
I thought C would be a better choice for the 1), because everyone says it's great to see whats behind the hood and things like that. My experience with C btw is CS50 course, plus around 200/300 pages of some books, still reading and a few toy projects. So, basically 0 knowledge. haha. But after reading your opinion, I guess C might not be the right tool for me, since I wont be doing any kind of thing related to hardware (I think).



I have receive so many good opinions so far. I realize there is no consensus what so ever. As I was suggested Haskell, Python, D, C etc. It's a good thing, but hard to make a decision.
August 02, 2019
On Fri, 2019-08-02 at 10:25 -0600, Jonathan M Davis via Digitalmars-d-learn wrote:
> 
[…]
> My feeling is that functional languages are likely to be a very poor place for most folks to start learning, much as I think that they're great for someone to learn and work with at some point. I have heard of beginning programming classes using functional languages and having it go very well, but it seems hard to believe to me. Imperative programming can already be a lot for beginners, but most people really don't think even vaguely in a functional manner. Even simple recursion tends to be a bit of a mind-bender for people at first.
[…]

At UCL in the late 1980s and early 1990s, we used a functional programming language in the first term and C++ in the second term for teaching programming. Initially Scheme was the functional programming language but we then switched to Miranda (which was a pre-cursor to Haskell).

This deep immersion in two totally different programming paradigms worked very well. The mid/late 1990s mad rush to Java everywhere in teaching (of which I was a part) was in hindsight madness (of a global sort). The move by many institutions to using Python first and then Java rebalances somewhat but is missing the point – it's about the paradigms. I have retrenched as a believer in the Haskell/C++, or Prolog/Java, or some such. In the new era with new undergraduates already knowing Scratch and Python, universities should really go the whole hog in getting programming paradigms and programming as a skill as well as knowledge, with all the tools,fair and square into the first year curriculum.

Of course I have been out of academia for 20 years, and am now out of
employment, so my views have no impact. :-)

-- 
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



August 02, 2019
On Friday, 2 August 2019 at 14:05:20 UTC, SashaGreat wrote:
> On Friday, 2 August 2019 at 12:28:45 UTC, berni wrote:
>> On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote:
>>> Should I go for C and then when I become a better programmer change to D?
>>> Should I start with D right now?
>>
>> In my oppinion C should have been deprecated about 50 years ago ...
>
> I stopped there. How could you have deprecated a language 50 years ago since was first released in '72 (47 years ago).

Yes, that was intentional. What I wanted to say is, that I think, that it would have been better, if C was never invented at all... In that case, there would have been space for an other language for writing operating systems, without that much bugs in its design. (But one never knows afterwards...)