Alternatives to VBA or CPP?

Back to General discussions forum

moxieman     2023-12-12 14:57:24
User avatar

Hello. I got a banner notification this morning saying "There is nothing bad about VBA or CPP, but do not hesitate to ask at forum for hints about other options!". So here I am doing that.

I have never taken an actual programming course, although I have taught myself various languages such as C++ (I use it on ESP32's), MatLab, Mathematica, BASIC, etc (anything can be learned online nowadays). But at the moment I no longer have access to software like MatLab or Mathematica, and it's a bit of a silly hassle to carry microprocessors around with me if I want to solve some programming puzzles, so for now I'm using VBA for excel.

This works fine enough since it has all the functionality of a language, but it certainly is slower than C++, probably around 10% of the speed. However I don't know how to actually get code to compile on my machine otherwise. I've seen people get C++ or other things like java/python run standalone on their PC, but I could never figure it out. And as I said nobody has ever taught me so I have nobody to ask to show me how. I'd also be fine with running just C++ on the PC. At this point I would kill for some ++, -=, += type operators.

So is it actually a simple process that I am overcomplicating for myself? I feel like a child who's taught himself how to ride a bike but can't figure out how to build one himself, hah.

Rodion (admin)     2023-12-12 17:10:50
User avatar

Hi Friend!

sorry for this silly-looking banner, it's the only way I can send brief notifications personally - just felt inclined to after reading your page.

It would be better of course to wait for some of our gurus to advice - I know many of them use Python, but whether they install it in console-only mode (like me) or use some Anaconda / Jupyther (how we spell it?) - I don't know. Meanwhile my meek ideas on the topic.

I no longer have access to software like MatLab

If you miss it, Octave is the free and compatible alternative (you can try it without downloading by googling something like "octave online").

run standalone on their PC, but I could never figure it out

I suspect if you download Python as is (under Windows?), it is possible to run it either in console (black window full of text magic), or it also includes some simple environment called IDLE. Regretfully I don't use it - just learnt of it from one of the participants here. Most probably you can try it either directly or with help of some youtube and ask if any issues.

Python includes += operations and in other regards is closer in its easiness to Basic (which I still love tenderly). It also has tough magic tricks useful in solving problems, but it may take time to learn them all (I usually learn from others' solutions).

As about C++ check whether Visual C++ is free (I guess it is) and download this monster - you should get ready environment unless I'm much mistaken. I'm pretty sure the alternative with GCC is possible but generally without environment.

On the other hand if you use some language without environment, it's just a matter of downloading some Notepad++ or similar advanced editor - and learn a couple commands to launch your programs from console.

Last but not least, I'm clumsily trying to create a set of lessons on Lua language, with interactive online playground - check the "School" at menu - it won't take much time to decide whether it looks promising to you.

gardengnome     2023-12-12 18:47:19
User avatar

I personally use Integrated Development Environments, short IDEs, for both Python and Java: PyCharm and IntelliJ. There are free community versions and they come with straightforward installers.

An interesting alternative are online compilers such as ideone where you have a wide choice of languages; all you need is a web browser.

qwerty     2023-12-12 19:14:52

And there are a lot of options for you if you have a mobile phone!

For example, it is possible to install Pydroid from Google Play and use it to write, run and debug Python programs. It is not free, though (shows advertisements if you don't pay).

It is also possible to write C++ or Visual Basic programs on phone. I dicovered Termux when I was trying to run several Haskell programs on my phone, and it turned out that Termux is very versatile thing! Compiler for C++ can be installed with command:

pkg install clang

For Haskell and Visual Basic, you need to dig deeper and install Ubuntu over Termux, then:

proot-distro login ubuntu

...to login into Ubuntu and:

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

...for Haskell, or:

sudo apt install mono-complete

...to write Visual Basic (or, to be more precise, Visual Basic .NET) programs.

Of course, there may be some difficulties during the installation, which are not covered in manuals, so you may need to google additional material. This is why I mentioned Pydroid first, it is probably the simpliest option if you want to get started with development on mobile phone quickly.

qwerty     2023-12-12 19:37:07

By the way, I have a question too, if anyone knows. Is there any easy way to send data from Ubuntu inside Termux to my phone? I found a way to send data from Termux to phone, but not from Ubuntu inside Termux.

For now, I use pastebin.com as workaround, but this requires internet connection and a lot of different actions.

Rodion (admin)     2023-12-12 20:22:11
User avatar

never heard of this :o probably it may be a bit overkill for person not well acquainted with the matter :) do you mean their Sharing data or it is what you already found?

qwerty     2023-12-12 21:02:02

Yeah, this is what I mean when said that I found a way to send data from Termux to phone.

But there is an another level of virtualization, which emulates Ubuntu inside Termux, and manuals does not cover what to do in that case. So I use pastebin.com as workaround so far: "Dear Mr/Mrs postman, please take my letter and deliver it to my neighbour which lives in flat next door to me".

moxieman     2023-12-13 16:38:34
User avatar

This is all awesome and helpful information! Thank you all very much. I'm excited to start digging into this when I get home tonight.

moxieman     2023-12-14 02:48:35
User avatar

And not to doublepost, but...

Goodness gracious this site has such character and personality that you don't get on many websites anymore. From the hand-drawn doodles randomly flying around, community ranking system, and neat random links up in the corner, to the admins actually reading profiles of new users, sending you banner messages offering help because PMs aren't a thing, then having the #1 ranked user on the site chime in a tip as well.

I feel like I've gone back in time to a friendlier and quirkier past. And on top of that, there's some cool programming puzzles too. Love it.

Rodion (admin)     2023-12-14 19:21:22
User avatar

Hi Friend! Thanks a lot for your kind words :) Really the interface is a bit clumsy and outdated, but perhaps at some point it will look "vintage" so I'm reluctant to attempt serious changes. Moreover I'm more backend programmer and my "UI skills" are limited.

As for "admins reading profiles" - actually you see there are currently not that many visitors :) so when your name was hovering in the top of the "best of the week" on the main page, I naturally looked into out of curiousity (and also there are sometimes issue with poor students from some countries throwing into tons of copied solutions). I was amused to found solutions in VB - partly because it reminded me of one of our gurus, mostly active in the first years of the site's life - Guy Gervais from Canada unless I'm mistaken.

As for our grandmasters - I dare compare them with good spirits of the place - numerous hints about the improvements, constant help at forum - and quite a handful of advanced problems (about half of them I can't solve myself). Just there is some controversy who may really be #1 since they are chivalriously reluctant to submit solutions to the problems they authored. I guess they predictably do not care much about being so cool (but we care!)

Ah, yes, about this:

so I won't get penalized for forgetting to include them

it is not rare for people to use even some things from 3rd party libraries, so it is definitely not penalized. sometimes I'm quite surprised to find out that some very-cunning-problem was solved in 3 lines by knowing where to import useful function from :))) it's how programming may work nowadays

oezguery     2023-12-15 00:18:54
User avatar

Hi Moxieman,
it is very interesting what you wrote! This place is different. I am totally amazed that you can program with C++ using a microcomputer and use VBA in excel and BASIC to solve puzzles!! Keep up the good work.
I really would like help you set up your environment with any programming language you want to use. Please do not hesitate to write which language you want to use and in which operating system you are working. People in this forum will give you hints.

Please login and solve 5 problems to be able to post at forum