How BASIC is FreeBASIC?

For other topics related to the FreeBASIC project or its community.
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » Jul 11, 2008 23:28

I recently realized that FB is very much easy to use and user-friendly. Maybe not to begin with alone, but which language is?

Few weeks ago I helped my co-worked to make some simple console-based program in FB and he loved how easily and fast he could make some basic input interface and print a result based on it.

I more annoyed by the lack of graphics libraries with QBASIC-like syntax, but FreeBASIC can't do anything about that.

I would also appreciate if more members preferred the QBASIC-like syntax, but many don’t. Again, FreeBASIC itself has nothing to do with that.
counting_pine
Site Admin
Posts: 6200
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Jul 11, 2008 23:49

Tiger wrote:jofers, -lang fblite doesn't seem to support GOSUB or line numbers. I understand that it is meant for the QB coders, not for BASIC beginners in principle.
Lang fblite should support line numbers - try with GOTO, see if that works.
GOSUB wasn't in lang fblite for technical reasons, to do with variable scopes and the dual usage of the Return keyword.
It has been re-added now, and will be available in the next release, although it has to be enabled with the Option Gosub statement. This is necessary because Return is normally used in FB as a way to exit Subs/Functions.
We'd to encourage people to move to fblite when specific qb compatibility isn't needed, since it's a lot closer to lang fb, not in terms of what style is allowed, but in terms of the feature set and the types of variable available.
We also want fblite to be suitable for people who people who started out in FreeBASIC, but got put off when lang fb came along, so code from earlier versions should compile with few to nil changes needed.
Sometimes compromises have to be made on the qb-compatbility - e.g. the default variable type is Integer, Gosub has to be explicitly enabled - but I think that's about as bad as it gets.
I guess it's not as good as it could have been though. But it's nice that we're discussing the issue here with some rationality. Sometimes people just come along and rant, and it doesn't help anyone.

(PS. RTFM is changed to RTM automatically by the forum swear filter. If you try to use it, you can see the change happen in the preview pane.)
jevans4949
Posts: 1151
Joined: May 08, 2006 21:58
Location: Crewe, England

Postby jevans4949 » Jul 12, 2008 2:04

Strictly speaking, the first Basic I used was an implementation of the Dartmouth version on the Elliott 4100 computers by University of Kent at Canterbury, on behalf of other British Universities with this kit.

As I probably mentioned before elsewhere, the line numbers were essential in those days, because the I/O device was a hard-copy teleprinter; it made it possible to edit the program (inserting lines you had forgotten). This method in itself was a great advance over Hollerith cards!

The LET keyword made it far easier for the interpreter to identify the assignment statement.

The original idea was partly to provide a method of teaching the principles of programming, but also to provide a tool for maths users to perform calculations quickly - and interactively. Remember that electronic calculators were not readily available until about 1972. A Basic program of 100 lines was probably a rarity; if you wanted to write a serious program you did it in Fortran, Cobol or Algol 60.
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Postby arenth » Jul 12, 2008 16:22

Another one of these... While its you attempt to make it clear that you aren't trying to bash FB, you really are. Of course the usual retort is "well if you want QB so bad use QB". FB is not QB, it can't be expected to grow as a language, and remain the exact same as QB at the same time.

All of that said, FB is an excellent language, growing in a great direction, its not going to always progress the way everyone wants, and its up to the developers to ensure that it grows in a way that most people want. This is something they appear to be doing a fairly good job of. I think thats enough ass kissing for one paragraph.

I was gonna write more stuff here, but no one reads 50 paragraph posts. So I'll just close with yes FB is different then QB, maybe even harder, however it isn't QB, though it does a damn fine job of pretending if you read the docs.
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Postby maddogg6 » Jul 12, 2008 18:53

I wasnt much into QB personally - but I ended up needing a simple, free, compiled BASIC - and I found FB to be *the* best for my admitted, limited needs (no *need* for GUI for instance) - And I tried quite a few too (commercial demos included) - either the IDE was too complex, or too simple.

FBIDE was a great compromise for me - easy enough for this lamer to grasp.
FB is faster than interpreted languages - which is what I needed for my 'trial and error' style of lame programming skills.

AND - (drum roll please) IT IS FREE!

Even QB was never *free* per se - so I really dont understand the comparison (QB vs FB) in this day and age of *32 bit OS*.

QB was probably great for what it was - but microsoft decided to drop that concept - if enough people complain to them.... maybe they can produce a 32 bit QB clone and charge for it ?? Wouldn't it be easiest for them, they have all the source from the original QB??

Finally....
Not everyone programs because they enjoy it. Some people do because it is the lesser of 2 (or more) evils. A collection of useless (to me - I am sure they are useful to some) commercial compilers being one of them evils.

FB just so happens to have been *my* choice to accomplish what I needed. But it *was* a choice I made. Thank you FB - keep it up!!
Mysoft
Posts: 777
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Postby Mysoft » Jul 12, 2008 19:46

maddogg6 wrote:if enough people complain to them.... maybe they can produce a 32 bit QB clone and charge for it ?? Wouldn't it be easiest for them, they have all the source from the original QB??


actually they have the source, and many other people as well, since the code is on the internet, but...

well... microsoft declared when stopped support for QB, that will NOT have one newer version of it, cuz QB evolved to VB for dos and then VB for windows and is that what they meant for the future of QB, so they will not come back with that for sure... (not even create another "new" one...)
Tiger
Posts: 29
Joined: Jul 10, 2008 17:48

Postby Tiger » Jul 13, 2008 0:49

counting_pine, that little program of jevans4949 worked flawlessly in -lang fblite including the line numbers, and I will try out Option GoSub as soon as the next version is released. It is not exactly what I had in mind, I admit, but still better than gone completely, I guess.

Is the reason to remove gosub/'return' only the possible confusion with sub/return? I mean, I wouldn't mind to write 'return!' or 'ret' or 'GoBack' instead. As bad programming as it may be, I find Gosub useful in listings of medium length, as it makes the main part smaller and thus easier to survey and faster to check.

In any case, thank you so much for your information - that explained a lot.


jevans4949, thanks for the info about LET. I guessed it also had a logical function, because my book said "nowadays" not necessary any more, but didn't explain why. Nevertheless it is IMO important to teach it to beginners, because otherwise they might get a problem to grasp the "=" symbol.

As far as I know COBOL is still in use in some bigger organizations. 50th birthday next year.


Hexadecimal Dude!, I agree with you, but I consider the line numbers very useful during the first phase of learning how a program actually works. It is a kind of helpful frame that of course should be removed after sub routines have been introduced. I was surely glad when I got rid of them.


Lachie Dazdarian, "Maybe not to begin with alone, but which language is?" Well, BASIC, if it comes with a very thick book that explains everything patiently step by step not assuming any knowledge whatsoever.

Of course it is always better if somebody can answer your questions personally,
but if a hobby programmer explains a beginner that a = a + b, well, good luck then!


marcov, granted, Eliza could get on your nerves after a while, but Battleship is still suitable for every beginner, I think.


Tiger
Last edited by Tiger on Jul 14, 2008 8:53, edited 1 time in total.
jdebord
Posts: 529
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Postby jdebord » Jul 13, 2008 7:16

Tiger wrote:BASIC, if it comes with a very thick book that explains everything patiently step by step not assuming any knowledge whatsoever.

There was such a book, in fact :) It was called FBeginner and was very good, but unfortunately the project has been abandoned. You can still find the incomplete version here:
http://freebasic.hmcsoft.org/FBeginner.preview.pdf
Tiger
Posts: 29
Joined: Jul 10, 2008 17:48

Postby Tiger » Jul 13, 2008 9:36

Thanks jdebord, I will have a look at it.

Tiger
fabrizio
Posts: 73
Joined: Sep 29, 2006 13:39
Location: Roma, Italy

Postby fabrizio » Jul 14, 2008 12:09

I think most of the comments you (Tiger) make apply to QB as well. Your criticism seems aimed not just at FB, but at modern programming languages in general.

Have a quick glance at Haskell: does it look like a programming language to you? To me it didn't, at first sight, but it is. This is to say that programming languages are created to solve needs. Your needs may be better served by other programming languages, like logo for instance or Python or even assembly perhaps.

Python is simpler and more consistent than BASIC - but you need external libraries to draw a pixel. I find this rather unconvincing.

I like FB for its speed and easy graphics. And I accepted to use only a fraction of it.

My opinion is: use only the part of FB which answers your programming need, and forget about all the complicated rest. Leave it to the Developers. Doing so, I have more fun with FB than with any other language. Hope it will be the same for you.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA
Contact:

Postby DaveUnit » Jul 14, 2008 14:46

I like the whole including external libraries to draw a pixel thing. If I don't need graphics, I don't include that library, if I do, I include it. FB to me has a lot of unnecessary keywords and such. I know it's very BASIC to use the entire dictionary and make them keywords, but it would be better if graphic commands and other unnecessary to the core language functions were perhaps optional to include and put in the FB namespace. I know, not very BASIC, I'm sorry.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Jul 14, 2008 16:43

DaveUnit wrote:it would be better if graphic commands and other unnecessary to the core language functions were perhaps optional to include and put in the FB namespace.


I agree, as do many others.
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » Jul 14, 2008 21:26

Bah, isn't that the case already?

Using FB?

Yeah, let's remove that option and force the namespace. Shees.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA
Contact:

Postby DaveUnit » Jul 14, 2008 22:19

No, it's not the case. Graphics commands like screen, line, etc are all in the global namespace last time I checked. Some things are in the FB namespace like the keyboard code enumerations but that's not enough. If I wanted graphics in FB there should be an explicit #include "fbgfx.bi". There are all sorts of functions in the global namespace and imo, that's not good. Another example is file i/o, if I had a program that needed to use file operations, I'd put #include "fbfile.bi" in my code or something. A lot of functions could be put into the FB namespace in a similar fashion to how a lot of c++ things like file i/o are in the std namespace.
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Jul 14, 2008 22:28

Quirk statements are forced into the global namespace because you can't duplicate them with normal function syntax in a header. "Option FB" is the closest you're going to get to that

I personally think FB needs to be extended to integrate at least some of these statements into normal syntax. I've tried out a number of ideas in the past (example), but it's a tough problem.

Or, at the very least, deprecate them and introduce a similar interface into the runtime library.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests