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

0 Members and 2 Guests are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #50 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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #51 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: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #52 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: 8515
  • Country: us
    • SiliconValleyGarage
Re: "Stop Teaching C" - Kate Gregory
« Reply #53 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).
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11534
  • Country: my
  • reassessing directives...
Re: "Stop Teaching C" - Kate Gregory
« Reply #54 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..
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 John Coloccia

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #55 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: 1208
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #56 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.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #57 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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #58 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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #59 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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #60 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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #61 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: 2214
  • Country: 00
Re: "Stop Teaching C" - Kate Gregory
« Reply #62 on: November 01, 2016, 07:38:08 am »
AFAIK C# is Java which works.

Nope. C# works on windows. Java works everywhere.
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #63 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 »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #64 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.)
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #65 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: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Stop Teaching C" - Kate Gregory
« Reply #66 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
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: it
Re: "Stop Teaching C" - Kate Gregory
« Reply #67 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 :)?
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: "Stop Teaching C" - Kate Gregory
« Reply #68 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.
 

Offline snarkysparky

  • Frequent Contributor
  • **
  • Posts: 414
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #69 on: November 01, 2016, 11:38:12 am »
C++ and Java contribute to global warming with their wasted CPU cycles over what is possible with a clean well written  C program.

Case Closed  :-DD :-DD :-DD
 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: us
Re: "Stop Teaching C" - Kate Gregory
« Reply #70 on: November 01, 2016, 11:42:40 am »
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.

I think what guys like me are saying is that the whole point of C++ is that it's an extension to C. Without C, no one would ever in a million years use C++ because it's an absolutely awful OOP style language. On the other hand, if you throw out all of the garbage that comes with C++ and just use the basic OO features combined with standard C programming, C++ now becomes an extremely usable and powerful language.
 

Offline setq

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: gb
Re: "Stop Teaching C" - Kate Gregory
« Reply #71 on: November 01, 2016, 11:48:27 am »
C++ and Java contribute to global warming with their wasted CPU cycles over what is possible with a clean well written  C program.

Case Closed  :-DD :-DD :-DD

How about all the farting programmers required to keep the thing from dumping core ;)

Actually I agree. I just used an old piece of C to rip through a 3 million line 4.2Gb text file and find me some text in under the JIT time of a Java program...
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: "Stop Teaching C" - Kate Gregory
« Reply #72 on: November 01, 2016, 12:08:28 pm »
(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.)
Well.. nothing stops you from creating your own string type.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #73 on: November 01, 2016, 12:10:53 pm »
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

that's evil and you know why
"use the debugger to look at results"
is the best advice ever!
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: "Stop Teaching C" - Kate Gregory
« Reply #74 on: November 01, 2016, 12:18:09 pm »
in my case string_t is a struct
which includes the length
and the current position

also being a type implies methods
{ compare, assign, append, … }

therefore if (msg isEqualTo "hallo") makes sense
as long as "hallo" + " " + "world"

it consumes +8 bytes
and a few more cycles(1) to fetch out the method

what is the problem about that?


edit:
(1) checked now, +10 cycles
« Last Edit: November 01, 2016, 01:36:43 pm by legacy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf