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

0 Members and 1 Guest are viewing this topic.

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #50 on: October 31, 2016, 11:40:02 pm »
@westfw
as gentoo user I hate python :D

emerge is written in python along to a lot of tools
and python is always the first reason of my troubles
(especially under catalyst when I "cook" new stages
or when I emerge --sync an old stage4)

ok, it's not due to the language, which is fine, elegant, etc
it's just the tool, implementation and handling matter

the behavior of python v2.* is not exactly compatible with v3.*
and this may cause (and practically it does) troubles when you upgrade

I mean the code is not exactly portable "as is", it needs some work  :-//
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 1401
  • Country: 00
Re: "Stop Teaching C" - Kate Gregory
« Reply #51 on: November 01, 2016, 12:12:56 am »
has anyone bought the license for the C++ compiler  :D ?

One of the best C/C++ compilers is available for free. Why on earth would somebody pay for it (apart from donations)?
The difference between theory and practice is less in theory than
the difference between theory and practice in practice.
Expensive tools cannot compensate for lack of experience.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10243
  • Country: gb
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #52 on: November 01, 2016, 12:38:58 am »
Don't forget that C# is, to all intents and purposes, Java with a different runtime.
Well, I'll have to respectfully disagree there. There's a good deal of difference between Java and C#, though I know what you're trying to say. And I've always hated Java, BTW. Really, though, the natural successor to C and C++ is D. It really is an excellent systems language, and is very pragmatic in it's approach.

A few months before C# was released, Anders Hejlsberg (the C# designer) gave a talk on C# at my workplace. After listening to what he had to say, we said we thought it sounded like Java with a different philosophy to the runtime environment, and asked him if that was the case. He didn't disagree, so we presume we did understand :)

The key difference is that C# does static optimisation based on what the compiler guesses the code will do at runtime, whereas HotSpot measures what the code is actually doing and optimises what is actually occurring. Both approaches are valid, of course, and are advantageous in different situations.

Quote
C++, in it's infancy and before STL, was a simple language and more or less an extension of C. Despite that, it was still notoriously difficult to write a compiler for it. I remember I had all sorts of problems getting templates to work if you went too far off the reservation and tried something clever. That right there should have been a sign that something was conceptually wrong.

There was worse: it was discovered the c++ template was Turing-complete, but the design committee didn't believe it until someone rubbed their noses in it by causing the compiler to emit the sequence of prime numbers during (infinite) compilation! That's from https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming#History_of_TMP with my emphasis added. The original is at http://www.erwin-unruh.de/primorig.html Note: not designed, but discovered - and that's exactly what happened.

Personally I prefer my languages to be designed, not discovered!

Quote
But that's how I like C++. It's an excellent extension to the C language. But it didn't stop there. It's turned into this whacky, steam-punk like contraption, with random pipes and valves tacked on all over the place, lumbering, belching steam and black smoke, and there's no end in sight for what else might get tacked on.

Snort :) Having said that, Java is showing similar behaviour :(

Quote
No one actually even uses the entire language, or even close to it. I'm not talking about all of the libraries. I'm talking about just the basic language features. People pick the handful of things they like, and that's all they use. You go somewhere else, and they use different things. Two C++ programs written by two different groups that do EXACTLY the same thing can written so differently that an expert C++ programmer might understand one perfectly well, but have significant trouble understanding the other. Each group will have their arbitrary rules: we use THIS, we don't use THAT. It's kind of ridiculous. Streams are a perfect example.

Just so :(

Quote
C++ is a nightmarish mish-mosh of almost academic and "safe" OOP concepts, combined with coiled cobras ready to strike, and in between is an incomprehensible  labyrinth of strange notation and obscure behavior. It's like someone took 2 or 3 completely different and incompatible language, tossed them in a blender and said, "Screw it...let the programmers figure it out."

Just so. I can't comment on D, only having briefly looked at it and never used it.
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
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10243
  • Country: gb
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #53 on: November 01, 2016, 12:47:59 am »
That's a valuable start, because then they will have a clue that they need to choose an appropriate language in which to express their problem. Good luck expressing an FSM in Prolog, or a forward/backward chaining algorithm in a matrix-based language, etc, etc, etc!

Why? FSM in Prolog is perfectly fine:
http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node5.html

Not that I would teach introduction to programming with Prolog, though ...

Well, yes, they are both Turing complete. You can also use a hammer to insert a screw :)

Quote
Not sure what you mean by "matrix-based", something like R or Matlab? I don't see why such algorithm would be difficult in these. Befunge (https://en.wikipedia.org/wiki/Befunge) on the other hand ...

Yes, that kind of thing; there are many. Probably not APL, even though the characters no longer require changing the typewriter's golfball :)

Quote
Quote
Why bother introducing them to another language trying to do OOP (and failing to do it well), when there are so many completely different domains out there? If you want to get the students into the deeply embedded domain, use C or ADA.

Because not all curicula are about (deeply) embedded programming? The uni I was at was teaching basics of programming even to future chemistry and mechanical engineers that would go on to design oil rigs and refineries, for example. They may never develop software for sale during their careers but they may have to build a simulation of something, to analyze some data or to build a plugin for that Matlab they are most likely going to be using. So knowing at least the basics is going to be useful for them.

That's precisely my point!

Quote
But as I have said - C++ is often not taught or it is an elective - in that case it is not my business to question the motivation of the students why did they choose the course. Perhaps they want to simply increase their value on the job market - there are certainly more jobs for C/C++ programmers than for ADA ones, for example.

Such students should be kept away from keyboards. And yes, it is my business and duty (as an interviewer) to question their motivation :)
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 nctnico

  • Super Contributor
  • ***
  • Posts: 17998
  • Country: nl
    • NCT Developments
Re: "Stop Teaching C" - Kate Gregory
« Reply #54 on: November 01, 2016, 12:51:47 am »
A few months before C# was released, Anders Hejlsberg (the C# designer) gave a talk on C# at my workplace. After listening to what he had to say, we said we thought it sounded like Java with a different philosophy to the runtime environment, and asked him if that was the case. He didn't disagree, so we presume we did understand :)
AFAIK C# is Java which works. I recall reading that somewhere down the line Microsoft abandoned C++, didn't manage to get people into using Visual basic, found Java to be a mess (which it is) and came up with C# as a final solution to have an alternative for C++. The rest is history.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #55 on: November 01, 2016, 12:56:54 am »
Quote
there are certainly more jobs for C/C++
programmers than for ADA ones

sure, but consider the good side of the coin:

those in the circle of ADA programmers
are paid more money than those
in the circle of C/C++ programmers :D

good, ain't it?
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #56 on: November 01, 2016, 01:09:19 am »
if you know Prolog then you can find
a lot of job opportunities with AADL
e.g. the Stood Team

yes, unbelievable but Stood is actually written in Prolog

well paid job, unfortunately it's a damn complex job
and they don't need a lot of programmers  :palm:

(I know a few dudes in that team, their emails
due to Stood bugs report
I mean Stood is used in avionics for everything,
including code-design and documentation)
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10243
  • Country: gb
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #57 on: November 01, 2016, 01:32:26 am »
A few months before C# was released, Anders Hejlsberg (the C# designer) gave a talk on C# at my workplace. After listening to what he had to say, we said we thought it sounded like Java with a different philosophy to the runtime environment, and asked him if that was the case. He didn't disagree, so we presume we did understand :)
AFAIK C# is Java which works. I recall reading that somewhere down the line Microsoft abandoned C++, didn't manage to get people into using Visual basic, found Java to be a mess (which it is) and came up with C# as a final solution to have an alternative for C++. The rest is history.

Not quite.

MS couldn't use their usual "embrace and extend" tactic with Java, so they decided to triumphantly reinvent that particular wheel.

Unfortunately due to their strategy, they couldn't abandon C++, so they brought it inside the runtime via the "unsafe" keyword. That ensured they threw away an advantage of managed runtime environments - leaving them with the (small) overhead of a managed environment without its (major) advantage.

