Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #112397
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Help creating a C class |
| Date | 2017-06-17 16:20 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <87vanu4p5b.fsf@bsb.me.uk> (permalink) |
| References | <f63da28b-5e80-4a02-bfa3-f8f68708ad8d@googlegroups.com> <m2mv96hl00.fsf@despina.home> |
"Pascal J. Bourguignon" <pjb@informatimago.com> writes:
> "Rick C. Hodgin" <rick.c.hodgin@gmail.com> writes:
>
>> I'm interested in teaching a beginning C class to a group of about ten
>> students ranging in age from teenager through sixty years old.
>>
>> It will be two hours, and I was wondering if any of you would like to
>> contribute some ideas for an outline for a class like that?
>>
>> My initial thinking is:
>>
>> Brief history of C
>> C's impact on computer languages
>> The build process (high level)
>> Basic structure of a C source file
>> Header files and the C Standard Library
>> Edit our first "Hello world" program
>> Compiling
>> Linking
>> Running
>> Debugging
>> Language basics (types, macros, flow)
>> Language features (structs, output targets)
>>
>> I would give them a free / open source integrated C compiler with
>> built-in editor and debugger to run on Windows. I would take them
>> through the basic philosophy of "Why C?" and "How C?"
>>
>> I would appreciate any input or guidance.
>
> Yes, as mentionned by Ben, two hours is very short. You can already
> discount half an hour for people to sit down, unpack, boot the
> computers, for you to talk about stuff and tidbits, for the latecomers
> to arrive, etc.
>
>
> Since it's a beginner's course, basically, in two hours, you have barely
> the time to have them write a single-function program such as:
>
> #include <stdio.h>
> int main(void){
>
> char name[81];
> printf("Hi, what's your name? ");
> fflush(stdout);
> scanf("%80s",&name);
> printf("Hello, %s!\n",name);
>
> int a=1;
> int b=2;
> int c=1;
> int x=10;
> int y=(a*x+b)*x+c;
> printf("%dx^2+%dx+%d = %d for x=%d\n",a,b,c,y,x);
>
> return 0;
> }
>
>
> Imagine the explaining you have to do here!
I think that's the wrong objective. You just can't explain anything
worth explaining it two hours. The objective should be to show that
anyone can write programs that do interesting things in two hours. That
way they may be inspired. Explaining the C preprpcessor is pointless
and dull!
But we're somewhat blind here. It maybe that this is a two hour
introduction to a longer course in which case explaining things may well
be worth the time, but it seems that's not the case. Or maybe it's a C
taster being given alongside other two-hours taters for Python and
Haskell. It could be I am giving completely the wrong advice.
The important thing about functions is you can motivate them so
easily -- they are the key to what makes a program a program.
If you give the students:
#include <drawing>
int main()
{
paper_size(10, 10);
move_to(5, 5);
draw_by( 1, 0);
draw_by( 0, 1);
draw_by(-1, 0);
draw_by( 0, -1);
}
and have them /run it/ before explaining anything, you'll find you can
get away with very little explanation.
The have them write a program to draw four squares. Once they have don
that they ill understand this very quickly:
#include <drawing>
void draw_a_square()
{
draw_by( 1, 0);
draw_by( 0, 1);
draw_by(-1, 0);
draw_by( 0, -1);
}
int main()
{
paper_size(10, 10);
move_to(3, 3);
draw_a_square();
move_to(5, 5);
draw_a_square();
move_to(5, 5);
draw_a_square();
move_to(3, 5);
draw_a_square();
}
You may even have time to explain and motivate
void draw_a_square(int size)
{
draw_by( size, 0);
draw_by( 0, size);
draw_by(-size, 0);
draw_by( 0, -size);
}
If you also allow angles (draw_towards), closed curve filling and colour
setting with the simplest possible API, you can have some pretty amazing
drawings out of the first couple of classes (mine were 55 minutes so it
took a couple to get going).
<snip>
> Oh, and you want to do that with MS-Windows? Forget it…
Nowadays, I'd use a web interface so I could control everything about
the student environment, but originally this method had to be portable
between Unix (two versions) and Windows since students wanted to work at
home and no one had a Sun or HP workstation at home (in those days).
--
Ben.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-16 17:36 -0700
Re: Help creating a C class gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-17 02:16 +0000
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-16 21:27 -0700
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-16 21:16 -0700
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-17 12:24 -0700
Re: Help creating a C class GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-17 08:06 +0200
Re: Help creating a C class Real Troll <real.troll@trolls.com> - 2017-06-17 13:15 -0400
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-17 12:27 -0700
Re: Help creating a C class David Kleinecke <dkleinecke@gmail.com> - 2017-06-17 12:49 -0700
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-21 13:47 -0700
Re: Help creating a C class Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-17 12:03 +0100
Re: Help creating a C class GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-17 13:38 +0200
Re: Help creating a C class "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-06-17 14:11 +0200
Re: Help creating a C class Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-17 16:20 +0100
Re: Help creating a C class supercat@casperkitty.com - 2017-06-17 10:39 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-17 17:05 -0700
Re: Help creating a C class Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-18 02:31 +0100
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-17 21:37 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 11:24 -0700
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-18 15:15 +0200
Re: Help creating a C class bartc <bc@freeuk.com> - 2017-06-18 15:02 +0100
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-18 17:18 +0200
Re: Help creating a C class bartc <bc@freeuk.com> - 2017-06-18 17:04 +0100
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-18 23:06 +0200
Re: Help creating a C class GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-19 01:05 +0200
Re: Help creating a C class Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2017-06-18 19:28 -0400
Re: Help creating a C class GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-19 01:31 +0200
Re: Help creating a C class Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-18 21:28 -0400
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-18 18:39 -0700
Re: Help creating a C class Chad <cdalten@gmail.com> - 2017-06-18 23:42 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 01:30 -0700
Re: Help creating a C class Chad <cdalten@gmail.com> - 2017-06-21 09:33 -0700
Re: Help creating a C class gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-19 10:48 +0000
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-19 11:11 +0200
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 02:25 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 03:17 -0700
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-19 12:42 +0200
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 05:35 -0700
Re: Help creating a C class bartc <bc@freeuk.com> - 2017-06-19 14:51 +0100
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 07:03 -0700
Re: Help creating a C class David Kleinecke <dkleinecke@gmail.com> - 2017-06-19 17:31 -0700
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-19 17:47 -0700
Re: Help creating a C class bartc <bc@freeuk.com> - 2017-06-20 10:25 +0100
Re: Help creating a C class Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-19 14:09 +0100
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 06:13 -0700
Re: Help creating a C class Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-19 17:05 +0100
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-19 09:15 -0700
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-21 13:30 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 14:29 -0700
Re: Help creating a C class Richard Damon <Richard@Damon-Family.org> - 2017-06-30 10:15 -0400
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-30 07:33 -0700
Re: Help creating a C class David Brown <david.brown@hesbynett.no> - 2017-06-19 11:28 +0200
Re: Help creating a C class "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-06-18 16:42 -0700
Re: Help creating a C class raltbos@xs4all.nl (Richard Bos) - 2017-06-26 06:04 +0000
Re: Help creating a C class David Kleinecke <dkleinecke@gmail.com> - 2017-06-26 09:15 -0700
Re: Help creating a C class joel.rees@gmail.com - 2017-06-18 17:35 -0700
Re: Help creating a C class Leon Taylor <leontaylor476@gmail.com> - 2017-06-19 05:59 -0700
Help creating a C class asetofsymbols@gmail.com - 2017-06-19 07:53 -0700
Re: Help creating a C class John Bode <jfbode1029@gmail.com> - 2017-06-20 07:16 -0700
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-20 07:45 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-20 23:20 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-20 08:40 -0700
Re: Help creating a C class gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-20 16:22 +0000
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 00:27 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-20 09:34 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 00:38 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-20 09:43 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 21:37 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 06:58 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 22:10 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 08:08 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 23:20 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 08:24 -0700
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 23:27 +0800
Re: Help creating a C class "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 08:39 -0700
[OT] "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 23:46 +0800
Re: [OT] "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-06-21 09:03 -0700
Re: [OT] "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-22 00:15 +0800
Re: [OT] "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-25 22:59 +0800
Re: Help creating a C class "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-06-21 00:25 +0800
csiph-web