Author Topic: "Stop Teaching C" - Kate Gregory  (Read 43958 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
"Stop Teaching C" - Kate Gregory
« on: October 30, 2016, 11:33:16 pm »


Kate Gregory explains her reasons in this funny video  :-+
 

Offline dave_k

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #1 on: October 31, 2016, 12:53:39 am »
.. and it's for sale? Or you want to swap it for a tin of striped paint?  :-DD
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: "Stop Teaching C" - Kate Gregory
« Reply #2 on: October 31, 2016, 01:07:13 am »
Maybe Legacy figured out tggzzz isn't browsing this section and wanted to hide this lecture  :popcorn:

IMHO this thread should be moved though and I think the lecture has some very valid points on how to use C++ to create robust programs and leave the bad things of C out.
« Last Edit: October 31, 2016, 01:22:10 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #3 on: October 31, 2016, 01:53:16 am »
Yes.  Move it.  This is the wrong place.


As for the content - I must applaud it wholeheartedly.

Teaching new people the old ways - and then having to un-learn a lot of that to be able to learn the better way of doing things is demonstrably idiotic - but it happens through laziness and complacency... and, all too often, through the lack of support by the establishment to retire the archaic tools they were brought up on.

There was one line near the start that I found as rather profound - and a key element of learning

"You can focus on whatever you want to focus on - whether it's "If"s or loops or something... the fact that there's a string class for them is a minor miracle to those of us who started learning in the 80's.  It's not a minor miracle to the people you are teaching today - it's just how the world is."

This is why the kids of today grow up using the technology as they do.  They don't need to understand the history; they don't need to understand the engineering to get to make the technology do something useful - and they can get pretty advanced in the utilisation without it.  Certainly, there will be a point where some individuals will take things further and some of this obscure information may be necessary, but not for 80% of those who want to get into it - at least not in the first day or two!
« Last Edit: October 31, 2016, 02:19:39 am by Brumby »
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: "Stop Teaching C" - Kate Gregory
« Reply #4 on: October 31, 2016, 02:43:02 am »
Yes.  Move it.  This is the wrong place.


As for the content - I must applaud it wholeheartedly.

Teaching new people the old ways - and then having to un-learn a lot of that to be able to learn the better way of doing things is demonstrably idiotic - but it happens through laziness and complacency... and, all too often, through the lack of support by the establishment to retire the archaic tools they were brought up on.

In some cases a one trick pony is better than a jack of all trades. But not in most.
Eventually people gravitate to sowemewhere in between. A few tricks pony or a jack of most trades , master of some.
Deciding what should be considered for retirement as archaic, would make a great PhD thesis, getting a concensus and applying it in real life would be a different story.

Most of the annoying/long running/recurring threads "here" are mostly because of lack of basic fundamental "archaic" knowledge or skills.

 


   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2183
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #5 on: October 31, 2016, 03:07:22 am »
The crux of the story can be summarised into one short paragraph, as it is in most C++ books, and easily undersood...
It takes a c++ devotee to drag it out to an hour, not unlike a lot of c++ code >:D  :box:
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
"Stop Teaching C" - Kate Gregory
« Reply #6 on: October 31, 2016, 05:43:45 am »
Yes.  Move it.  This is the wrong place.


As for the content - I must applaud it wholeheartedly.

Teaching new people the old ways - and then having to un-learn a lot of that to be able to learn the better way of doing things is demonstrably idiotic - but it happens through laziness and complacency... and, all too often, through the lack of support by the establishment to retire the archaic tools they were brought up on.

In some cases a one trick pony is better than a jack of all trades. But not in most.
Eventually people gravitate to sowemewhere in between. A few tricks pony or a jack of most trades , master of some.
Deciding what should be considered for retirement as archaic, would make a great PhD thesis, getting a concensus and applying it in real life would be a different story.

Most of the annoying/long running/recurring threads "here" are mostly because of lack of basic fundamental "archaic" knowledge or skills.

Fun Fact: Most people quote the "Jack of All Trades, Master of None" part of the saying, but invariably leave out the ending...

"Jack of All Trades, Master of None, but surely better than a Master of Some."
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #7 on: October 31, 2016, 05:59:27 am »
i dont read it but i kinda agree with the topic. reusable functions "only" procedure as in C is obsolete. what we need is reusable object and of course still reusable functions. i cannot distinguish a pure C code since when i learnt C/C++, C++ was already there, so terms like "extern C" is pure nonsense to me. they should teach C++ first, and then if necessary C just for additional knowledge, or limited resources platform like embedded mcu.

Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #8 on: October 31, 2016, 06:16:48 am »
they should teach C++ first, and then if necessary C just for additional knowledge, or limited resources platform like embedded mcu.

I think Kate Gregory might agree with you.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #9 on: October 31, 2016, 07:33:09 am »
they should teach C++ first, and then if necessary C just for additional knowledge, or limited resources platform like embedded mcu.
I think Kate Gregory might agree with you.
btw i think learning C++ is also learning C at the same time, its just C is subset of C++, and C++ is superset of C. so when we learn C++, all is not lost in C, except some subtleties specific to C calling convention important when you want to interface with older/external codes/binaries.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #10 on: October 31, 2016, 07:47:48 am »
Fun Fact: Most people quote the "Jack of All Trades, Master of None" part of the saying, but invariably leave out the ending...
"Jack of All Trades, Master of None, but surely better than a Master of Some."
why people ruling out the possibility of "Jack of All Trades, Master of Everything"? dont tell me what i cant do! :P

extern C tells the linker to find library in C calling convention, which is standardized.
yeah i mean if you are building your app from scratch, there is no reason for you to make an archaic convention for new functions anymore. hence there should be no need for "extern C". except for some specific, diminishing and subjected to extinction reasons mentioned above.
« Last Edit: October 31, 2016, 07:51:54 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: "Stop Teaching C" - Kate Gregory
« Reply #11 on: October 31, 2016, 07:52:46 am »
Fun Fact: Most people quote the "Jack of All Trades, Master of None" part of the saying, but invariably leave out the ending...
"Jack of All Trades, Master of None, but surely better than a Master of Some."
why people ruling out the possibility of "Jack of All Trades, Master of Everything" dont tell me what i cant do! :P


Anarchy!!! How can quarterly earnings be possibly predicted when too many people have this kind of attitude ?  ;)
   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #12 on: October 31, 2016, 08:05:26 am »
Fun Fact: Most people quote the "Jack of All Trades, Master of None" part of the saying, but invariably leave out the ending...
"Jack of All Trades, Master of None, but surely better than a Master of Some."
why people ruling out the possibility of "Jack of All Trades, Master of Everything" dont tell me what i cant do! :P
Anarchy!!! How can quarterly earnings be possibly predicted when too many people have this kind of attitude ?  ;)
i'm not sure what you mean, but what i understand is why people who spend to much things on a particular timeframe can be the same as a person who spend on one particular thing on that same particular time frame? right? well my answer is because that "speciallized" person who spent on one particular thing to become a master could waste alot of time in the process in clubbing, beering and partying, the jack of all trades could be not.

Finally, I have to include a several MB runtime library for my C++ programs, while many C compilers depend on no DLL files except for msvcrt.dll and common Win32 dll files.
mee too, but its (calling convention) handled by macro nowadays, and i will avoid nasty call like passing the whole class to a dll with hope that the pointer who take it whatever data type it is, will point to the right location, because i'm aware of runtime virtual table.
« Last Edit: October 31, 2016, 08:15:06 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: "Stop Teaching C" - Kate Gregory
« Reply #13 on: October 31, 2016, 08:17:55 am »
"C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C."

http://harmful.cat-v.org/software/c++/linus

From my personal experience, I tend to agree with this.
I want to believe that there are C++ programmers who really know what they are doing.
I guess I just haven't met them...
 
The following users thanked this post: boffin, Ian.M, Bruce Abbott, george.b

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #14 on: October 31, 2016, 08:22:09 am »
"C++ is a horrible language."
here we go again :palm:
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #15 on: October 31, 2016, 08:44:29 am »
C and C++ both have their own problems. Neither is superior to the other. Lisp sucks. ADA sucks. Python sucks. Go sucks. D sucks. This is 50 years of computer science turd shuffling.

