PDA

View Full Version : Why BASIC?



jimi_hendrix
November 19th, 2008, 01:52 AM
so while flipping through my math textbook i found a program in BASIC for some calculation...

so this led me to a few questions:

1. why basic? ya sure it has some very readable but some things like the subroutine in the program and the variable declaration were somewhat complex looking for a non-programmer

2. also why is visual basic (since its the most modern and popular form of basic today) such a popular starting point for programmers if it leads to bad habits?

3. When someones says BASIC in a book (like my math one) what type of basic do they generally mean...? the program was CLI in my mathbook

tinny
November 19th, 2008, 01:59 AM
so while flipping through my math textbook i found a program in BASIC for some calculation...

so this led me to a few questions:

1. why basic? ya sure it has some very readable but some things like the subroutine in the program and the variable declaration were somewhat complex looking for a non-programmer

2. also why is visual basic (since its the most modern and popular form of basic today) such a popular starting point for programmers if it leads to bad habits?

3. When someones says BASIC in a book (like my math one) what type of basic do they generally mean...? the program was CLI in my mathbook

Umm, an old book?

Perhaps an older Author?

jimi_hendrix
November 19th, 2008, 02:00 AM
Umm, an old book?

Perhaps an older Author?

just looked at the copywrite...mid 80's

tinny
November 19th, 2008, 02:07 AM
just looked at the copywrite...mid 80's

That would explain it :-)

jimi_hendrix
November 19th, 2008, 02:09 AM
That would explain it :-)

your telling me that there arnt more readable languages in the 80's? i find C and pascal more readable...

(also OT: i feel like learning a new language...something out of the way...any suggestions?)

shadylookin
November 19th, 2008, 02:11 AM
so while flipping through my math textbook i found a program in BASIC for some calculation...

so this led me to a few questions:

1. why basic? ya sure it has some very readable but some things like the subroutine in the program and the variable declaration were somewhat complex looking for a non-programmer

most engineer types love fortran. BASIC is supposed to be easy so perhaps the author thought it would be best for non-programmers or maybe it's just his personal preference



2. also why is visual basic (since its the most modern and popular form of basic today) such a popular starting point for programmers if it leads to bad habits?

well some people still smoke crack even though it's bad for them. Some people simply don't care about such things, not everyone who programs does so with the end goal of becoming a software engineer.

hardyn
November 19th, 2008, 02:13 AM
they don need to be compiled.

didn't most releases of DOS come with a BASIC interpreter? saves from finding a compliler (this is 80's remember, start of GNU, no Linux)

brunovecchi
November 19th, 2008, 02:16 AM
so while flipping through my math textbook i found a program in BASIC for some calculation...

so this led me to a few questions:

1. why basic? ya sure it has some very readable but some things like the subroutine in the program and the variable declaration were somewhat complex looking for a non-programmer

2. also why is visual basic (since its the most modern and popular form of basic today) such a popular starting point for programmers if it leads to bad habits?

3. When someones says BASIC in a book (like my math one) what type of basic do they generally mean...? the program was CLI in my mathbook

BASIC (QBASIC) was the first language that I tought myself. It was the 90's, and we had a DOS/Windows 3.1 computer. For some reason, QBASIC was installed in it, so I started with that.
I suppose it is easy enough, and if it was installed by default in MS-DOS operating systems, it probably means it was a natural choice for beginners, all you had to do is start coding and running your scripts (no compiling required).

jimi_hendrix
November 19th, 2008, 02:27 AM
right but the days of DOS and prepackaged interperaters are over

