Ask HN: Do you program in Basic?
If so, what flavour of Basic? (PowerBasic, PureBasic, VB.NET, or some custom flavour)
What are your reasons for using Basic? Do you enjoy it? How do other developers react when you tell them you program in Basic?
What are your reasons for using Basic? Do you enjoy it? How do other developers react when you tell them you program in Basic?
85 comments
[ 3.9 ms ] story [ 242 ms ] threadIt is incredible easy to build a nice one screen application with not very a very complicated background logic. Normal people like a nice graphical interface with a few buttons, and with Classic VB you can create them very easily and iterate and customize the form.
My last big problem was that it doesn't have a build in sort function, so you can use a n^2 sort or write a good sorting function by hand :( . When the logic start to be not so easy, there begin to apear problems.
Now: 50% laziness and 50% don't want to migrate a few big projects that only need a tweak per year. If it ain't broke, don't fix it.
I guess a virtual machine with Windows 2000 and with VB6 is still smaller than the modern programming environments.
Then post on HN and Reddit and scream “ageism is rampant on our industry”.
Disclaimer: I’m 45.
VB6 had full support for native AOT compilation and creation of OCXs in pure VB code.
What it did differently to Pascal was that it allowed for lazy / inferred typing along with some transparent type conversation in places where the intention was obvious. However in VB once a variable is defined a type (either when defined or when assigned a value - depending on how the variable was defined) you couldn’t change it. Eg you cannot overwrite an integer with a string
Weirdly, despite being branded a toy language, this meant VB actually had one of the more sophisticated type systems out of the languages of that era because you had the laziness of languages like JS and PHP but without having the === et al kludge that some loosely typed languages need.
Perl is another language that frequently gets mocked but it’s eq vs == solution for differentiating between strings and numeric types is genius and again solves the whole type comparison problem that JavaScript has.
I loved “Option Explicit”. To the extent that it was almost always the first line I’d write for any new project, module and class.
I still think it's the most productive programming environment I've ever worked in, in terms of actually getting something built.
Since then, I've learned a lot more about programming, and I'm not sure I'd accept the compromises that VB makes any more.
Some of Borlands IDEs had the same power for prototyping by C++ and Delphi weren’t as great for rapid development (though I have nothing against those languages themselves).
The closest thing we have these days is Electron but I don’t think that even comes close to ease of development once you factor in the clusterfuck of a mess modern web development is.
Now, I think I'd be much more comfortable with the compromises that Delphi makes.
Problem solved :-)
I used to use it extensively (back when it was called REALbasic) and still occasionally dabble (i.e., tweaking apps I made awhile ago), but it's gotten much too expensive for hobbyist or "scratching my own itch" kinds of projects, which is a shame because I still love the language.
Almost every app I did was for either the Mac or Windows, but perhaps the main value prop of REALbasic/Xojo was how easy it was to write one app and have it run on both Mac & Windows. For small applications, it really did Just Work, which seemed kind of magical.
Back in the day basic was frowned upon - but I think these days the stigma is pretty much gone...
https://www.mikroe.com/mikrobasic-avr
https://www.mikroe.com/mikropascal-avr
They also have support for PIC, ARM, 8051, dsPIC, FT90.
https://en.wikipedia.org/wiki/BASIC_Stamp
http://learn.parallax.com/tutorials/language/pbasic
ic0nstrux (nee XGameStation) also had Basic support for their DYI games console
http://www.ic0nstrux.com/products/gaming-systems
But invariably, I do all my new programming in C.
The flavor of BASIC I used to use is North Star Disk BASIC, very similar to HP BASIC.
A few lines from an old project:
Naturally enough I call this "visual basic" ;)
I've not "seriously" programmed in BASIC for decades, but this was still enough to make me smile and feel nostalgic.
Sometimes it is easier to keep some data in Excel and then convert to JSON with a simple macro.
Despite BASIC's intent to be simplistic, I think that C-style syntax is more intuitive; moving to C# was a great step. Still, VB.NET felt like magic when I first used it, and VBA is still useful in working with MS-Office documents.
It's a tool like anything else, when it's the right one for the job it's worth using.
- VB.NET supports both static and dynamic typing.
- VB.NET is a functional language, supporting local type inference, anonymous functions, monads, and language integrated comonads.
- VB.NET does project-wide namespace imports. C# doesn't.
- I like creating native client apps, and dislike the constraints and fragility of web apps.
- I've always found the Java developer environment to be brittle in comparison.
There are also a metric ton of readability issues in JS, Java and C# that VB.NET doesn't have (braces, == and =, ! instead of Not, separate keywords for inheritance and interface implementation, and so on). I also concede that I learnt Pascal before learning C (and prefer Pascal to C). The fact that Pascal and VB.NET share syntactical similarities (type declarations follow variable and function names, the Not keyword is probably not an insignificant factor.
And to be fair none of the above matter – the rationale came long after the fact that I use BASIC simply because I like BASIC.
The amount of disapproval, verbal abuse, ridicule and actual anger I've received for this over the years (and to this day) is insane. But you learn to deal with it.
PS. Did you know that the first prototype of Nokia Maps for Windows Phone was written in VB.NET? Nokia didn't know either, because they had like zero Windows Phone skills at the time.
https://en.wikipedia.org/wiki/Blitz_BASIC
What I took from those years is that the best tools are those that let you hit the ground running.
Submitted a simplified version of it as part of my IT coursework in college and got top marks in the class. ;)
I still occasionally write some VBA macros.
Compiler output looks like this:
So far, I can compile Hammurabi, but I actually haven't written any BASIC programs myself yet (except some simple QBasic stuff in the last millennium).I get the games to compile from the old "101 BASIC Computer Games" book: http://vintage-basic.net/games.html
As info, I used Timex 2068 Basic, 48K Basic, GW-Basic, Turbo Basic, AMOS, GFA Basic, QBasic, QuickBasic and VB as well.
And yes, with the native code compiled versions of Basic it was even possible to do system level like programming back then.
So Basic has a special place for me, even if I barely used today.
Also ignore the naysayers about VB.NET vs VB6, there are plenty of features that are comparable, usually what was left behind were GW-Basic and QuickBasic compatibility features.
Just think that even F# doesn't have the amount of platform love that VB.NET enjoys on VS tooling.
I also use x86 asm, Rust, Racket, NewLisp, Scheme, C, Python, JavaScript and shell script (sed, Perl etc) for other clients and uses. Xojo lets me compile for Win, Mac, Linux from the same install, the syntax is delightfully simple to use and to teach. Performance beats interpreted languages (LLVM-based), it compiles to standalone bins that do not rely on .NET, unlike Visual Studio. When I need more power I simply embed a lisp (Chicken or NewLisp) as the provided FFI works well. I’m currently writing a new IDE for NewLisp with Xojo and it’s handling UTF8 like a champ.
Xojo is very mature and most of the bugs have been squashed long ago, I just wish it treated functions as first class citizens. Apart from that, for internal business apps and retail-quality Win/Mac UI apps, I honestly haven’t found anything more effective to go from prototype to binary quickly and painlessly.
It’s our secret weapon, and clients don’t care it isn’t mainstream. Now if one could come up with a similar IDE coupled with a lisp... DrRacket + MrEd come close, but for large projects it becomes a pain. Until then I’ll write basic code for basic business apps. For everything else, there’s a lisp.
https://www.xojo.com/resources/examples.php
So you cannot store a function in a variable (scalar, list, dict)?
And does it have dicts (Python term) or equivalent (associative arrays)?
If not, a lot of things would be more clunky to program, although possible.
I could also predict exactly how each line would be translated by the compiler, and that enabled interesting hacks and optimization techniques.
Kinda like Ruby, BASIC let you express what you want in an intuitive way rather than constantly try to work around the restrictions imposed by the language. There are many ways to do the same thing. None is good or bad.
When it comes to being fun, expressive and productive, Ruby is the only language that comes close to BASIC.
https://flashasm.wordpress.com/2015/11/04/more-incredibly-sl...
Why not change? I know the language so well, and have so many things I can reuse...ok...fear of change.
You can get pretty much anything done with classic ASP still though. Here are a few of my sites both done with only classic ASP server side.
http://www.dudeiwantthat.com/ https://stockdaddy.io/
Now, Jquery has moved some things I would previously do server side to client side, but these are basically classic ASP, SQL Server driven sites.