PHP or Bust
I haven't done any programming since I dropped out of college (early 90s). Back then, the only languages I knew in depth were BASIC & COMAL.
What is a good language for writing programs to work through fairly simple algorithms? I'd be mainly looking to calculate odds and probabilities, nothing fancy, I don't care how it looks.
I assume I can get the relevant book at the library. I'm running XP, what exactly will I need to do to get started? What software will I need to buy, and how much approx?
Grateful for any advice, thanks.
If you have a web site, I would recommend PHP. And it's free to get and royalty free to use and most web hosts support it. There are countless PHP tutorial sites on the web - no need to buy PHP books unless you want to.
In fact, this forum we are using was written in PHP.
I'm addicted to PHP. For years I wrote PC software in C, C++, Java, Visual BASIC and several other versions of BASIC, but the programs would only run on Windows. Java was too low level for my needs and the learning curve was too high.
If you are running XP (other than the home edition) you should have a web server on your CD called IIS (Internet Information Services). You can then install PHP to run on the web server. Then you can write and test your programs locally and when done, put your programs on the web for all to use with their browsers.
PHP is not severely difficult to learn. It can be frustrating at first, like any new language until you learn to master it, but it is not too difficult.
The main reason I like it is because PHP can create programs that run on the web or locally, so that you can share your programs with the world without needing any special browser add-ons or any particular operating system. Anyone with a standard web browser can run the programs because it's platform independent. People running Windows or LINUX or MACs, etc. can run the programs equally well.
As a simple example, here's a link to one of the web sites I programmed in PHP. It gives some idea what PHP can do on the web.
http://www.neoprogrammics.com/astronomy/
It performs high-precision astronomical computations, but that's only scratching the surface of its potential.
I can do numerical calculus, trig and all sorts of high-level math, even relativity computations, which is another important reason why I adopted it - I'm heavily involved in math and science, especially physics.
For example, you can do arbitrary precision arithmetic to any number of decimals, even into the thousands of decimals if you wish.
If I wanted the square root of 2 to 100 decimals:
The PHP program code
print bcSqRt("2", 100);
would print the result
1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727
For more normal computations, PHP contains all the essential math and trig and log functions too.
I also have PHP installed on a web server running on my PC so I can run PHP programs locally as well.
Millions of web sites use PHP.
With PHP, you are not restricted to any one specific operating system.