Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Programming Languages (http://www.programmingforums.org/forum38.html)
-   -   BASIC - the best sort... (http://www.programmingforums.org/showthread.php?t=12602)

HippyVanMan Feb 17th, 2007 10:30 AM

BASIC - the best sort...
 
I'm interested in programming in BASIC, but I'd like to here some opinions on the best or most popular cross-platform basic languages, so as I can code under Ubuntu and under XP.
I want to program in BASIC because I'm not a complete idiot and have programmed, albeit poorly in other languages, and BASIC looks very easy to pick up, and I'd like to spend about an hour on it later today, but I don't want to pick a rubbishy dialect of BASIC. I also don't want things like visual basic, or it's linux copy-cats, vb makes me feel ill, i'd like plain old, nice simply, retro, basic. Also, I'd like a compilable variety, I mean, interpreters are good so if theres a sort with an interpreter and a compiler that's good. But I also don't want to code in the sort of basic where the only two known coders are myself and a fifty year old man who lived with his mum in texas.

Thank you for any recommendations or even better links.

DaWei Feb 17th, 2007 12:01 PM

BASIC (I presume you mean the original Dartmouth Basic or one of it's derivatives) is a terrible language for programming. I'm a 66-year old man who lived in Texas (with his mum, until age 18); I speak of BASIC, thus, with the requisite authority.

Arevos Feb 17th, 2007 12:16 PM

BASIC is rare outside the Visual Basic family of dialects, and most BASIC implementations are interpreted. Indeed, the design of BASIC was influenced by the need to make it easily interpreted by computers with little computational power. Additionally, plain BASIC is rather limited as a language, and does not have the best reputation for teaching good programming techniques.

It won't be long before "Python" is mentioned, so I'll mention it now. Python has linguistic similarities to BASIC, whilst having a far larger base of users, and is a programming language frequently recommended to newcomers. It's cross platform, has a large standard library, and whilst it doesn't have a compiler, you can make standalone executables via py2exe.

I'll give you a quick comparison between the two languages, with a small application that prints out the times tables of a user entered number. Here is the application in the QBASIC dialect:
:

  1. PRINT "This application will print out the times table of any number you enter"
  2. INPUT "Please enter a number: ", multiple%
  3. PRINT
  4. FOR %number = 1 TO 12
  5.     PRINT number%; " x "; multiple%; " = "; number% * multple%
  6. NEXT %i

And here is the same program in Python:
:

  1. print "This application will print out the times table of any number you enter"
  2. multiple = raw_input("Please enter a number: ")
  3. print
  4. for number in range(1, 13):
  5.     print number, "x", multiple, "=", number * multiple

For simple applications, the BASIC code is rather similar to the Python code. However, the advantages of Python are that it is faster, more widely used, and supports more advanced features should the programmer require them. With BASIC, you will hit the wall of what the language is capable of far sooner than with Python.

For instance, in Python its relatively easy to return a list of all URLs linked from a website:
:

  1. import sys
  2. from urllib import urlopen
  3. from urlparse import urljoin
  4. from BeautifulSoup import BeautifulSoup
  5.  
  6. # Get url specified by the first command line argument
  7. url = sys.argv[1]
  8.  
  9. # Parse the HTML of the webpage using the BeautifulSoup parser
  10. soup = BeautifulSoup(urlopen(url))
  11.  
  12. # Iterate over all link tags:
  13. for link in soup.findAll('a'):
  14.     if "href" in link.attrs:
  15.         print urljoin(url, link["href"])  # print out the full URL of the link

Whilst most variants of BASIC (especially the older ones) don't even have the necessary libraries to access the net in this fashion.

mrynit Feb 17th, 2007 9:58 PM

you want http://freebasic.net/
Quote:

FreeBASIC - as the name suggests - is a completely free, open-source, 32-bit BASIC compiler, with the syntax the most compatible possible with MS-QuickBASIC, that adds new features such as pointers, unsigned data types, inline-assembly and many others
FreeBASIC can use alot of 32bit dll files like winsock allegro sdl openGl and much more. its a great langauge to make simple games.

FreeBASIC is crossplatform linux DOS and windows.

Indigno Feb 17th, 2007 11:21 PM

Qbasic really isn't good for more than making simple games or just screwing around with. If that's what you plan on doing, then ^.

Grich Sep 23rd, 2007 7:43 PM

I am a big BASIC fan. It was my first language.
The Quick BASIC compiler / IDE is still good. I run it on my XP platform, and it is still happy. It is hard to find, but, search for Quick Basic 4.5 or go to phatcode.net and look on the compiler page for version 4.5.
I used FreeBasic as while, and I HATE it. Too New School. I like old school.
Also, some of the new student calculators have the BASIC language built in for macros, it is very powerful though.
Hope this information helps.:)

DaWei Sep 23rd, 2007 8:03 PM

Please try to avoid dragging up old threads.


All times are GMT -5. The time now is 1:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC