Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #112652

Re: Help creating a C class

From "Chris M. Thomasson" <invalid@invalid.invalid>
Newsgroups comp.lang.c
Subject Re: Help creating a C class
Date 2017-06-19 17:47 -0700
Organization n/a
Message-ID <oi9r40$7af$1@dont-email.me> (permalink)
References (7 earlier) <55c2735c-1143-4592-8a11-377915c32d46@googlegroups.com> <638ecd8e-9818-452b-8917-da17c3dbb377@googlegroups.com> <72ac637b-48d1-4dab-a21c-21619ac147c4@googlegroups.com> <KFQ1B.303458$524.31044@fx41.am4> <f487c021-cbc4-4c0c-be94-5af0e8372009@googlegroups.com>

Show all headers | View raw


On 6/19/2017 5:31 PM, David Kleinecke wrote:
> On Monday, June 19, 2017 at 6:51:57 AM UTC-7, Bart wrote:
>> On 19/06/2017 13:35, Rick C. Hodgin wrote:
>>
>>> In general, you can teach people the basics in a few minutes. They'll
>>> need to time and practice for understanding and to have it sink in,
>>> but the general concepts in C are very straight-forward.
>>
>> For people new to coding, I can see the following problems:
>>
>>> Data types hold values...:
>>>
>>>       char       -- single character, like 'a' or ';'
>>>       integer    -- single integer, like 1
>>>       float      -- floating point values, like 3.1415
>>
>> Having separate integer and float types is alien. As is that funny char
>> type (can you really do 'A'+'B'? Why doesn't it equal 'AB'?)
>>
>> I'd suggest having one numeric type to start, either integer or float.
>> And forget char except when it is needed to deal with strings.
>>
>>> Assignment is straight-forward:
>>
>> Not according to a lot of modern languages! Some of which do away with
>> variables and assignments.
>>
>>> Basic math is pretty normal:
>>>
>>>       a = b + c;
>>>       a = b - c;
>>>       a = b / c;
>>
>> This behaves differently between integer and float.
>>
>> And you will have to explain that = doesn't mean equality, while
>> equality isn't denoted with =.
>>
>>>       a = b * c;
>>
>>> A range-test loop, like "I need to do this 10 times":
>>>
>>>       for (i = 0; i < 10; i++) {
>>>           // Code to do here for each value
>>>       }
>>
>> Students will wonder why you can't just say 'do 10 times' instead of
>> having to tell the computer exactly how to loop. That's /its/ job isn't it?!
>>
>> (Probably while is better for N times. A for-loop with an index is
>> better when the index is put to some use in the loop. Just printing the
>> index would help. This is the first program I ever saw in action, c.1975:
>>
>>    for i = 1 to 20
>>       print i, sqr(i)
>>    next i
>>
>> This shows a table of the square roots of the numbers 1 to 20. I was
>> impressed -- working out square roots from scratch without using tables!
>> And apparently instantly, as it seemed even though this was printed out
>> at 10cps onto paper.)
>>
>>> Global storage, like "placing something in the living room for all
>>> to see or use":
>>>
>>>       int x, y;
>>>
>>>       void function1(void) {
>>
>> Void? And void again? Something else to explain. As is scope.
>>
>>> You won't get much simpler than those examples, with the straight-
>>> forward conveyance of their {..} blocks identifying exactly where
>>> code goes, and when it is triggered.
>>
>> With C, you have the proliferation of types, having to declare names,
>> the various meanings of 'void', the elaborate way to do a for-loop...
>>
>> Basic didn't have all that. Nor did it have the concept of a compiler of
>> linker. You just said RUN.
> 
> Not well-known but the original Basic was compiled, I
> mean the Basic that was developed as a class project at
> Dartmouth. Not many people have ever seen it because
> it was not widely distributed. Dartmouth sold it to GE
> and GE "used" it to start their time-sharing business.
> But GE rewrote the Dartmouth code completely so it would
> work. We didn't add anything but it was definitely a
> second implementation.
> 
> I know that BASIC was compiled because I wrote the GE
> compiler. I had no more contact thereafter with GE
> time-sharing and any of its rather sad history.
> 
> It's heresy, of course, but I still think BASIC is a
> viable beginners language.
> 

BASIC is a nice language. Fwiw, there is a nice online AppleSoft BASIC 
emulator online here:

http://www.calormen.com/jsbasic

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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