BASIC was meant to be easy to learn, read and understand

General discussion for topics related to the FreeBASIC project or its community.
greenink
Posts: 200
Joined: Jan 28, 2016 15:45

Re: BASIC was meant to be easy to learn, read and understand

Post by greenink »

Even very old versions of Basic (eg zx spectrum) had graphics and other io operations as standard. Many languages now don't, that's the main reason I never switched over to D, Go, Swift or some of those other languages. FB has a very stable graphics system.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: BASIC was meant to be easy to learn, read and understand

Post by caseih »

Sure, and I agree that having such things in the runtime library is very useful. But there's absolutely no reason they should be keywords and part of the language syntax. BASIC is particularly aggregious in having lots of funky custom syntax added to support these runtime routines. All of them could be implemented as simple function calls, and in fact that's the way they are implemented in the runtime library. BASIC was designed years ago before there were standards like calling convention. BASIC didn't even have functions and subroutines as we currently have them (as an OS-level construct), so such unorthodox way of doing things is understandable, given the history. More recent languages like C were designed around an OS, so it was natural to make functions and subroutines in a standard way and use that as a basis for creating the runtime library.

But as I said, fortunately one can undefine keywords in FB and reuse them, so having so many keywords isn't as much of a problem as it could be.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

greenink wrote: FB has a very stable graphics system.
But still lacks the innate graphic commands of other BASICS. With regards to BASIC on the older machines they usually had a SOUND command and some like the AMIGA also had a SPEAK command.
.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

@caseih,
Agree with all the points you make.
It would suit me fine if FreeBASIC had evolved to have a standard modern syntax but of course FreeBASIC started off as a QBASIC substitute.
And if graphic and sound commands could easily be added with a simple import statement that would be fine as well.
It would still be an easy to learn, read and use language.
Although I haven't used OO in any of my FB snippets I am not adverse to it. I used objects all the time with C++ I just didn't write any.
.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: BASIC was meant to be easy to learn, read and understand

Post by sancho2 »

Which graphics commands are missing and in which basic did that command exist?
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: BASIC was meant to be easy to learn, read and understand

Post by marcov »

greenink wrote:Even very old versions of Basic (eg zx spectrum) had graphics and other io operations as standard. Many languages now don't, that's the main reason I never switched over to D, Go, Swift or some of those other languages. FB has a very stable graphics system.
Yes, so did Micro Soft basic (like used e.g. by the Commodore 64). Unfortunately, the default Basic V2 did not, but the later V4 (which was available as a separate cartridge as "Simon's Basic") did.

But those where never very portable, so comparisons with standard libraries of languages that are portable over a whole bigger set of platforms is somewhat like comparing apples and oranges.

Still it is a pity that many languages don't have several levels of library compliance. The lack of this is very visible e.g. if Unix people try to control a console using escape sequences which is actually platform dependent behaviour, lacking an abstraction ( in many OSes the terminal output is raw, and special functions are done by api calls)
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: BASIC was meant to be easy to learn, read and understand

Post by sancho2 »

greenink wrote:Some older graphics commands:
http://www.worldofspectrum.org/ZXBasicM ... hap17.html
That page shows four commands, Plot, Draw, Point, and Circle.
Plot is nearly identical to PSet, Draw is nearly identical to the Line command, and Point is nearly identical to the FB Point statement and Circle is nearly identical to the FB Circle command.
The previous page shows some color handling that is easily done in FB except for perhaps the Flash statement.
There is no FB limitation that needs to be overcome when compared to these graphics commands.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

sancho2 wrote:Which graphics commands are missing and in which basic did that command exist?
The main innate graphic commands I missed not having were Pen size, fonts, image formats other than .bmp and also maybe image resize. But the big difference between FB and a simple modern BASIC-like Scratch is in a lack of a sound and music commands. And I guess in the case of FB vs. Visual Basic is a FB's lack of controls for implementing a GUI.

However I have lamented about this before. The only point to this thread was that BASIC was meant for those who do not have the time or computer science background to deal with a complicated language or complex (to them) need for setups. If a language or its extensions have syntax challenges then I see that as a negative for the language. Just today I tried to add extensions to Microsoft Small Basic but keep getting "Speech object not found" despite believing I followed the instructions carefully. Setups need to be automatic to be useful to the casual or novice user.
.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: BASIC was meant to be easy to learn, read and understand

Post by sancho2 »

In any BASIC I've ever tried making simple programs was easy. Then you get it in your head to expand the program.
Small add ons still relatively easy.
Soon enough you begin to enter the complex real world of programming, when your project balloons and you start running into limitations.

In my opinion no BASIC has ever existed that made large projects easy. In fact no programming language at all will do this.
With FB and other BASIC's I've looked at, you have the well known basic commands plus the extentions. As has been said here already, you don't have to use the extentions.

Its unfair compare sound handling with Amiga or C64. Those systems had built in sound devices and they existed exactly the same on every machine. PC's have dozens of sound configurations. You can't get a one size fits all.

As for GUI, I have always found that its great to get going fast and pop up your window with buttons and text boxes.
Eventually though you run into limitations even in that environment.
There were hundreds of code tip websites for VB6.0 (which had a beautiful GUI designer) on how to override the Windows defaults and intercept the Windows messages used to create those windows and buttons etc.
How many times in the past have you seen on message boards (including many non FB BASIC forums), "How do I do a transparent window background?", "How do I do a custom border on my window?", "How do I change the shape of my buttons?".

Even programming in graphics and sound concentrated environments like GameMaker Studio, or Flash, you still find missing, the simplicity you are searching for.
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: BASIC was meant to be easy to learn, read and understand

Post by Boris the Old »

BasicCoder2 wrote:The only point to this thread was that BASIC was meant for those who do not have the time or computer science background to deal with a complicated language or complex (to them) need for setups. If a language or its extensions have syntax challenges then I see that as a negative for the language.
You have to remember that, 50 years ago, the users of BASIC were not the same people who installed the language on mainframe computers. If they could do that they wouldn't be sitting at a teletype machine playing at being a computer programmer. The original BASIC was intended to introduce computers to the masses, at a time when only a few programmers, like me, had any experience of the "black arts". Yes, back then we really were treated as Gods. But 50 years on, the world is different -- everyone has a mainframe computer in his pocket.
sancho2 wrote:In my opinion no BASIC has ever existed that made large projects easy.
I beg to differ.

Back in the 1970's and early 1980's, before the IBM PC was created, I developed industrial strength multi-user applications using BASIC.

Rod
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

sancho2 wrote:Even programming in graphics and sound concentrated environments like GameMaker Studio, or Flash, you still find missing, the simplicity you are searching for.
The simplicity I am talking about is when advanced computer programmers encapsulate all their code code into a simple function.
image = grabImage()
So lesser programming mortals such as myself don't have to learn all the complexity behind programming in a complex multitasking operating system.
That is what makes a good language "simple" to use. Experts often don't bother or even appreciate the need for this because doing it the long way isn't really hard for them. They have good memories and lots of practice. "Don't know how to set up SDL with code::blocks? You clearly aren't clever enough to be a programmer!" But of course I can use FB's graphics without any setting up required and given the hardware specs for the Amiga and C64 I had no problem programming graphics in Assembler.
.
Last edited by BasicCoder2 on Dec 29, 2016 5:38, edited 4 times in total.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

Boris the Old wrote:But 50 years on, the world is different -- everyone has a mainframe computer in his pocket.
And they are useful because advanced programmers made them easy to use. To the everyday user they are just magic boxes.
.
Last edited by BasicCoder2 on Dec 30, 2016 12:36, edited 1 time in total.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: BASIC was meant to be easy to learn, read and understand

Post by Tourist Trap »

BasicCoder2 wrote: The simplicity I am talking about is when advanced computer programmers encapsulate all their code code into a simple function.
image = grabImage()
It's very possible that such a function will embed directx, or other system specific functions, that may change with the time, requiring then maintenance.
I agree with you that it's easier with a lot of special function for each task, but I wonder who will maintain each of them. Looks like a balance must be found and maybe that's why it's hard to add new keywords. Maybe also the speed of the compiler is a parameter?
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: BASIC was meant to be easy to learn, read and understand

Post by BasicCoder2 »

Tourist Trap wrote:I agree with you that it's easier with a lot of special function for each task, but I wonder who will maintain each of them. Looks like a balance must be found and maybe that's why it's hard to add new keywords.?
To me it is obvious that some functions are useful. I gave the grab webcam example because I wanted such a function and it was possible to write one for FreeBASIC based on a C code example (back in 2010).

Experts maintaining code is an issue for FreeBASIC but not for more popular languages. Python for example is well maintained and has support for webcams as does Java.

By the way the functions do not have to be innate they only need to be imported as needed to make a language easy to learn, read and understand.

Some libraries are easy to use with C++ because they are standard and all you have to do is include them, #include <iostream>, while others like SFML require setting up by an expert before you can include them. I know this because when googling how to set it up I found a lot of others were having the same problem.

I noticed some libraries come with the FreeBASIC download and are easy to use for the same reason. I didn't download "disphelper.bi" it just worked when I included it. To what extent library updates will be available to FB will depend on the whim and need of the few very talented FB users capable of providing such support.
.
Post Reply