We need a new language that reaches down to the hardware and up to the application with some fresh ideas.

But until then everyone needs to STFU with the whining about C and build things with whatever tools you have.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #16 on: October 31, 2016, 09:32:05 am »
Maybe Legacy figured out tggzzz isn't browsing this section and wanted to hide this lecture  :popcorn:

... which would be mistaken, of course.

I'm certainly not going to waste an hour of my remaining life watching the whole video, but it seems to me she is saying that when teaching beginners (inc 12y year olds!) to use the "high-level" abstractions  in C++, you shouldn't teach C first. That seems pretty sensible.

But most people have figured that if you want to teach "high level" abstractions to beginners in a way they can use them to earn money, there are much better languages to use.

I didn't see (but quite probably missed it in my quick skim), how to teach what people should do when something doesn't work as expected, e.g. a non-standard library or the compiler. The suggestion to use the debugger is, um, optimistic since C++ data in memory is untyped: when you most need a debugger, it can't accurately tell you what's there, let alone how it got there.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #17 on: October 31, 2016, 09:51:08 am »
tgzzz - spot on. I rarely use a debugger and only in early dev to debug test cases. It's a crutch that isn't there when you have to take the biggest falls. Most things I get handed are steaming core dumps with no debug symbols. You need to know how to fight these.

I'd rather people started at the bottom and got an idea of assembly and how the CPU works at least roughly, then looked at slightly higher level languages (C), then looked at high level languages (C#/Java) if you need that sort of thing.

As for C vs C++, every place I'd use C++ I could use either Java or plain old C and tend to choose them respectively. C++ lumbers me with abstractions that are historically poorly conceived or memory heavy so I either don't use them and just use C or do use them and might as well use Java and get some higher level OO support. C++ sits in a weird void in the middle full of type, cast, structure and object weirdness.
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #18 on: October 31, 2016, 10:10:40 am »
I'm a prolific user of valgrind. Finds all sorts of nasties like use after frees as well.

I wrote my own data type library in C about 15 years ago as well that is quite good in these circumstances. Firstly it is heavily splattered with assert macros to force the fail fast methodology. Secondly, it gives you a to_graphviz() function for each fundamental type that will puke a graphviz file to stderr. Then a shell script that picks these out with cut marks, drops them in tmp and then renders the graphviz when it hits it and throws it in an image viewer. You can step through a program (usually with getc(), no debugger) and see the data structure changes graphically then.

I may tidy it up and stick it on github one day.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #19 on: October 31, 2016, 12:50:11 pm »
As for C vs C++, every place I'd use C++ I could use either Java or plain old C and tend to choose them respectively. C++ lumbers me with abstractions that are historically poorly conceived or memory heavy so I either don't use them and just use C or do use them and might as well use Java and get some higher level OO support. C++ sits in a weird void in the middle full of type, cast, structure and object weirdness.

Yes indeed. I'm reminded, w.r.t. high level abstractions, that C++'s predecessors Smalltalk and Objective-C are an improvement on C++.

C++'s designers chose to take the attitude that "we don't know what's best, so we'll punt difficult decisions to the ordinary developers". The predictable consequence is a range of implementation decisions that significantly reduces the chances that one library/implementation will play nicely with another.

One of the interesting phenomena when Java was introduced was that the papers on it and discussions about it frequently mentioned hard-won experience from other languages. In contrast C++ only mentioned C++ and C, and it was clear that many authors had a very narrow, blinkered view of the world. It is not surprising that they slowly reinvented concepts, poorly.

C has the conceptual integrity of staying close to the silicon, but even then the computer science bods have added a lot of ill-fitting cruft. (Is it possible to "cast away constness" now?)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2183
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #20 on: October 31, 2016, 01:19:35 pm »
Although I learnt C before C++ existed, i.e. I've been programming for a long time, I'm only a very casual programmer and know nothing of the software industry.

