a quick tour through beginner-friendly coding

1964: (dartmouth basic)

10 print “hello, world!”
20 goto 10

 

1967**: (logo)

forever [print “hello, world]

 

1986: (amigabasic)

while 1
print “hello, world!”
wend

 

1993: (lua)

while 1 do
print(“hello, world!”)
end

 

2005: (python)

while 1: print “hello, world!”

 

2015: (fig)

while
now “hello, world!” print
wend

 

** this is intended to be logo, which is from 1967, although there are over 300 dialects of logo. while it is easy to find a 1964 manual for basic, it is not as easy to find an authoritative source on what logo looked like in the 1960s. this line is correct microworlds logo:

forever [print “hello]

 

and it is presumed (but not certain) this would also work:

forever [print “hello, world!]

 

 

there is no perfect language for coding

you can joke that x is “perfect” or that a language is close enough, but theres no such thing.

if i were to pick a perfect language, i would probably single out python. but its not the fastest, i dont like the direction its going in, its not the best language for low-level tasks like writing drivers or an operating system (youd probably want c for that) and its not even the best language for teaching first-time coders, but it does pretty well in that regard.

then theres fig. its designed for teaching, it addresses a number of things that make python less ideal sometimes, its heavily integrated with python (even allows inline python code and translates into python code) but its got tons of design decisions that are for a range of specific uses. i love using fig and i use it all the time, but its good for what its good for– it isnt perfect either.

one of the surest ways to improve (or ruin) a language is to try to make it perfect. people dont know (im not sure they can know) what “perfect” would be, but that doesnt stop them from trying. occasionally, that effort goes well. more often, it seems like they break more than they fix.

this is subjective of course, but thats really the point– the cons are subjective, but so are the pros. and so really no language can be “perfect.” people could never agree what that would even mean, and many notions of perfection are so impractical, they might as well be impossible.

the more elaborate your notion of quality is, the more work it takes to maintain it if you update it. the amount of work that will actually get done depends on the level of resources and interest towards that effort.

this is a highly variable thing, more than people seem to realize. they take for granted that monumental efforts require monumental interest– whether to volunteer time, or spend money, or both. and that level of interest can change any time the nature of the result changes.

some people clearly build large languages on the assumption that there will be substantial interest– at least their own. its difficult to predict the amount of interest even you will have in something in the future. im still very interested in fig, 2 years later. and ive been using python for most of a decade.

but if trends are easy to predict, no one is releasing much data on them– or almost no one is paying much attention to the data. if any language were perfect, the data probably wouldnt be as spread out as it is.

 

 

 

fig 4.2: (backwards compatibly) supports british and aussie spelling

t "hello" colortext 5 print

t "hello" colourtext 5 print

# both lines work; both are supported in help system

download on figs support forum: http://unofficialdistros.freeforums.org/fig-4-2-colortext-and-colourtext-both-valid-commands-t95.html

 

v sine (fig graphics)

vsine

 

#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "v sine 2017 mn"
function rgbcolour r g b c
python
    figcgapal[c] = (r, g, b)
    fig
    fig
v 1
c 400
w 3.14159 divby 2
for r 490 175 -.125
    e w minus 0.00413367105263 swap e w # 3.14159 / 4 / (490 - 300)
    for p -3.14159 3.14159 .003067958984375
        t w cos times 380 divby 2 int
        rc r divby 2.5 int
        rd 256 minus rc rgbcolour rc rc 32 11
        e w sin times t times 2 plus r plus 7 divby 5
        x p times 2 cos times e plus c int
        y p times 2 sin times e plus r minus 50  int
        m 6.28 plus 1.57 divby 108.503 divby 2
        now v plus m swap now v
        rc r divby 4 int mod 2
        iftrue rc
            now v int mod 2 times 11 pset x y now
            y2 y minus 1 pset x y2 now
            fig
        next
    now display
    next
now display lineinput

 

floral (fig graphics)

floral

 

