Is FreeBASIC good for beginners to progrmaming?

New to FreeBASIC? Post your questions here.
caseih
Posts: 1703
Joined: Feb 26, 2007 5:32

Re: Is FreeBASIC good for beginners to progrmaming?

Postby caseih » Jun 10, 2021 3:00

BasicCoder2 wrote:"When developing a skill, it is much better to acquire the right reflexes from the start rather than have to correct years of bad practice."

Nope, the author is way off base there. What bad practice? QBasic is as structured as any modern language. If QBasic promotes bad programming practices, then so does FreeBASIC. If you want to argue that not pre-declaring a variable promotes bad practices, then so does any modern, dynamic language.

The only thing about QBasic that's a hindrance is 16-bit DOS, needing emulation. If a person learned the ropes on QBasic and then moved to FreeBASIC I see no real problem, and nothing was lost. No time was wasted. It's all good fun after all. I don't get the attitude towards QBasic, other than to acknowledge that in some ways FB is everything QBasic was and more. But QBasic is still ahead in terms of accessibility. Easy, fast IDE, F5, away you go. FB requires more steps, but so do all modern languages. So at worst it's sixes.
MrSwiss
Posts: 3826
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Is FreeBASIC good for beginners to progrmaming?

Postby MrSwiss » Jun 10, 2021 3:24

caseih wrote:
BasicCoder2 wrote:"When developing a skill, it is much better to acquire the right reflexes from the start rather than have to correct years of bad practice."

What bad practice?
All those stupid variable specifiers like: $% e.t.c.
And YES, pre-declaring variables ... but, without the nonsense, mentioned above.
(aka: calling the Child by it's Name, no more cryptic stuff)

The languages that you're probably refering to, are Scripting-Languages = they don't count.
caseih
Posts: 1703
Joined: Feb 26, 2007 5:32

Re: Is FreeBASIC good for beginners to progrmaming?

Postby caseih » Jun 10, 2021 3:37

Saying "scripting" languages don't count is, how shall we put this politely, a bit silly besides being plain wrong. I hate PHP as much as the next guy, but PHP is a staple of modern software development. As is Javascript. And Ruby. And Python. Did you know Microsoft wrote one of the most popular IDEs in the world in Javascript? Other statically-typed compiled languages support automatic variable declarations and type inference, such as C++11. There are many kinds of languages that very much count. Google Go is quite popular and useful, and fully compiled. And it allows you to define a variable by assigning to it. There are countless examples in modern practice. Yet somehow programmers manage, and manage to successfully move from language to language as required.

And you'll have to come up with an explanation of how variable type specifiers leads to bad habits. Having come from QBasic myself, I can attest that adapting from that way of using variables to naked variables with pre-defined types took about 2 seconds. At best all you can really argue is that suffixes (and prefixes like in perl and PHP) look ugly. They are not hard to read, even for the initiated.

If someone wanted to use the QBasic dialect in FB, like you I might argue that regular FB is a better choice, but I could never argue that the QBasic dialect would teach them bad practices!
BasicCoder2
Posts: 3738
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Is FreeBASIC good for beginners to progrmaming?

Postby BasicCoder2 » Jun 10, 2021 6:16

@MrSwiss
@caseih
So are we trying to sell FreeBASIC as a language suitable for someone wanting to see if they like programming? If you are going to use FreeBASIC you might as well start with FreeBASIC and have the future way of coding continue as you started. Nothing annoys me more than wanting to update or edit FB code I wrote 11 years ago and having to modify it to work with the latest incarnation of FreeBASIC.

Python is very different from C++ or FreeBASIC and I must admit I found Python hard for that reason. I only bothered with it because there were hardware projects that interested me and the examples all used Python. I suspect going from Python to C++ would be even harder.
deltarho[1859]
Posts: 3072
Joined: Jan 02, 2017 0:34
Location: UK

Re: Is FreeBASIC good for beginners to progrmaming?

Postby deltarho[1859] » Jun 10, 2021 7:48

Breaking news: fbc Version 0.21.0 is being re-released for a 10-day special so that BasicCoder2 can run some of his old code. His Win 10 machine has gone on strike refusing point-blank to accommodate 0.21.0, so it looks a visit to the loft is in order and a dusting down of the old Win 98 machine. I am not sure how long it will take to download 0.21.0 with a 56K dial-up modem. Its only 28K? "Strewth!" as they say in Australia.

@BasicCoder2 Image
jj2007
Posts: 2142
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Is FreeBASIC good for beginners to progrmaming?

Postby jj2007 » Jun 10, 2021 8:42

BasicCoder2 wrote:Nothing annoys me more than wanting to update or edit FB code I wrote 11 years ago and having to modify it to work with the latest incarnation of FreeBASIC.
Ever tried to compile a C/C++ snippet found on the web that was written more than 2 years ago? Have fun...

Micros*t makes a lot of money with their ambition to remain backward compatible. Sometimes it works, sometimes not. My 10-year-old GfaBasic stuff needs a VM nowadays, but all Assembler sources written in the 20th Century work out of the box. My guess is that 90% of FreeBasic's compatibility problems come from its reliance on external compilers.
paul doe
Moderator
Posts: 1430
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Is FreeBASIC good for beginners to progrmaming?

Postby paul doe » Jun 10, 2021 10:03

joeyxl wrote:...
I agree 100%, I need to think of smaller projects first. Maybe something Taking a number, printing out its binary value, its twos compliment, and its hexadecimal value? i dunno just throwing ideas around.
...

Tic-tac-toe is a good starting exercise. Once you've done with it, you can try:

  • A version of the 'hangman' game
  • A version of the 'Naval Battle' (I think it's called 'Dreadnoughts' in some countries)
  • Your favorite card game (be it Poker, Texas Hold'em, Blackjack, Hearts, Solitaire, etc) or a casino game (Roulette, Slots, etc)
  • A FreeBasic version of a mildly complex board game (like Scrabble, Monopoly and the like)

Just some ideas off the top of my hat.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Postby joeyxl » Jun 10, 2021 12:12

paul doe wrote:
joeyxl wrote:...
I agree 100%, I need to think of smaller projects first. Maybe something Taking a number, printing out its binary value, its twos compliment, and its hexadecimal value? i dunno just throwing ideas around.
...

Tic-tac-toe is a good starting exercise. Once you've done with it, you can try:

  • A version of the 'hangman' game
  • A version of the 'Naval Battle' (I think it's called 'Dreadnoughts' in some countries)
  • Your favorite card game (be it Poker, Texas Hold'em, Blackjack, Hearts, Solitaire, etc) or a casino game (Roulette, Slots, etc)
  • A FreeBasic version of a mildly complex board game (like Scrabble, Monopoly and the like)

Just some ideas off the top of my hat.


That's a good idea! I really appreciate the ideas that you guys are sharing.
Lost Zergling
Posts: 425
Joined: Dec 02, 2011 22:51
Location: France

Re: Is FreeBASIC good for beginners to progrmaming?

Postby Lost Zergling » Jun 10, 2021 12:37

How about a compressor ? There might be a free seat for a beginner.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Postby joeyxl » Jun 10, 2021 13:17

Lost Zergling wrote:How about a compressor ? There might be a free seat for a beginner.


whats that? you mean a file compressor?
Lost Zergling
Posts: 425
Joined: Dec 02, 2011 22:51
Location: France

Re: Is FreeBASIC good for beginners to progrmaming?

Postby Lost Zergling » Jun 10, 2021 17:34

Yes, file/data compression. But I was mainly joking, sorry.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Postby joeyxl » Jun 10, 2021 17:40

Lost Zergling wrote:Yes, file/data compression. But I was mainly joking, sorry.


oh haha ok. no worries
badidea
Posts: 2333
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Is FreeBASIC good for beginners to progrmaming?

Postby badidea » Jun 10, 2021 21:53

paul doe wrote:...
[*]Your favorite card game (be it Poker, Texas Hold'em, Blackjack, Hearts, Solitaire, etc) or a casino game (Roulette, Slots, etc)
...

There were a few moments when I wanted to write a poker bot/AI, but I could never figure out how to approach this problem. Someday, I give it another try...

joeyxl wrote:That's a good idea! I really appreciate the ideas that you guys are sharing.

Collecting ideas is fun. Every time I have an idea for a program or game, I put it in a document for later. Sometimes just a few words, sometimes with a long list of detailed specifications. But... as much fun as that it is, you don't learn programming form it. This, you can only do by gathering some example code, download and install the freebasic compiler and (CHM) help file, unplug your internet cable, switch off your phone and television, close the curtains, get a bottle of water (or coffee/beer) and start the fight with your computer (with many frustrations and hopefully some achievements as well)...
paul doe
Moderator
Posts: 1430
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Is FreeBASIC good for beginners to progrmaming?

Postby paul doe » Jun 11, 2021 1:08

badidea wrote:...
There were a few moments when I wanted to write a poker bot/AI, but I could never figure out how to approach this problem. Someday, I give it another try...
...

I think a Texas Hold'em bot would be easier to program than, say, a 5-draw Poker bot. This is because there is more info available for it to be 'trained' into a half-decent Poker bot. One possible approach could be through a genetic algorithm, pitting the genomes against each other for a number of hands, and then pick the one that ends up winning more, or losing less (that is, use the bankroll as the heuristic). Of course, a bit of basic strategy should be factored into it: there's no point in training a bot that has no idea how to play Texas Hold'em for starters...

Blackjack is easier, since the basic strategy is pretty much written in stone. In fact, the Basic Strategy Tables for it were derived from what we could call a 'brute force' genetic algorithm; so if you ever create an 'optimal' bot, the fully-trained bot should yield one of the well-known BSTs for any given shoe. This could prove interesting if you want to start coding genetic algorithms (as you already know the 'right' results it should yield).
paul doe
Moderator
Posts: 1430
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Is FreeBASIC good for beginners to progrmaming?

Postby paul doe » Jun 11, 2021 9:48

Just remembered two other board games that could be relatively easy to implement for learning purposes: Dominoes and Mahjong. Also, a relatively more sophisticated one could be Burako (either with Poker cards or with its own specialized pieces).

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 4 guests