With that in mind, my question is:
Given all of the higher (than C++) level languages doing the rounds on all the major OS's and the reluctance to fully embrace C++ in the embedded world, is C++ jostling for somewhere to sit or does it have a dominant field somewhere?
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #21 on: October 31, 2016, 01:27:48 pm »
Although I learnt C before C++ existed, i.e. I've been programming for a long time, I'm only a very casual programmer and know nothing of the software industry.

With that in mind, my question is:
Given all of the higher (than C++) level languages doing the rounds on all the major OS's and the reluctance to fully embrace C++ in the embedded world, is C++ jostling for somewhere to sit or does it have a dominant field somewhere?

C++ is pretty much the glue underneath most of our non-unix style computing i.e. windows and desktop applications. It has some applications in the server space such as SQL Server etc. Google also seem to use it for a lot of their stuff although they saw fit to start funding their own language (Go) that fits the same niche as it's expensive to build software in.

I see it occasionally in the finance sector, but it's dying rapidly. Managed languages (Java and C#) is where it's at with some Python creeping in and some people in shorts with macbooks writing Clojure or ruby but we have to rewrite all their shit in Java after they've gone anyway...

As for C vs C++, every place I'd use C++ I could use either Java or plain old C and tend to choose them respectively. C++ lumbers me with abstractions that are historically poorly conceived or memory heavy so I either don't use them and just use C or do use them and might as well use Java and get some higher level OO support. C++ sits in a weird void in the middle full of type, cast, structure and object weirdness.

Yes indeed. I'm reminded, w.r.t. high level abstractions, that C++'s predecessors Smalltalk and Objective-C are an improvement on C++.

C++'s designers chose to take the attitude that "we don't know what's best, so we'll punt difficult decisions to the ordinary developers". The predictable consequence is a range of implementation decisions that significantly reduces the chances that one library/implementation will play nicely with another.

One of the interesting phenomena when Java was introduced was that the papers on it and discussions about it frequently mentioned hard-won experience from other languages. In contrast C++ only mentioned C++ and C, and it was clear that many authors had a very narrow, blinkered view of the world. It is not surprising that they slowly reinvented concepts, poorly.

C has the conceptual integrity of staying close to the silicon, but even then the computer science bods have added a lot of ill-fitting cruft. (Is it possible to "cast away constness" now?)

Couldn't agree more. I keep receiving tangles of boost and stl to this day that proves that point. I can usually rewrite the whole damn thing in Java from scratch including the test suite before I've even untangled the mess even as a seasoned C++ wrangler. And then there's sticky tape like cmake and the like that just never work properly.

Anyway I'm going to stop ranting now and go and make some money :)
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: "Stop Teaching C" - Kate Gregory
« Reply #22 on: October 31, 2016, 01:45:11 pm »
Although I learnt C before C++ existed, i.e. I've been programming for a long time, I'm only a very casual programmer and know nothing of the software industry.

With that in mind, my question is:
Given all of the higher (than C++) level languages doing the rounds on all the major OS's and the reluctance to fully embrace C++ in the embedded world, is C++ jostling for somewhere to sit or does it have a dominant field somewhere?

Java, C and C++ are the three major programming languages.

http://www.tiobe.com/tiobe-index/

 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #23 on: October 31, 2016, 04:42:24 pm »
I see [C++] occasionally in the finance sector, but it's dying rapidly. Managed languages (Java and C#) is where it's at with some Python creeping in and some people in shorts with macbooks writing Clojure or ruby but we have to rewrite all their shit in Java after they've gone anyway...

Snort :)

Interestingly, some soft-realtime Java financial applications are very adept at avoiding GC pauses and maintaining high throughput - which is usually claimed to be an advantage for C++. Some telecom applications are the same.

OTOH if hard-realtime behaviour is required, then most of C++'s "advantageous facilities" have to be avoided, and it is necessary to write in a subset of C.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #24 on: October 31, 2016, 05:17:43 pm »
Indeed. In fact that's how the Windows kernel looks. It's C++ but it's not.

Erlang is the other option in this space. Now that's a platform :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf