Gambas command-line programming
Posted: Monday 3rd April 2017 7:44am
I have been looking at Gambas command-line programming recently, as an alternative in situations where I would previously have used Python. Although Gambas is primarily presented to the world as a graphical/visual programming language, it has a lot to offer when programming on headless systems, such as low power boards like the Raspberry Pi.
For young people in particular, Gambas cli is a good starting point, or as the next step on from Scratch. In contrast to Python, the Basic syntax of Gambas is easier to understand and remember. And the Gambas IDE allows users to single step through programs, set break-points and view available methods & properties via "IntelliSense" type methods of code completion.
While I don't have a problem with Python, from my previous work in education I think it was a bad choice of programming language/environment for many young secondary school children (11+ year olds). Those that already had a strong interest in programming were able to adapt. But many were confused by the syntax, version differences (v2.x/3.x) or stumped when their programs just didn't work.
I like event-driven languages like Gambas, and was pleased to find that I could still implement a timer on cli, rather than having to create a hideous program loop.
Here is a trivial example;
For young people in particular, Gambas cli is a good starting point, or as the next step on from Scratch. In contrast to Python, the Basic syntax of Gambas is easier to understand and remember. And the Gambas IDE allows users to single step through programs, set break-points and view available methods & properties via "IntelliSense" type methods of code completion.
While I don't have a problem with Python, from my previous work in education I think it was a bad choice of programming language/environment for many young secondary school children (11+ year olds). Those that already had a strong interest in programming were able to adapt. But many were confused by the syntax, version differences (v2.x/3.x) or stumped when their programs just didn't work.
I like event-driven languages like Gambas, and was pleased to find that I could still implement a timer on cli, rather than having to create a hideous program loop.
Here is a trivial example;
Public hTimer30s As Timer
Public Sub Main()
hTimer30s = New Timer as "Timer30sec"
hTimer30s.Delay = 30000
hTimer30s.Start()
End
Public Sub Timer30sec_Timer()
Print "I'm still here!"
End