Jump to content
IGNORED

Is there a BASIC <> Python reference guide (like a PDF)


Marius

Recommended Posts

Hi all,

 

If one would like to learn Python and one comes from Atari 8bit it would be handy if there was a list of the Atari Basic commands and their python equivalents.

 

Does such a list exist?

 

And if yes, can someone point me in the right direction? Thanks!

 

Marius

Link to comment
Share on other sites

I don't think you'll find one as such. The two languages are very different. It might be better to take it on a functionality basis and google for things like:

etc. There really isn't a one to one mapping as far as individual keywords go. A good place to start would maybe be https://www.python.org/about/gettingstarted/

 

 

 

  • Like 2
Link to comment
Share on other sites

7 minutes ago, TGB1718 said:

Python 👎🏾    :)

 

Why is that? Do you have a better advice for me?

 

I have (quite some) experience with Atari Basic, Turbo Basic and Assembler (6502). So what is a logical step to do some coding on Mac/PC?

 

Edited by Marius
Link to comment
Share on other sites

50 minutes ago, danwinslow said:

I don't think you'll find one as such. The two languages are very different. It might be better to take it on a functionality basis and google for things like:

etc. There really isn't a one to one mapping as far as individual keywords go. A good place to start would maybe be https://www.python.org/about/gettingstarted/

 

 

 

Thank you so much! I thought it would make sense for people who know basic, to have some documentation where you can see how the commands you are so used to, are described in Python.

 

I think I should study some simple Python programs. That is more my way of learning. The links you send look very useful. Thanks. 

 

If you have other good suggestions for me, please let me know. I am all ear!

Link to comment
Share on other sites

Python is ok, but it depends on what you want to do. It's really good at manipulating large arrays of data, and it's a great 'glue' language to script infrastructure bits together. It has a really large ecosystem of libraries, and is used for a lot of scientific and AI/ML work. That said, I don't like it much from a formal language perspective, it is at heart a script language and suffers from the usual oddities. A good next language for you might be pascal or C, both are available on the Atari. If you want employment as a developer then C++, Java, or javascript would be a way forward. If you use Windows then C#/.Net is a nice environment.

  • Like 2
Link to comment
Share on other sites

https://theswissbay.ch/pdf/Gentoomen Library/Programming/Python/Thinking in Python (Bruce Eckel%2C Rev 0.1.2) - 2001.pdf
https://github.com/BruceEckel/ThinkingInPython

You do need to think in new patterns.
Eg, the FOR loop is usually the wrong way to do it in python.
Basic is a very old style language and simplistic.
We have made vast improvements in newer languages.

 

Far from being a beginner's language, I've see it used as a substitute for MatLab (ie maths heavy stuff), as a string processor (eg generating C/C++ code from small config files), an application download manager and real-time management of vehicles on mining sites.
Comparing equivalent algorithms in C/C++ code and python code, the Python code is far simpler, far more natural and far easier to understand/modify.

 

Admittedly, speed is not its forte - but same issue for Basic.
And it is memory hungry - ruling out most 8-bit systems.

Link to comment
Share on other sites

Well, I don't know about 'more natural'...depends on what you are used to. To me, some of the syntax in python is extremely unnatural.

But all modern languages suffer from what I call 'complexity poisoning' - they've had so many things added over the years to be 'more powerful' that now they are just unwieldy. Plus, devs seem to feel that if a language has a feature, then by god they are going to use it, needed or not.

 

Development used to be viewed as an engineering discipline...write simply, write clearly, do only what is needed. If you add complexity, have a good reason that you can explain to a user of your product.

 

  • Like 1
Link to comment
Share on other sites

19 hours ago, danwinslow said:

Python is ok, but it depends on what you want to do. It's really good at manipulating large arrays of data, and it's a great 'glue' language to script infrastructure bits together. It has a really large ecosystem of libraries, and is used for a lot of scientific and AI/ML work. That said, I don't like it much from a formal language perspective, it is at heart a script language and suffers from the usual oddities. A good next language for you might be pascal or C, both are available on the Atari. If you want employment as a developer then C++, Java, or javascript would be a way forward. If you use Windows then C#/.Net is a nice environment.

Well... 

 

I would lie if I said that I am just wanting to do some hobby coding. I am a professional musician and educator, and yes I would like to develop an app, or perhaps a web-app where students can learn music stuff, and perhaps in the far future I hope to create something to make a little money with (next to my paid job). But that is only in the far future.

 

If you think that Python is most definitely not suitable to create an app (for a smartphone, or for a website) then I should pick a different coding language. If it might be possible with python, it might be a good choice for me.

 

Can you see what language is used to create this:

 

www.playxylo.com

 

That is pretty cool, and one can even download it as an app for offline use. I would love to create such things.

 

I am very grateful for all the support and help I get here on the AtariAge forum. It is always a pleasure to read all the comments. People are really sharing their points of view, which are very educational for me.

 

 

Link to comment
Share on other sites

2 hours ago, Marius said:

Well... 

 

I would lie if I said that I am just wanting to do some hobby coding. I am a professional musician and educator, and yes I would like to develop an app, or perhaps a web-app where students can learn music stuff, and perhaps in the far future I hope to create something to make a little money with (next to my paid job). But that is only in the far future.

 

If you think that Python is most definitely not suitable to create an app (for a smartphone, or for a website) then I should pick a different coding language. If it might be possible with python, it might be a good choice for me.

 

Can you see what language is used to create this:

 

www.playxylo.com

 

