Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Well I don't give a damn about my bad reputation."
#1
"Well I don't give a damn about my bad reputation."

- Joan Jett, Bad Reputation



Basic has gotten a bad reputation, some of it deserved, some of it "sneering" by people who use "real" programming languages. Or they don't know, or don't realize, the Basic languages of today "are not your father's Basic." Let's look at some of the criticisms people have of basic.
  • Requires line numbers. Basic hasn't "required" line numbers for over 30 years. Most of the "world-class" compilers (and interpreters) support line numbers if needed, but labels may be used. It is entirely possible to write functional Basic programs without needing line numbers or labels.
  • Only allows short (1 or 2 character variable names). This restriction hasn't been present in Basic for over 40 years. And variables can include the underline _ as a separator.
  • Variables have to be identified by a type symbol, e.g. % for integer, $ for string, etc. This is done as a convenience, so variables can be "defined" when used, and the compiler will know what the variable is used for. It is also provided for backward compatibility. You can declare a variable as a certain type before use, (e.g. DEFINE MyName AS STRING), declare certain variables beginning with certain letters have a default data type, and can even require all variables be declared before use.
  • Requires declaring assignments by using "LET" as a prefix. Developments in scanning eliminated that requirement back in the 1970s. The LET keyword is kept strictly for backward compatibility.
  • Produces "spaghetti code." When programs were written on an "ad hoc" or "seat of the pants" methods, yes, you got programs that jumped all over the place, and had no consistency. But this was true of any language that lacked good control structures, had line labels, and no means other than  GOTO and IF statements to choose code paths. This includes C, Fortran and Cobol. It is possible, even when all Basic had for program control and branching were GOTO, GOSUB, and IF x THEN GOTO, to write structured or cohesive programs that were more-or-less consistent in using structure in code.
  • Weak or inadequate control structures. Basic has all the control structures supported by other high-level languages, including: WHILE, CASE, FOR, IF statement block, procedures (SUB) and functions.
  • Lacks support for structures or records. The TYPE statement allows creation of a structured record. Fields in a structure can be accessed using the standard variable.field notation.
  • You can't access external routines written in other languages. External routines can be called, and any of the common calling conventions may be used.
  • No database support. Since external routines can be accessed, any database system that provides a shared library for database access can be used.
  • Only supports short (<256 byte) strings. Basic supports virtually unlimited length of strings. I wrote a short (<10 line) program to double the length of a string on each iteration of a loop. After 26 iterations, I had concatenated a string that was over 130 million characters long. Not that you're likely to need to work with strings that long, it is trivially easy to handle 1K or 100K strings in a Basic program.
  • No dynamic memory. Basic supports pointers, creation of dynamically allocated structures (records) using the NEW keyword. Basic supports dynamic arrays that can be shrunk or expanded.
  • Is trivially easy to learn. This is a criticism? You can go online and find videos on YouTube to teach C++ in 10 hours. The fact that Basic can be picked up by a person not familiar with programming even faster than this does not mean the language is a "toy." Basic can and has been used to develop professional applications. It just happens to have a gentler learning curve than other programming languages is a strength, not a weakness. It also creates an advantage, in that once you learn one programming language, it's easier to pick up others. Basic's ease of use may make it appear to be less capable than other languages, but it is usable by professionals to actually accomplish real work.
  • Can't be used for GUI applications or anything other than for text applications. Some versions of Basic support Windows forms. One supports the WXWidgets GUI framework. Others support Windows WIN32 API, or other GUI frameworks. Most Basics support line drawing and other graphical image drawing functions.
In short, many people have misconceptions of Basic, based on reasons that are either flatly incorrect, or were fixed decades ago.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#2
Sadly a lot of it was brought about by M$. A lot of it was going from BASCOM to QuickBASIC/BASIC PDS to VBDOS to VB for Windows. There are a lot of folks around who remember how it was like to do stuff on an 8-bit computer which help maintain the "bad reputation" in the opinion of others who want it to run fast, who want to be seduced by the eye, who needs to get the latest technology... for bragging or anything else. It's not just BASIC, it's other programming languages. There must have been a lot of resistance to what was added to C in particular, according to the "gcc" manual on chapter 5 or 6 "Extensions to the C language". Defending C code in K&R style could be as ornerous as trying to run BASIC code, which has not much more than "INPUT", "PRINT" and "GOTO", anyhow on 64-bit systems.

BASIC PDS v7.1 had ISAM built in but didn't go anywhere. It was one attempt for in-house support for databases or something else for office. It must have lost favor to Word Basic, something I suddenly discovered reading PC MAGAZINE in the late 1990's...

I program in Lua a few times. A lot of code written for v5.1 and earlier has to be rewritten for the latest v5.4 if it must do heavy processing with integers such as checking out bits or creating WAV files. In the earlier release had to use "bit32" module, but in v5.4 must mess around with:

