Gambas command-line programming
Posted
#1
(In Topic #113)
Regular

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;
Posted
Regular

Posted
Regular

Stability has been another issue. When the Gambas package is included in the repository of a new OS release (e.g. Ubuntu 17.04) it needs to work, even if it is an older version than the latest release. The Debian system is a good one, where they have a stable release, a release candidate, and a cutting-edge unstable version. I think most users will want the stable version, most of the time.
Some of the syntax also seems strange to me. The only example I can think of at the moment is the one in my post above for the Timer;
First the timer declaration:-
Public Timer30sec As Timer
…then I would expect to create a new instance using the declared name: Timer30sec:-
Timer30ses = New Timer
…and then use Methods, Properties & Events for Timer30sec:-
Timer30sec.Delay = 30000
Timer30sec.Start()
…and then the Event:-
Public Sub Timer30sec_Timer()
…which seems more logical to me.
Posted
Regular

Posted
Regular

jornmo said
…or that you have to declare an event name…
Yes, it is having to declare an event name, in addition to the name declared and used for properties & methods.
1 guest and 0 members have just viewed this.



