Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

It is BASIC or is it BABL

Status
Not open for further replies.

3v0

Coop Build Coordinator
Forum Supporter
Various modern Basic languages have more in common with other languages then the original langauge Basic. For me it stopped being basic when they lost the line numbers.

A bit of what Wikipedia calls structured code in the original/early BASIC:
Code:
10 INPUT "What is your name: "; U$
20 PRINT "Hello "; U$
30 REM
40 INPUT "How many stars do you want: "; N
50 S$ = ""
60 FOR I = 1 TO N
70 S$ = S$ + "*"
80 NEXT I
90 PRINT S$
100 REM
110 INPUT "Do you want more stars? "; A$
120 IF LEN(A$) = 0 THEN GOTO 110
130 A$ = LEFT$(A$, 1)
140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40
150 PRINT "Goodbye ";
160 FOR I = 1 TO 200
170 PRINT U$; " ";
180 NEXT I
190 PRINT

You can convert the modern BASIC to C or Pascal (languages from the early days but post original BASIC) much more easily then then true/original BASIC.

None of this makes the language any less useful. It just bugs me that they keep using that tired old name.

Maybe it should be called BABL:
Basic with Additions from Better Languages. :)

The name BASIC is used to attract people who think the language will be easier to use because they see the name BASIC and think simple. Thats marketing. :(
 
Last edited:
I learned programming in BASIC back in the 70's, and it was the easiest to learn compared to the other languages at the time (COBOL, FORTRAN, PASCAL, or Assembly). when I eventually was forced to move up to a IBM PC, compiled BASIC lost the line numbers, and I pretty much lost interest in programming. I was doing Assembly on a 6502, but the 286 was much different and the compilers used labels instead of memory locations.

Last fall I took the plunge into microcontrollers. I knew from the beginning that Assembly would be the best choice of language considering the limited memory. I do look at other languages for examples, but its tough to get the details I'm looking for, usually locked into library files. A HEX file dissasembler would be cool as hell.

I've been moving into more complex projects, where timing and feature setup is critical, and a higher level language would handle these much better. The BASIC compiler makes about as much sense to me as C, doubt much that I knew about BASIC will be of much use, its seems completely different.
 
wow - that brings back memories :) Used to do a ton of basic programming for the PC then went onto C++ and stopped when it all went windows based - OOP
 
Every OS I have used with BASIC, the first thing I would do is port a program I wrote a LONG time ago called prebas.

I would write my code with no line numbers and used labels, prebas would then convert it and add the numbers. It was a simple program.

But I have never like the numbers. Even DEC VAX Basic had them..

But it does bring back memories.
 
I can remember writing basic with line no's on my Spectrum then my Enterprise 128, Looking back I can say that it was very poor method, The language is fine but structuring your program was really hard. From what I remember about the late 70's ANSI specified a Basic with out line no's, so line no's is very old hat and cannot be compared with modern variants.

I would call my self a competent Pic Basic programmer and pretty capable of writing in Pic Asm. I have seen a few comments against Basic saying ASM is better, this misconception is made by people who have never written in basic or were unfortunate enough to have used a duff version of the pic basic.

I know 2 pic compiler writers and I can say that there exception asm programmers, so by using one of there basics you get the best of both worlds. The ease and readability of basic and the excellent code produced.

For a Pic beginner there are 3 things they have to contend with
1 Actually learning to program and think with a programmers head
2 Lean a programming language
3 Lean about pic's

Now if you have non of those 3 then BASIC is the obvious choice.
Its very easy to read
It's very forgiving of a bad programming style
It takes care of all the pic stuff for you.

For example

The classic Flashing led

device 16f84
dim led as portb
loop:
toggle led
delayms 500
goto loop

If you decided to write it in asm you would have to write a delay routine before you could even think about making it flash then find out how to do toggling in asm then include the appropriate Pic file.

I would always though recommend that people once they get going at least understand how a pic works under the skin.

I like to think I think asm and program basic
 
Pic BASICs (or any basic) are good IMHO. But, for the pic, there are limits of the lite free ones (Mikroe.com is the better of lite/free ones). But anyway, some have bloat, some are a poor version of BASIC (like the old line numbered BASIC that did not have if_then else endif). You can get the job done, but structured BASIC is nice.

But I can write the code in BASIC or ASM.

If it is a simple, small, get it out fast project. For sure look at BASIC (note I said simple).

If it is a timing (software timing) critical project you have to research and pick the right way to go. Many people use Pic BASIC pro and ASM. Many use MikroBASIC and ASM..

But I do agree, if you have not learned and used (a good) Pic BASIC you will not like BASIC and it is not really fair to knock what you do not know.
 
Anyone who generalizes about one language being better than another is pretty much a moron. They all have their advantages and disadvantages. However I appreciate those Forum members with valid cohesive and coherent reasons for preferring one language over another.