but schools are teaching VB as a first language...even though the majority of the coding world seems to be against that languae (ive googled C# vs VB a few times...)

brunovecchi
November 19th, 2008, 02:34 AM
right but the days of DOS and prepackaged interperaters are over

I agree, and so are the BASIC days.


but schools are teaching VB as a first language...even though the majority of the coding world seems to be against that languae (ive googled C# vs VB a few times...)

Really? I didn't know that part... highschools or college?
Maybe it's because VB comes with its own ready-to-use interface designer/IDE/Debugger/Deployer.

tinny
November 19th, 2008, 02:48 AM
well some people still smoke crack even though it's bad for them. Some people simply don't care about such things, not everyone who programs does so with the end goal of becoming a software engineer.

:lolflag: true


your telling me that there arnt more readable languages in the 80's? i find C and pascal more readable...


I dont believe I said or suggested that. Read my post.

BASIC was very popular in the 80's

jimi_hendrix
November 19th, 2008, 03:01 AM
VB and Java seem to be the langauges of choice in high schools i think

pmasiar
November 19th, 2008, 03:35 AM
MS BASIC was in ROM of first IBM PC (4KB!), so always available. Also, it integrates trivial line editor, so it was "IDE" back in days - Pascal or Fortran required editor and compiler, which needed to be installed, which required external memory. 5-inch floppy disk (http://en.wikipedia.org/wiki/Floppy_disk#The_5.C2.BC-inch_floppy_disk) was a mess... and Hardcard (http://en.wikipedia.org/wiki/Hardcard) was rare and expensive, because it could hold **a lot** of data: up to 20MB! ;-)

hardyn
November 19th, 2008, 03:42 AM
My old man actully had two in the 80's, they were cheaper than replacing an MFM hard disk and controller. They were actully pretty slick.

Gilabuugs
November 19th, 2008, 03:52 AM
any of my new engineering books ( particularly statics and dynamics books) usually have basic programs, my guess it is probably popular because it is common and close to fortran, electrical engineers here use c/++ but for Mechanical and Civil and maybe a physics degree we take a programming class in matlab

probably because algorithms matter less than just getting the answer

cabalas
November 19th, 2008, 04:15 AM
but schools are teaching VB as a first language...even though the majority of the coding world seems to be against that languae (ive googled C# vs VB a few times...)

If I was to have a guess I would put it down to two issues the first is Education (I'm talking about secondary education not tertiary) is relatively slow moving especially when compared to something quite fast paced like Computing. It would probably take a lot to get something into the curriculum and even longer to get it out.

The other reason would probably be the name, basic gives the impression that it is easy to learn which a teacher is probably looking for when they have to manage a classroom full of kids.

That's my 2 cents, If anyone has experience in the education sector please correct me if I'm wrong.

slavik
November 19th, 2008, 04:20 AM
in NYC, public school teachers for grammar school (1-8) get paid as much as garbage man. They are also in the same/similar union (city workers), but to be a teacher you have to have a college degree (which is tough, I've asked people).

Compare that with someone who knows programming, they could get paid more and love their job more if they go working for a company (or on their own).

shadylookin
November 19th, 2008, 07:24 AM
but schools are teaching VB as a first language...even though the majority of the coding world seems to be against that languae (ive googled C# vs VB a few times...)

really? My professors seem to have a universal loathing for the language

sjbaugh
November 19th, 2008, 08:37 AM
The origional "Dartmouth BASIC" was very easy to implement as a timesharing application. I used it in 1973 on mainframe computer with a 64k memory running 8 teletype machines (and batch programs running at the same time!) The implemtation was very simple with only 26 variables (A..Z).

wmcbrine
November 20th, 2008, 01:53 AM
Consider what BASIC is an acronym for: "Beginner's All-purpose Symbolic Instruction Code". It was conceived as a teaching language (though that was long ago, in the 1960's).

Then consider that BASIC was the de facto standard operating environment for home computers in the early 1980's. You turned them on, and they were running BASIC.

mbsullivan
November 27th, 2008, 08:12 AM
That would explain it
your telling me that there arnt more readable languages in the 80's? i find C and pascal more readable...

If I were writing a textbook, and cared about expressing an algorithm in a readable and non-domain-specific way, I'd try a language called "pseudocode". I think it was around in the 80s...


(also OT: i feel like learning a new language...something out of the way...any suggestions?)

Do you like functional programming? Try Haskell (http://en.wikipedia.org/wiki/Haskell_(programming_language)) or Clean (http://en.wikipedia.org/wiki/Concurrent_Clean). Want something more object-oriented but still functional? Try OCaml (http://en.wikipedia.org/wiki/Ocaml).

Want to stay away from functional programming? Fine. If you like hardware, get down and dirty with stacks and reverse Polish notation with Forth (http://en.wikipedia.org/wiki/Forth_(programming_language)). Care about embedded, real-time, or safety critical systems? Maybe consider getting a non-programming hobby :) Or, try Ada (http://en.wikipedia.org/wiki/Ada_(programming_language)).

Otherwise, you could also try to expand your programming horizons with a language you know, like C. Try data parallelism with Cilk (http://en.wikipedia.org/wiki/Cilk) or task-level paralellism using MPI (http://en.wikipedia.org/wiki/Message_Passing_Interface). If you haven't already done so, you could play around with thread-level parallelism with pthreads (http://en.wikipedia.org/wiki/POSIX_Threads). Or, if you have a new graphics card, you could work on SIMD-style data parallel programming using CUDA (http://en.wikipedia.org/wiki/CUDA) (NVidia) or AMD's Stream processing SDK (http://ati.amd.com/technology/streamcomputing/sdkdwnld.html) (ATI).

Just a few thoughts :)
Mike

pmasiar
November 27th, 2008, 03:14 PM
Yay, another fan of Forth around!

Yes, Forth is **very** interesting language because you can be as close to the metal as ASM, yet build very powerful abstractions on top of that. Forth **will** challenge your brains like no other language.

pp.
November 27th, 2008, 03:50 PM
Yay, another fan of Forth around!

Yet another one here.


Forth (...) can be as close to the metal as ASM,

That is only true for the special case where your CPU has the FORTH interpreter in microcode. Otherwise FORTH is a language which abstracts very much from the underlying PU architecture.


Forth **will** challenge your brains like no other language.

That must be a very subjective experience, then. It never felt that challenging to me. In fact, I found managing some scripting languages much harder at times.

nvteighen
November 27th, 2008, 04:55 PM
Forth is really challenging... sometimes it feels like moving pieces on a board game or something similar :p

jimi_hendrix
November 27th, 2008, 05:02 PM
anyone know a simula compiler...or for that matter what the file extention for simula is?

Luggy
November 27th, 2008, 07:17 PM
1. why basic?

2. why is visual basic such a popular starting point for programmers?

3. When someones says BASIC in a book what type of basic do they generally mean...?

1. A lot of old people were taught basic. Your book was probably written by an old person.

2. Mostly because MS pushes it, same reason C# is getting popular. It also doesn't hurt that you can make graphical applications very easily.

3. When I see Basic I think BASIC. Most people usually say VB when they are talking about Visual Basic.

pp.
November 27th, 2008, 08:28 PM
anyone know a simula compiler...or for that matter what the file extention for simula is?

You're off topic, but googling for "simula compiler" will yield many hits.

pmasiar
November 28th, 2008, 02:17 AM
pmasiar>Forth (...) can be as close to the metal as ASM,


That is only true for the special case where your CPU has the FORTH interpreter in microcode. Otherwise FORTH is a language which abstracts very much from the underlying PU architecture.

Forth can do both. Common part of most implementations (I am aware of) is interactive ASM which allows to define Forth words using ASM of underlying CPU directly, if you need it. That flexibility to reach to hardware directly if you need it is one of sources of power of Forth, IMHO.

pmasiar>Forth **will** challenge your brains like no other language.

That must be a very subjective experience, then. It never felt that challenging to me. In fact, I found managing some scripting languages much harder at times.

You failed to look into right application examples implemented in Python. I had somewhere implementation of tiny-Pascal compiler (into P-code), including P-machine and parser, in like 11 pages of Forth. Really a high-wire balancing act! I was reading it for many hours but never fully grokked it... ;-)

pp.
November 28th, 2008, 07:55 AM
is interactive ASM which allows to define Forth words using ASM of underlying CPU directly

But then, it isn't FORTH which is close to the metal but the embedded ASM part.

Of course it is true that FORTH implementation have the capability to embed ASM code, and they supply a nice API for interfacing. So have other languages which no one will accuse of being close to the metal.