Hacker News new | ask | show | jobs
by networked 3990 days ago
I've also noticed the trend with various dialects of Basic producing tightly-knit communities but I wonder if you can credit that to the language itself. Is a modern, object-oriented Basic really friendlier than (a subset of) Python or Lua (edit: with a similar standard library)? I find it at least as likely that today Basic's reputation as an informal, hobbyist- and beginner-friendly language shapes the communities that use it in a certain way more than the language itself. I acknowledge this may not have been the case in the 1985 or even 1995. Blitz3D [1] was an exceptionally quick and easy way to do 3D in the year 2001 but at that point it could have been written to expose the same API, say, to a Pascal compiler.

What exactly is right about Basic has been a matter of great interest to me lately because I have been thinking about developing a bootable early home computer Basic-like interactive environment for UEFI. I quickly realized that one of the hardest design decision involved in this project would be whether the language of the environment should actually be a dialect Basic (rather than Logo, Lua, Scheme, JavaScript, Tcl, Python or something else entirely).

On a related note, I wish there were large empirical studies of how quickly new programmers learn to use each of the stereotypically friendly languages. Perhaps MOOC will eventually produce those.

[1] https://en.wikipedia.org/wiki/Blitz3D

1 comments

> Is a modern, object-oriented Basic really friendlier than Python or Lua?

QuickBASIC had User Defined Types, FreeBASIC not only has Pointers (and therefore Function Pointers) but also adds methods to TYPES which are defined as Subroutines just like in C++. In Fact FreeBASIC can be thought of as a covert way to learn and understand C++ for QBasic programmers.

As for it being an informal or hobbyist language, if one begins by designing the proper data structures and adds the adequate functions to handle them, the resulting programs can be just as capable as those designed in any other language. Being able to think like a programmer makes all the difference, not the reputation of the language being used.

As for Blitz3D, it can access external DLLs. DLLs can be easily written and compiled with freeBASIC. No problem for any adventurous BASIC programmer.

As for your BASIC dialect you can take a look at [1] to learn how to write your own in FreeBASIC or QB64. This code can be easily understood and ported to any language.

[Edit] The standard library may not be as complete as Python's but FreeBASIC can work with most DLLs compiled with C and the documentation will mention ways to include C headers and work with various external libraries.

[1] http://www.qb64.net/forum/index.php?topic=6388.0

>As for it being an informal or hobbyist language, if one begins by designing the proper data structures and adds the adequate functions to handle them, the resulting programs can be just as capable as those designed in any other language.

Well, that is exactly my point. Basic has the reputation of being easy for beginners and hobbyists but properly written code in a recent OOP dialect of Basic doesn't look too different from code written in any object-oriented Algol-derived language. As such, it is probably about as easy/as hard to write. Which is what makes me suspect that Basic-the-language might not really be the secret sauce of environments like QB64 or Blitz3D. Other possible reasons they get the sort of following they do could be that

1. Those environments are easy to install and create your first project with.

2. They start you with an IDE, so compiling and running your first code is only a matter of pressing a single key or clicking a single button.

3. They ship a "fun-oriented" standard library. You don't have to install any addition packages or even import extra modules into your project to access subroutines for plotting, sprite graphics, sound, 3D, networking, etc.

4. They have high-quality, beginner-friendly documentation with plentiful examples.

5. They are fast, both the IDEs and the runtimes.

6. (A language-related one.) Somewhat surprisingly, they are more often that not statically typed and offer decent error messages. Perhaps compile-time errors are a better educational tool than runtime errors.

I am not sure how important it is to have all of the above points but 1-3 seem crucial.

The secret is indeed the traditional tight integration of IDEs + Documentation + Ease of compilation and deployment of code. I'd say the first 5 points are absolutely crucial to the success of good BASIC coding environments and more languages should offer the same.
I think a great example of a non-Basic language that succeeded because of 1-6 is Turbo Pascal. Its documentation was thorough enough that you could learn and use the language and its many libraries without external references (except, perhaps, to get you started).

Going with Basic instead of a different language for your IDE can be a good choice for another reason. It is, or at least was, good for marketing to people who write code but don't consider themselves developers. To the potential buyer of the IDE using Basic signals, "this is a friendly environment; we don't expect you to be a grizzled professional programmer". (This may not work today. The latest product from Blitz Research is called "Monkey" and REALbasic was renamed "Xojo" in 2010, both apparently for marketing reasons. The company behind Xojo described theirs at http://www.xojo.com/support/faq_xojonew.php)