[Coco] C VS Basic Coco

Scott Wendt malfunct at msn.com
Tue Feb 13 16:15:03 EST 2018


I don't want to stir up any arguments, because whatever language that gets the job done and is the one you want to use is the one you should use, but I think the things that make BASIC easy to get started with are the same ones that makes it poorly suited for complex projects.

A lot of the extra "stuff" in structured languages are there to represent program structure and does really lend to the readability and maintainability of large complex projects. For me personally brackets and indentation are super important for identifying logical blocks of code.

I am currently working on porting a large (on the order of 50k lines in multiple files) BASIC program written in AppleSoft BASIC to C# and following what is happening in the BASIC code is tedious. There are more "lines" in the C# equivalent but they are nicely organized and compartmentalized and I think will prove to be easier to understand and maintain. Using GOTO to implement while loops is my current nemesis, they have me going crosseyed.
________________________________
From: Coco <coco-bounces at maltedmedia.com> on behalf of Lee <leep at tigerbase.com>
Sent: Tuesday, February 13, 2018 12:48 PM
To: CoCoList for Color Computer Enthusiasts
Subject: Re: [Coco] C VS Basic Coco

I'd also say the C example is doing more than the BASIC example which adds
to it looking more complex.

#include <stdio.h>

int main () {
    for(int a = 10; a < 20; a++) {
        printf("%d\n", a);
    }
    return 0;
}

To me, that's just as clear as the BASIC, but I have a background in
c/c++/c# so I'm familiar and comfortable with it.


On Tue, Feb 13, 2018 at 11:08 AM, Taylor, Phillip L CIV <
Phillip.L.Taylor at uscg.mil> wrote:

>
>
> I the reason I like basic is because it's much easer to learn and read the
> source code.  The example below 8 lines of basic code 6 lines of code vs C
> is 8 lines of code.
>
> Basic is more simple less code:
>
> Loop
> A = A +1
> Print A
> Exitif A < 20
> EndExit
> Endloop
>
>
>
>
> C Code is harder to learn:
>
> #include <stdio.h>
>
> int main () {
>
>    int a;
>
>    /* for loop execution */
>    for( a = 10; a < 20; a = a + 1 ){
>       printf("value of a: %d\n", a);
>    }
>
>    return 0;
> }
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist5.pair.net%2Fmailman%2Flistinfo%2Fcoco&data=02%7C01%7C%7C199257c78bd4452d726b08d573233347%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541517375762473&sdata=9%2BCA6rEuRu9%2FDtZ32cUgZK2w0f0%2BELxq0X2KTpAbpmY%3D&reserved=0
>



--
Lee Perkins
TigerBase Technologies
leep at tigerbase.com
------------------------------


*[image: Hampton Roads .NET Users Group]2nd Tuesday of every month. Come
meet, learn, network and eat pie!
<https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.meetup.com%2FHampton-Roads-NET-Users-Group%2F&data=02%7C01%7C%7C199257c78bd4452d726b08d573233347%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541517375762473&sdata=O9ib%2FC%2Bd26xu4s53n5aX9hSinWJrDBUOJXMgySFtgPI%3D&reserved=0>*

--
Coco mailing list
Coco at maltedmedia.com
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist5.pair.net%2Fmailman%2Flistinfo%2Fcoco&data=02%7C01%7C%7C199257c78bd4452d726b08d573233347%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541517375762473&sdata=9%2BCA6rEuRu9%2FDtZ32cUgZK2w0f0%2BELxq0X2KTpAbpmY%3D&reserved=0


More information about the Coco mailing list