5 ms·
BASIC and QB really spoiled me. Whenever I encountered another language I would always have a few questions. 1. How do I generate random numbers (great for mak
by BeetleB 8y ago
BASIC and QB really spoiled me. Whenever I encountered another language I would always have a few questions.
1. How do I generate random numbers (great for making simple games)?
2. How do I get interactive input, including getting a single keypress without having to press ENTER (again, great for single games)
3. How do I draw graphics on the screen? Circles. Lines. Points.
With these three I made really fun programs as a kid about the age of this post's son.
The big languages in those days were C. C++ and Java. Doing these simple things was an incredible pain. I just cogent bring myself to go beyond (and I had not heard of Perl).
Then I took my first formal programming class in college. While it was a breeze, it was also incredibly unmotivating. I always felt if they started with these three things, an order of magnitude more people would do hobby software development.
- fwsgonzo 8y agoI have been a C/C++ programmer for over 10 years now, and coming from the same background as you, QBasic, I know just what you mean. The build and dependency systems for C/C++ are atrocious and not made for humans. The syntax is from a time when you didn't want your code to use up all your storage, and its been evolving slowly since. Unfortunately, nothing can fix the worst parts of either language short of starting over, and at this point, since we all know them well enough not to care, we are just stuck with them. Going to CppCon and watching the YT videos, all I see is an ever-increasing burden on the programmer to know obscure facts and the current trends to correctly write "modern" C++. I will stop myself before getting to the template meta-programming language hidden away, that no one tells you about before its too late. :) At the very least C has a consistent calling convention per architecture. C really just needs a better standard library, from scratch, and it could be the modern BASIC with worse syntax. Might as well mention, I have used FreeBASIC before and its quite good and very mature. It generates C/C++ code (I don't remember the details) and compiles using GCC! If the compiler can generate standard C/C++ code, there is good reason to believe the project could be maintained forever and compete with other languages.
- wruza 8y agoI don’t think that syntax is important here. What your parent commenter says is that he misses INKEY and SCREEN/LINE features out of box. Fun thing is that old Borland C and Watcom C (iirc) had these functions and modes too. getkey/kbhit for inkey and initgraph() from bgi/watcom variant for screen drawing. Modern environments do not allow to simply draw or listen to keys, it is so boring.
- Something1234 8y agoJavaScript's key event listeners, but those are a complete and utter pain. Canvas is also somewhat nice once you figure out how to work with it. I still don't completely understand the ideas behind it. There seems to be a specific paradigm behind it that none of the tutorials I've gone through have shown me.
- drivers99 8y agoI couldn’t do the key input thing in BASIC for MS-DOS. I remember having to set the F keys to macros that would enter something for me. Maybe I just couldnt figure out the right command. Check out PyGame for instance to do all that on current systems. That’s what I’ve used lately.
- megaman22 8y agoPyGame is probably the closest I have found to the ease of use of old QBasic, for simple graphics. Almost everything else that you use makes you proxy through some sort of OpenGL-esque abstraction, that makes 2D graphics far harder than they ought to be.
- LocalH 8y agoYou were probably using GW-BASIC instead of QBasic.
- drivers99 8y agoParent post said "BASIC and QB..." that's why I specified "BASIC for MS-DOS". I guess that was ambiguous. Technically I was using BASICA.COM (Advanced Basic on PC-DOS which relied on BASIC subroutines stored in ROM, which only IBM PCs, not compatibles, had) not GW-Basic which is what MS-DOS used, which had all the routines in the executable which loaded into RAM, and ended up running programs faster.
- cableshaft 8y agoPICO-8, which the parent article only name dropped without explaining why he felt it wasn't adequate, has these things you're talking built in, and was designed with making simple games specifically. The editor has a built in sprite, level, and music editor, and you can also download any game and then enter edit mode to see what code it used, just like I did with QBasic games as a kid. It's not exactly as easy as QBasic, since it's based on LUA syntax, but it's pretty darn close that I don't think it should be ruled out. It's the closest thing since Adobe Flash that gave me a similar feeling to making games in QBasic.
- vanderZwan 8y agoHave you given Processing or it's JS offspring p5js a shot? https://processing.org/ https://processing.org/ https://p5js.org/ https://p5js.org/