That is pretty cool, and one can even download it as an app for offline use. I would love to create such things.

 

I am very grateful for all the support and help I get here on the AtariAge forum. It is always a pleasure to read all the comments. People are really sharing their points of view, which are very educational for me.

For something like the linked to site you need to master HTML5, CSS and JavaScript.

 

As for Python, it indeed garnered way too many features. And indentation is part of the syntax (!) which is why I severely dislike it. It's pretty easy though to get a basic understanding and it has a lot of bindings to C/C++ libraries for speed and UI development.

 

If you want to create an Android app, learn Java and the Android SDK.

 

If you want to create a cross-platform application, I'd recommend C++ and a cross-platform GUI toolkit like Qt5/6, but there are a ton of others. qtcreator can also cross-compile for a lot of architectures, including Windows, macOS, Linux and Android. Better not lock yourself to Windows only ;)

Edited by ivop
Link to comment
Share on other sites

Coming from BASIC there will be a few "culture shocks" going into Python:

 

1) obviously there's no line numbers, but Python is extremely sensitive to indentation,   it one line is indented with spaces and another is indented with tabs it may look correct to the programmer but fail.   This catches me up all the time because editors will sometimes insert tabs where I didn't intend them.   I also come from languages like C/Pascal where loops and code blocks are marked with curly brackets or BEGIN / END .  Indentation is recommended but not enforced.    if I put two statements on one line, or indentations don't 100% line up, the code still runs.  So I find this aspect of Python takes a bit getting used to.

 

2) Python is very library-oriented.    So you will find there are multiple ways of doing what you want to do depending on which libraries you include.   Even simple stuff like reading files.

 

1 hour ago, Marius said:

If you think that Python is most definitely not suitable to create an app (for a smartphone, or for a website) then I should pick a different coding language. If it might be possible with python, it might be a good choice for me.

Web sites are coded in HTML + Javascript,   Android apps are usually coded in Java and iPhone apps are coded in Swift or Objective-C.   So Python isn't necessarily the top choice here.   However there are a lot of app frameworks that will help you generate apps for the above and maybe use python in the process.

Link to comment
Share on other sites

Yeah, the indentation thing is one of the nits I have with the language. But, I mean, python is perfectly fine for writing most non-web applications as long as you don't want super performance. playxlo.com looks like a typical javascript web site, as was mentioned. 

Modern dev, especially web stuff, is way more complicated than good old basic on an 8 bit. Anywhere you go you will have to get past a lot of complications, one of the biggest being the user interface.

 

Since you like the playxlo example, try some web development with javascript, css, and HTML. All that is really doing is drawing some pictures to the web page and handling click events by playing an mp3. Get a book or take a course and have fun. If you want a desktop app, then python is fine, you'll just have to deal with picking a suitable UI library. QT, as mentioned, is a good start but there are others.

Link to comment
Share on other sites

On 1/29/2023 at 5:04 PM, Marius said:

Why is that? Do you have a better advice for me?

 

I have (quite some) experience with Atari Basic, Turbo Basic and Assembler (6502). So what is a logical step to do some coding on Mac/PC?

 

Python is one of the more logical steps, given your background. Python, like BASIC is meant for beginners and doesn't have a steep learning curve. There are similarities with BASIC. However, I would simply learn Python from scratch. While doing so, you will find familiar concepts as you go. 

  • Like 1
Link to comment
Share on other sites

6 minutes ago, baktra said:

Python is one of the more logical steps, given your background. Python, like BASIC is meant for beginners and doesn't have a steep learning curve. There are similarities with BASIC. However, I would simply learn Python from scratch. While doing so, you will find familiar concepts as you go. 

I believe Python is also the most popular programming language in the world these days, so that makes learning it a little easier..  there are plenty of examples online to do anything you might think of.

  • Like 1
Link to comment
Share on other sites

I think my issue with Python other than the indent thing 🙃 is that there seems to be a big push

to get people new to programming and younger people into it almost to the exclusion of all

other languages.

 

As an example, I have several Raspberry Pi's and their magazine almost exclusively has all programming

examples and projects in Python, occasionally they give a little C and some RP2040 machine code but it's

not a fair balance especially as it's Linux based and C is pretty much built in and native to Linux/Unix.

Link to comment
Share on other sites

Python strangles the medulla oblongata and mindless zombies result. Twisted which way books of bloated code ensue. It is a pile of moving coils with snake like and circuitous iterative babbling forked brooks of runaway spawn. Remember when everyone was forced to program in BASIC? Python is worse, it just sounds cooler.

 

A bazzillion bullshit libraries full of security holes, you have to know the libraries better than the damn language. F*ck Python.

But hey what do I know, I know I won't be using Python, That I know. So popular, just like zombie movies, it eats brains.

Edited by _The Doctor__
  • Haha 4
Link to comment
Share on other sites

Python is handy, interpreted so no linking mysteries (although there can be DLL hell involved), and it's available on smaller platforms and architectures. That's part of the reason it's around so much. Nobody is writing really serious back-end applications or high performance games in it, though. It's fine for what you need.

 

There's really nothing one way or the other that's special about it, it's just a tool, does some things better than others. The syntax is kinda funky but not overly weird. You can learn some object oriented programming with it too, although that's not it's strong point. Just start!

Edited by danwinslow
Link to comment
Share on other sites

I found the ability to try out commands and their results in a shell rather than having to compile everything and look at results or a debugger quite nice (as my programming habits were formed with BASIC). I need to learn a bit more Python to do some data analysis on the job. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...