https://www.lua.org/manual/5.4/manual.ht...ing.unpack

P.S. There is an awful lot of hating on "LET". On Timex Sinclair you had to use "LET", there was no other choice. It was how the computer worked. No I didn't actually have one, I discovered this in a BASIC programming book for children. I didn't like the "joke" offered about it by the previous maintainer of the QB64 wiki... he could have at least offered a link to Wikipedia about the British computer.
Reply
#3
Quote:Is trivially easy to learn. ...

What idjet bitches about that?
b = b + ...
Reply
#4
(09-02-2022, 04:44 PM)TDarcos Wrote: "Well I don't give a damn about my bad reputation."

- Joan Jett, Bad Reputation



Basic has gotten a bad reputation, some of it deserved, some of it "sneering" by people who use "real" programming languages. Or they don't know, or don't realize, the Basic languages of today "are not your father's Basic." Let's look at some of the criticisms people have of basic.
  • Requires line numbers. Basic hasn't "required" line numbers for over 30 years. Most of the "world-class" compilers (and interpreters) support line numbers if needed, but labels may be used. It is entirely possible to write functional Basic programs without needing line numbers or labels.
  • Only allows short (1 or 2 character variable names). This restriction hasn't been present in Basic for over 40 years. And variables can include the underline _ as a separator.
  • Variables have to be identified by a type symbol, e.g. % for integer, $ for string, etc. This is done as a convenience, so variables can be "defined" when used, and the compiler will know what the variable is used for. It is also provided for backward compatibility. You can declare a variable as a certain type before use, (e.g. DEFINE MyName AS STRING), declare certain variables beginning with certain letters have a default data type, and can even require all variables be declared before use.
  • Requires declaring assignments by using "LET" as a prefix. Developments in scanning eliminated that requirement back in the 1970s. The LET keyword is kept strictly for backward compatibility.
  • Produces "spaghetti code." When programs were written on an "ad hoc" or "seat of the pants" methods, yes, you got programs that jumped all over the place, and had no consistency. But this was true of any language that lacked good control structures, had line labels, and no means other than  GOTO and IF statements to choose code paths. This includes C, Fortran and Cobol. It is possible, even when all Basic had for program control and branching were GOTO, GOSUB, and IF x THEN GOTO, to write structured or cohesive programs that were more-or-less consistent in using structure in code.
  • Weak or inadequate control structures. Basic has all the control structures supported by other high-level languages, including: WHILE, CASE, FOR, IF statement block, procedures (SUB) and functions.
  • Lacks support for structures or records. The TYPE statement allows creation of a structured record. Fields in a structure can be accessed using the standard variable.field notation.
  • You can't access external routines written in other languages. External routines can be called, and any of the common calling conventions may be used.
  • No database support. Since external routines can be accessed, any database system that provides a shared library for database access can be used.
  • Only supports short (<256 byte) strings. Basic supports virtually unlimited length of strings. I wrote a short (<10 line) program to double the length of a string on each iteration of a loop. After 26 iterations, I had concatenated a string that was over 130 million characters long. Not that you're likely to need to work with strings that long, it is trivially easy to handle 1K or 100K strings in a Basic program.
  • No dynamic memory. Basic supports pointers, creation of dynamically allocated structures (records) using the NEW keyword. Basic supports dynamic arrays that can be shrunk or expanded.
  • Is trivially easy to learn. This is a criticism? You can go online and find videos on YouTube to teach C++ in 10 hours. The fact that Basic can be picked up by a person not familiar with programming even faster than this does not mean the language is a "toy." Basic can and has been used to develop professional applications. It just happens to have a gentler learning curve than other programming languages is a strength, not a weakness. It also creates an advantage, in that once you learn one programming language, it's easier to pick up others. Basic's ease of use may make it appear to be less capable than other languages, but it is usable by professionals to actually accomplish real work.
  • Can't be used for GUI applications or anything other than for text applications. Some versions of Basic support Windows forms. One supports the WXWidgets GUI framework. Others support Windows WIN32 API, or other GUI frameworks. Most Basics support line drawing and other graphical image drawing functions.
In short, many people have misconceptions of Basic, based on reasons that are either flatly incorrect, or were fixed decades ago.

I enjoyed reading that.  Thanks for taking the time!
Reply
#5
Quote:"Well I don't give a damn about my bad reputation."


Yeah! I see it!

I read and heard such profound reflections more than 20 years ago. And what did it do?

Microsoft has driven the development of programming and website design. In IE from 4.01 onwards, you could click on individual points in an image for the first time to go to a corresponding website. And so forth  . . . Microsoft revolutionized the web and it normalized the computer like the phone.

Who knows where one would be today without Microsoft - maybe with the rip-off Apple, or with the Frickel-Linux?

Your claims about C and Cobol are not correct. And anyway, what's the point, if I know one programming language, I don't have a problem with others? Really?

What does Basic have to do with C, and C with Cobol, and all three with Java? Nothing, absolutely nothing, to do with each other. Except something like For, If, While, and so on.

Well, the usual phrases I've known for over 20 years. Nothing News!
Reply
#6
I know quite a few other languages, some well, others I would need a refresher on (like Assembler, yikes) but I like programming in BASIC (QB64 to be exact) because it's fun. I actually like creating everything from scratch and maintaining my own libraries of utilities. QB64 is nothing like the BASIC of the 80's because of the power and new features, but it can be if you want, and that's amazing too.

BASIC was designed to be a tool to let people enter programming quickly. The same for PASCAL. It's a shame languages like these aren't revered more. BASIC has been around now since 1965 and still widely used. That tells you something. Hell, I even enjoyed VisualBasic (well, until .NET came along).

Someone mentioned ISAM too. VisualBasic for DOS had ISAM as well and I wrote many database programs back in the early to mid 90's for a company I was with. It's a shame that wasn't developed further.
Reply
#7
Any time I've attempted to learn a new language, I've noticed that they inevitably use the same root concepts of iteration, logical branching, variable assignment, etc.

Well a programming language is for talking to a computer, and unless you're flipping bit switches, you're doing that through an interpreter.

So maybe someone could enlighten me... if I wished to speak to a Russian gentleman, and there was an English speaking interpreter and a French speaking interpreter in the room, why should I learn French in lieu of employing the English interpreter? All that trouble for a few nuanced bits of vocabulary? So meanwhile, QB64 enables me to do stuff that I never dreamed of doing 20 years ago with QBasic on a 386.

Certainly there are differences in capabilities, but there are workarounds for those and I suspect that a well crafted program in BASIC will perform as well or better than a poorly coded one in some other language, even one coded "close to the metal".
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply
#8
(09-02-2022, 06:41 PM)mnrvovrfc Wrote: P.S. There is an awful lot of hating on "LET". On Timex Sinclair you had to use "LET", there was no other choice. It was how the computer worked.

The reason for the "LET" statement was when Basic was invented in 1965, there wasn't much work on things like parsing, and also, these people were working in systems sometimes only having 8L - 4K of ROM, 4K of RAM. Requiring every line start with a keyword makes the job of writing a compiler or interpreter easier. Later people figured how to get around this restriction. I mean, I think there is a correlation between language capability and compiler complexity. The fewer things the person has to do in writing code, the easier it makes their job, and the more complex the compiler has to become.

I can obviously say that the more things you require the programmer to do, the simpler your language processor can be. It's a choice of who does the work, the compiler writer or the application programmer. The difference being the application programmer's workspace is "where the rubber meets the road." The compiler user (programmer) is the one that, in the end, who has to use the language to write their application. Application programmers, unlike compiler writers,  can't push their work onto the user of their program.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#9
(09-02-2022, 07:16 PM)bplus Wrote:
Quote:Is trivially easy to learn. ...

What idjet bitches about that?

The ones that declare, without ever having learned a language, that it's no good for certain types of applications. I mean, there are some features that are in certain languages that are brilliant, and others that are brain-dead moronic.

Let's look at C. Absolutely brilliant: the "symbol =" notation, e,g. a +=5 instead of a = a+5; a *= b instead of a= a*b etc. Brain dead moronic: case sensitivity of identifiers. It's hard enough keeping all the variables and manifest constants in a program in your head, now you also have to remember the capitalization of them. It also increases the possibility of confusion, if you have multiple variables with the same spelling.

I mean, I am neither a language bigot nor a word processor bigot. I use both Word Perfect and Open Office/Libre office. I also use QB64, QB64 PE, wxBasic, Free Basic, Free Pascal, and when necessary, C and C++. Each has strengths and weaknesses.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#10
(09-03-2022, 09:30 PM)TDarcos Wrote: Let's look at C. Absolutely brilliant: the "symbol =" notation, e,g. a +=5 instead of a = a+5; a *= b instead of a= a*b etc. Brain dead moronic: case sensitivity of identifiers. It's hard enough keeping all the variables and manifest constants in a program in your head, now you also have to remember the capitalization of them. It also increases the possibility of confusion, if you have multiple variables with the same spelling.
:
Say to the people that brought us both C and Unix they created a few things which are "brain dead moronic". Also some companies depend on obfuscation for "defending" their "property": I saw an example of working C++ code which was nothing but "A", "a", "B" and "b" -- advertising on M$DN if I'm not mistaken long ago. :/
Reply




Users browsing this thread: 15 Guest(s)