#### license: creative commons cc0 1.0 (public domain) 
#### http://creativecommons.org/publicdomain/zero/1.0/ 

proginf "floral 2017 mn"

function rgbcolour r g b c
python
    figcgapal[c] = (r, g, b)
    fig
    fig

function qline c d e f g
    ## draw 4 lines, points go 2x2
    ## (cheap but avoids gaps)
    now line c d e f g
    d2 d plus 1
    f2 f plus 1
    now line c d2 e f2 g
    c2 c plus 1
    e2 e plus 1
    now line c2 d2 e2 f2 g
    now line c2 d e2 f g
    fig

while 
    rf randint 35 105 ## radius
    sf rf divby 2 int ## range of radius change
    xmin rf plus sf
    xmax xmin times -1 plus 800
    ymin rf plus sf
    ymax ymin times -1 plus 600
    pc randint 5 15      ## petal count
    xc randint xmin xmax ## horiz location
    yc randint ymin ymax ##  vert location
    while
        cr randint 32 248
        cg randint 32 248
        cb randint 32 248
        #fewer greens and dingy colors
        greenish cr plus cb minus cg times -1
        ifless greenish 0
            ifmore cr 160 
                break
                fig
            ifmore cg 160 
                break
                fig
            ifmore cb 160 
                break
                fig
            fig
        wend
    now display
    for p -3.14159 3.14159 0.00076698974609375 # 3.14159 / 2**12
        r p times pc sin times sf plus rf plus 7
        x p cos times r plus xc int
        y p sin times r plus yc int
        now line x y xc yc 15
        next
    for p -3.14159 3.14159 0.00076698974609375 # 3.14159 / 2**12
        r p times pc sin times sf plus rf
        x p cos times r plus xc int
        y p sin times r plus yc int
        now rgbcolour cr cg cb 14 qline x y xc yc 14
        next
    now display
    wend

now lineinput

 

 

gem seven (fig graphics)

gemseven

 

#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "gem seven 2017 mn"
function rgbcolour r g b c
python
    figcgapal[c] = (r, g, b)
    fig
    fig
v 1
c 400
w 3.14159 divby 2
xb
yb
for r 490 300 -.25
    e w minus 0.00413367105263 swap e w # 3.14159 / 4 / (490 - 300)
    for p 0 3.14159 0.44879857142857144 # 3.14159 / 7
        e w cos times 380 divby 2 int
        rc r divby 3 plus 40  int
        rd 256 minus rc rgbcolour rd rc 0 11
        x p times 2 cos times e plus c int
        y p times 2 sin times e plus r minus 50  int
        m 6.28 plus 1.57 divby 108.503 divby 2
        now v plus m swap now v
        rc r divby 4 int mod 2
        iftrue rc
            iftrue xb
                now v int mod 2 times 11 line xb yb x y now 
            else    
                now v int mod 2 times 11 pset x y now
                fig
            xb x
            yb y
            fig
        next
    now display
    next
now display lineinput

 

 

doublespiral (fig graphics)

doublespiral

 

#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "doublespiral 2017 mn"
function rgbcolour r g b c
python
    figcgapal[c] = (r, g, b)
    fig
    fig
v 1
c 400
w 3.14159 divby 2
for r 490 300 -.25
    e w minus 0.00413367105263 swap e w # 3.14159 / 4 / (490 - 300)
    for p -3.14159 3.14159 .003067958984375
        e w cos times 380 divby 2 int
        rc r divby 2 int
        rd 256 minus rc rgbcolour rc rc rc 11
        x p times 2 cos times e plus c int
        y p times 2 sin times e plus r minus 50  int
        m 6.28 plus 1.57 divby 108.503 divby 2
        now v plus m swap now v
        rc r divby 4 int mod 2
        iftrue rc 
            now v int mod 2 times 11 pset x y now
            y2 y minus 1 pset x y2 now
            fig
        next
    now display
    next
now display lineinput