For those PIC hobbyists like me with an almost non-existent budget it seems we're pretty much limited to Assembler or C18. I'd love to add a recent BASIC language offering to my 'toolbox' but I simply don't have the funds to purchase a BASIC language.

I envy those hobbyists that do have the funds and I would happily steer them toward a BASIC language called Swordfish which at first glance seems to be the nicest BASIC implementation I've come across.

Have fun. Mike
 
Mike said:
Anyone who generalizes about one language being better than another is pretty much a moron.
It is said that computer languages are a lot like religion. The one you learn first is always the most comfortable, the one most people prefer. Unless a person has studied/used several languages in depth he lacks the ability to make a sound judgment regarding the merits of any language.

Most people who know several languages will agree with your statment
They all have their advantages and disadvantages
.

I too am sensitive to software prices. Esp since software tools seem to become obsolete faster then I can afford to buy them.
 
I wish I could have put it so elegantly. Of course that's what I meant. When you become proficient in several languages you gain valuable knowledge and experience that helps you decide when it's appropriate to use one over another. BTW, my first language was Apple ][ Integer BASIC and Applesoft BASIC (1979). I did however have to write the real-time operating system firmware for the EPG and EPG-II character generators in 1984 (the earliest versions of the current "TV Guide Channel") using 6502 assembly language.

In a way I suppose having limited funds forced me to become proficient in Microchip's free assembler and C18 tools and I'm very thankful that both are "main stream" and shouldn't dissappear anytime soon. If Swordfish BASIC could somehow become Microchip BASIC they (Microchip) would have a pretty well rounded toolsuite offering. And if was a 'free' tool, man, that would be sweet.

Which brings up a question. Why doesn't Microchip have a BASIC language offering? Do they not consider it a viable language? Or, were they happy with the commercial BASIC offerings?
 
Last edited:
Mike said:
I wish I could have put it so elegantly. Of course that's what I meant. When you become proficient in several languages you gain valuable knowledge and experience that helps you decide when it's appropriate to use one over another. BTW, my first language was Apple ][ Integer BASIC and Applesoft BASIC (1979). I did however have to write the real-time operating system firmware for the EPG and EPG-II character generators in 1984 (the earliest versions of the current "TV Guide Channel") using 6502 assembly language.

In a way I suppose having limited funds forced me to become proficient in Microchips free assembler and C18 tools and I'm very thankful that both are "main stream" and shouldn't dissappear anytime soon. If Swordfish BASIC could somehow become Microchip BASIC they (Microchip) would have a pretty well rounded toolsuite offering. And if was a 'free' tool, man, that would be sweet.

Which brings up a question. Why doesn't Microchip have a BASIC language offering? Do they not consider it a viable language? Or, were they happy with the commercial BASIC offerings?

Well my guess is that Microchip's main market, it's bead and butter, is the commercial embedded systems companies and ASM and C probably is used by 99% of those companies exclusively. I suspect we hobbyist are just small potatoes for MC and Basic is most likely not on their radar screen.

Lefty
 
One recurring theme I have been seeing is the desire to have a free product, and that has to be first class and supported for life, this in reality is nigh on impossible.

As I said I know 2 commercial basic compiler writers and I know you very difficult to make a living from it, its always a side line. So to ask them to just give a full product away is not a viable option. To give the support you have to be around for long enough and with out an income you will never be able to.

I agree that some people (me I suppose) see Basic vers other languages as a religion and even religions have sub sects.

So there is no ambiguity my religion is BASIC worshipping the incarnation know as PROTON with leaning now towards Swordfish.

One thing is I know my religion and amongst the sub sects My favourite's are there because technically there the best.

I do not write in C (about the only other major serious religion) as I do not under stand it and I see no point learning it. I know there is no advantage (for me) in learning it as I can do just as well in Proton as I could in C.

Inevitably religious sects try to convert you to there's which can be a real pain in the ass, so my preaching is for the undecided. My main purpose is though to educate the mass's to learn how to play with pic's and to have fun.

The obligatory link to the my cathedral is www.protongeeks.com
 
Mike K8LH,

Give MikroBASIC a look. It is free to use up to 2K of code. Best for the price on the lite version.

Also, a new one is http://www.sourceboost.com/. It is free as beta right now. Will be around $70 when it is complete. Support is pretty good as well.

I have it working inside if MPLABS which is what I was after, so I can use all the tools. So BASIC + ASM + MPLABS + ICD2 = :)
 
Popularity stats.

gramo said:
There's an overwhelming amount of support out there for PIC Basic over C, the same trend runs right across the board from PIC's to PC's.

I was having fun with my original post in regards to how BASIC has morphed witout a name change. I did not mention C or BASIC vrs C. Others added that tired theme. But if we are going to go there here is the closest thing I found to real stats on language popularity.

https://www.tiobe.com/tpci.htm has a listing of languages in use.
The TIOBE Programming Community index gives an indication of the popularity of programming languages. The index is updated once a month. The ratings are based on the world-wide availability of skilled engineers, courses and third party vendors.
I do not claim they are the last word but it looks about right regarding popularity. I do not expect to find many people programing a micro in Java.

Popularity in order of rank
  1. Java ....19%
  2. C ........15%
  3. C++ ...10%
  4. PHP ......9%
  5. VB .......8%
As you can see VB is a 8% where as the C is at 15%. The score for the C family (C, C++, C#) is about 30%. If you trust these numbers C is about 2 or 3 times more popular then VB.

I could care less about popularity. My favorite non micro language is C# which come in at 3.5% which is aa little less then half of VB use and ranks 8th.

More often people who program professionals do not have the luxury of choosing the language, Code written in X can not be maintained in Y. If you work in a shop where all the code is written in X you will code in X.

At the professional nobody cares what your favorite language/religion is. Everyone plays nice.
 
That’s a rather inaccurate tool to base popularity, as it, (quote)

The ratings are calculated by counting hits of the most popular search engines

"C" is a much more broad term to search for than "Basic", and as a result, your going to end up with very inaccurate results. Consider this extract from **broken link removed**

After reading this, I decided to try a manual comparison myself. I ran a test using Google and the query string provided in the TIOBE explanation (+"<language> programming" -tv -channel). Here are the results:

Java 13,600,000 hits
PHP 12,800,000 hits
Basic 7,810,000 hits
C 5,760,000 hits
Perl 5,610,000 hits
C# 4,660,000 hits
C++ 4,610,000 hits
Python 1,120,000 hits
Ruby 236,000 hits
Cobol 192,000 hits

Hmmm. This does not feel quite right. I'm sure Cobol has a bigger web presence, so maybe the query of "Cobol Programming" as a phrase match is too limitting as that may not be how Cobol people talk? Maybe they say "Programming in Cobol" instead? Or "Cobol Portal for Programmers". When removing the "Programming" part of the query, Cobol has 16,400,000 results. Wowzers. PHP jumps to 5,030,000,000. MEGA-WOWZERS! Let's look at the more raw hits and see where they stand, then we can come up with a revised query. This is the hits based on the query +<language> -tv -channel just to keep it similar:

PHP 5,030,000,000 hits
Basic 1,550,000,000 hits
Java 917,000,000 hits
Perl 328,000,000 hits
Python 231,000,000 hits
C++ 215,000,000 hits
Ruby 135,000,000 hits
C# 114,000,000 hits
Cobol 16,400,000 hits
 
Last edited:
I agree that your search is not a good indicator. I doubt you even read all of my last post.

Their search was better...
The ratings are based on the world-wide availability of skilled engineers, courses and third party vendors.

Just stop pushing BASIC so hard.

Do you know any language as well as you do BASIC ?
 
I have been programming the Parallax line of SX microcontrollers but I haven't gotten into PICs or AVR chips yet mainly because I don't want to take the ASM leap yet. The SX chips are very closely related to PIC / AVR chips in many ways.

Parallax (www.parallax.com) offers their SX-28, 48 and 52(obsolete) chips very cheap (>$3 each) AND has a great FREE BASIC compiler called SX/B (SX BASIC). I have been using it for over a year now and have some really good projects along the PIC lines WITHOUT having to learn ASM. The only downside is that you need a $30 - $50 programming stick called an SX-Blitz (no debugging) or SX-Key (w/ debugging). I love the programming because as I started with their BASIC STAMP II chips, I quickly moved up to their SX line without learning ASM.

BASIC is a great asset and should be made available on all micro-controllers.
 
Mike said:
Which brings up a question. Why doesn't Microchip have a BASIC language offering? Do they not consider it a viable language? Or, were they happy with the commercial BASIC offerings?
BASIC may be popular with hobby types but the real market for language tools and chips are professionals.

Most people who do embedded programming professionally are either CS or EE types. For the most part BASIC is not taught in the professional track educational setting.

I do not use BASIC but some of the modern ones look quite good. But there are other good compilers in other languages.

If I did not already have 16F chips and the CCS compiler I would buy all 18F chips and use microchips free C compiler. Better to spend a few extra dollars on the chips then the compiler in this case.
 
Last edited:
I stumbled across that site a week or two ago, didn't believe the results it gave, so I researched into it a bit. Just pointing out the inaccuracy of their methods

Just letting those people who accept before researching know that the site is anything but accurate.
Code:
Do you know any language as well as you do BASIC ?
I'm also quite proficient with Assembler, C++ and a basic knowledge of Java (although I haven't made anything useful with it)
 
3v0 said:
If I did not already have 16F chips and the CCS compiler I would buy all 18F chips and use microchips free C compiler. Better to spend a few extra dollars on the chips then the compiler in this case.

That would be a complete waste of money lol

A couple of 18F2620 and 18F4620 PIC's would keep you occupied for months!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top