[Coco] C VS Basic Coco

Lee leep at tigerbase.com
Tue Feb 13 15:48:50 EST 2018


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://pairlist5.pair.net/mailman/listinfo/coco
>



-- 
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!
<http://www.meetup.com/Hampton-Roads-NET-Users-Group/>*


More information about the Coco mailing list