While the business rationale is impeccable, as an engineer I think that tradeoff is wrongheaded.
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 free_electron

  • Super Contributor
  • ***
  • Posts: 7242
  • Country: us
    • SiliconValleyGarage
Re: "Stop Teaching C" - Kate Gregory
« Reply #58 on: November 01, 2016, 01:37:50 am »
C is a slapped together (it was made so they could make an OS) , language for an obsolete computer architecture (PDP) , based on a lexer and parser that is so stupid it needs semicolons to figure out where a line ends ...
it's time it dies.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9207
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #59 on: November 01, 2016, 03:41:41 am »
Personally I prefer my languages to be designed, not discovered!
the only thing that is designed proof is a dead stone. once you open the complexity, how do you expect it is more perfect than the source of its existence? i mean, a language that put more restriction on the users, hence more controlled parameters from inside, designed by the language architech... granted it will be easier to make it turing complete, but is it worth the cost? to the users/programmers freedom side of things?

C is a slapped together (it was made so they could make an OS) , language for an obsolete computer architecture (PDP) , based on a lexer and parser that is so stupid it needs semicolons to figure out where a line ends ...
it's time it dies.
oh you havent typed in the modern languages. the ;, at, on, in... whatever syntaxes is notoriusly overwhelming, if i use that words correctly... be careful on what you pray for..
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?
 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1199
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #60 on: November 01, 2016, 04:00:04 am »
C is a slapped together (it was made so they could make an OS) , language for an obsolete computer architecture (PDP) , based on a lexer and parser that is so stupid it needs semicolons to figure out where a line ends ...
it's time it dies.

Well, as many bad things as I have to say about C++ I can say good about C. I think C is darn near the perfect at doing what it was designed to do.
 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1199
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #61 on: November 01, 2016, 04:07:17 am »
Just so. I can't comment on D, only having briefly looked at it and never used it.

Oh, you should definitely try it. The next time you have a small little utility to write, give it a try. You'll slowly find yourself using it more and more. A lot of it looks deceptively like C, but that was just for familiarity. It's what a modern language should look like.
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3071
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #62 on: November 01, 2016, 04:23:47 am »
Quote
ADA
I was at ARM TechCon last week, and I finally figured out why Ada (and other langauges) have no popularity in embedded...
There was this big trade show, and lots of vendors.
IAR and Greenhills were there with their C compilers (plus ARM themselves with Keil, and Atmel/etc with gcc.)
Assorted vendors offering specialized debugging tools.  For C.
Assorted vendors with networking stacks: USB, Bluetooth, TCP/IP, assorted random wireless protoocols.  In C.
Assorted vendors with operating systems:  mBed.  Micrium.  MyNewt.  Zephyr.  All in C.

And, on the edge of the room, there was AdaCore with their Ada Compiler...  All by themselves.

I didn't see any "D", and I'm not sure about C vs C++.   There might have been some Java.  No C#, AFAICT.  After C the most "interest" was in the BBC Micro Bit, which has its own graphical programming language (for kids, you know.)

Most of the realistic alternatives to C in the embedded space are just languages.  C is ... multiple industries!
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #63 on: November 01, 2016, 05:33:47 am »
based on a lexer and parser that is so stupid
it needs semicolons to figure out where a line ends

I don't agree, the problem is not the semicolon at the end of the line
the problem is the C grammar itself which allows silly constructs
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #64 on: November 01, 2016, 05:44:28 am »
And, on the edge of the room, there was AdaCore
with their Ada Compiler...  All by themselves.

so, no chance to promote my own made language :D ?
it looks ADA-like, not yet decided how to call it

p.s.
but on Irc I have seen a lot of ADA-dudes

p.s.2
Code: [Select]
2016-11-01--13-14-37---2016-11-01--16-51-50 - emerge  =sys-devel/gcc-4.1.2 - success - root
2016-11-01--18-14-10---2016-11-01--20-02-04 - emerge  =sys-devel/gcc-4.9.3 - success - root
2016-11-01--20-11-57---2016-11-01--20-38-24 - emerge  =dev-lang/gnat-gcc-4.1.2 - failure - root
2016-11-01--21-04-40---2016-11-02--00-34-12 - emerge  =dev-lang/gnat-gcc-4.6.4 - failure - root
2016-11-02--00-53-29---2016-11-02--04-18-11 - emerge  =dev-lang/gnat-gcc-4.9.3 - failure - root

it seems GNAT is having some ... difficulties (on gentoo)


Most of the realistic alternatives to C in the embedded space
are just languages.  C is ... multiple industries!

exactly the point: companies have invested money
resources, effort, etc
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #65 on: November 01, 2016, 05:55:22 am »
Quote
Bugs
327043 : dev-lang/gnat-gcc-4.3.4 - precompiled bundled gcc is linked against old libmpfr
386661 : [portage-multilib] dev-lang/gnat-gcc: configure error for x85-abi due to gnatboot-4.4-amd64.tar.bz2
402157 : Remove dev-lang/gnat-gcc and dev-ada/asis-gcc
501178 : dev-lang/gnat-gcc-4.6.4: gnatmake always fails because it cannot find liblto_plugin.so
502444 : dev-lang/gnat-gcc version bump request
520154 : dev-lang/gnat-gcc-4.7.3 ?/gnatboot-4.6 - add HPPA support
536124 : dev-lang/gnat-gcc-4.4.7 - In file included from .../work/gcc-4.4.7/gcc/unwind-dw2.c:333: .../work/gcc-4.4.7/gcc/config/i386/linux-unwind.h:138: error: field ‘info’ has incomplete type
549546 : dev-lang/gnat-gcc-4.3.6 fails to build on ppc
554966 : dev-ada/glade-2006.0: wants dev-lang/gnat-gcc-4.2.3 which fails with "configure: error: installation or configuration problem: C compiler cannot create executables."
560286 : dev-lang/gnat-gcc-4.6.4-r1: USE Flag 'multilib' not in IUSE for dev-lang/gnat-gcc-4.6.4
561968 : dev-lang/gnat-gcc-4.5.4 fails to merge in install phase with `USE Flag 'lto' not in IUSE`
586538 : dev-lang/gnat-gcc: old lto wrapper breaks newer gcc (e.g. using -march=native)
596932 : dev-lang/gnat-gcc-4.6.4 - src_install(): /bin/sh: line 3: cd: host-x86_64-pc-linux-gnu/lto-plugin: No such file or director

the fortune algorithm is required in order to emerge dev-lang/gnat-gcc  :-//
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4348
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #66 on: November 01, 2016, 06:00:19 am »
ARM TechCon

I see more bootstrappers for PowerPC
(which are also mainly used in avionics)
I believe ARM is less ADA friendly
perhaps less interests in the industry
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 1401
  • Country: 00
Re: "Stop Teaching C" - Kate Gregory
« Reply #67 on: November 01, 2016, 07:38:08 am »
AFAIK C# is Java which works.

Nope. C# works on windows. Java works everywhere.
The difference between theory and practice is less in theory than
the difference between theory and practice in practice.
Expensive tools cannot compensate for lack of experience.
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12479
  • Country: cn
  • Power Electronics Guy
Re: "Stop Teaching C" - Kate Gregory
« Reply #68 on: November 01, 2016, 07:51:34 am »
Nope. C# works on windows. Java works everywhere.

Ubuntu's default music player is written in C#.
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 444
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #69 on: November 01, 2016, 08:30:32 am »
It's deeper than that. Even the official ASP.net framework, official CLR, C# compiler,  visual studio core and recently SQL server work on Linux and MacOS. There's even an LLVM front end that compiles C# to native. All of them are open source apart from SQL Server.
« Last Edit: November 01, 2016, 08:32:15 am by setq »
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3071
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #70 on: November 01, 2016, 08:51:31 am »
I've now watched the video.  The title is a bit misleading - it's actually "Stop teaching C as the first step to teaching C++", and I think I mostly agree with the things she says. (particularly WRT skipping the whole "char*" "strings" that C requires.)  I think I disagree with her WRT "use the debugger to look at results" vs learning printf(); printf() may be awful, but not having your results actually print out is ... not satisfying.  (The assembler class did that for the PDP11 portion.  You'd write little programs that ran on a simulator, giving them things to work on by sticking them in memory before you started and looking at your results in memory when they finished.   Yuck.)  (although I also really dislike C++ "<<" streams.)

(It's a shame that strings in the C++ sense are so ... incompatible with deep embedded systems.  And that's a bit strange; they worked OK in BASIC on far less powerful computers, didn't they?   There would be so many fewer problems in the Arduino world if their String types actually worked well.)
 

Online Brumby

  • Supporter
  • ****
  • Posts: 9395
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #71 on: November 01, 2016, 08:59:37 am »
We're getting away from the point of the video....

For beginners on their way to learning C++, getting them to learn C first is going to make it harder to get into C++, as you've already taught them to think the wrong way.

If you want to teach an object-oriented language, then loading them up with archaic and inappropriate techniques is just making their journey harder and absolutely confusing, especially when the tendancy for thinking in object concepts is how they have been naturally processing the world up to this point.

Doing the retrograde learning process makes just as much sense as teaching water engineers how to build aquaducts ... and then tell them to forget about all that as you try to teach them about using pipes.  They're still holding to constrained thinking of open waterways and gravity - instead of the freedom from those constraints and the importance of pressures.

Remember, this is for beginners on their way to C++.

Once you've got there, then - by all means - let them learn more advanced stuff - like the issues involved in developing embedded systems ... and how to use the primitive features of C.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10243
  • Country: gb
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #72 on: November 01, 2016, 09:04:52 am »
We're getting away from the point of the video....

For beginners on their way to learning C++, getting them to learn C first is going to make it harder to get into C++, as you've already taught them to think the wrong way.

If you want to teach an object-oriented language, then loading them up with archaic and inappropriate techniques is just making their journey harder and absolutely confusing, especially when the tendancy for thinking in object concepts is how they have been naturally processing the world up to this point.

Yes, that was the point of the video and I wouldn't quibble with it.

But if your objective is to teach an OOP language without loading them up with archaic and inappropriate techniques, then C++ is completely the wrong endpoint! Use a modern language!
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 JPortici

  • Super Contributor
  • ***
  • Posts: 2560
  • Country: it
Re: "Stop Teaching C" - Kate Gregory
« Reply #73 on: November 01, 2016, 11:22:40 am »
what I really like from the Kate's talk is what she has underlined:

C++ is fundamentally different than C, everything that is valid C is valid C++
but C++ is a very different language and one needs to learn how to program in C++
and not C, to effectively use *the language* in any situation
i pulled the trigger. i HAVE to learn new languages, i'ts about time and i can't live with visual basic and c only so i went to the local library and took two books on c++. unfortunately those are from 1990 and 1993.
what yuo quotes was the very first chapters.
i guess 20 years of stressing it has not been enough :)?
 

Online Brumby

  • Supporter
  • ****
  • Posts: 9395
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #74 on: November 01, 2016, 11:30:01 am »
We're getting away from the point of the video....

For beginners on their way to learning C++, getting them to learn C first is going to make it harder to get into C++, as you've already taught them to think the wrong way.

If you want to teach an object-oriented language, then loading them up with archaic and inappropriate techniques is just making their journey harder and absolutely confusing, especially when the tendancy for thinking in object concepts is how they have been naturally processing the world up to this point.

Yes, that was the point of the video and I wouldn't quibble with it.

But if your objective is to teach an OOP language without loading them up with archaic and inappropriate techniques, then C++ is completely the wrong endpoint! Use a modern language!

I would agree - but what is the criteria that specifies the endpoint?  If it is an academic exercise to teach OOP, then you may be right (I'm not familiar enough with what's on offer to comment any further).  However, if it is to skill up someone going into a C++ environment, then there's no need to look any further.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf