I’m going to be delivering an online intro to programming session to a non-technical crowd who will be “following along at home”. Because it’s online, I can’t provide them with machines that are already set up with an appropriate development environment.

I’m familiar with Linuxes and BSDs but honestly have no idea how to get set up with programming stuff on Windows or macOS which presumably most of these people will use, so I need something I can easily instruct them on how to install, and has good cross-platform support so that a basic programming lesson will work on whatever OS the attendees are running. Remember they are non-technical so may need more guidance on installation, so it should be something that is easy to explain.

My ideas:

  • C: surely every OS comes with a C compiler pre-installed? I know C code is more platform-specific, but for basic “intro to programming” programs it should be pretty much the same. I think it’s a better language for teaching as you can teach them more about how the computer actually works, and can introduce them to concepts about memory and types that can be obscured by more high-level languages.

  • Python: popular for teaching programming, for the reasons above I’d prefer not to use Python because using e.g. C allows me to teach them more about how the computer works. You could code in Python and never mention types for instance. Rmemeber this is only an intro session so we’re not doing a full course. But Python is probably easy to install on a lot of OSes? And of course easy to program in too.

  • Java: good cross-platform support, allows for teaching about types. Maybe a good compromise between the benefits outlined above for C and Python?

Any opinions?

  • GnuLinuxDude@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    2 days ago

    Since you said non-technical I definitely recommend Python. It is easy to install and easy to get going with. It is feature ful. It is generous. You can do really interesting things without sweating details like pointers and segfaults.

    If this was a technically minded crowd, especially students like in high school and in person, I would have said C

  • comfy@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 days ago

    If there’s no specific use-case (this is a general introduction, not Intro to Operating System Design) and this isn’t academic Computer Science teaching, then certainly a scripting language.

    Easy to learn, easy to use, and much more applicable for simple automation that benefits the people learning.

    C is dangerous if someone doesn’t take care. Java is verbose and personally I didn’t enjoy it one bit. You said this is a non-technical crowd and you expect them to follow at home.

  • lefixxx@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    python or lua

    i loved learning on lua, it is a little better to learn than python (less keyword, “end” instead of }, 1-index, less types) but python is waaay more prominent

    • Machinist@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 days ago

      Second on Scratch. Then Python or Java.

      (Pretty sure windows doesn’t come with any compilers anymore. Even if it did, it lacks an ide.)

  • HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 days ago

    I need something I can easily instruct them on how to install, and has good cross-platform support so that a basic programming lesson will work on whatever OS the attendees are running. Remember they are non-technical so may need more guidance on installation, so it should be something that is easy to explain.

    Honestly, as much as I personally despise it as a language and as much as you probably shouldn’t use it for large applications, JavaScript.

    If ease of setup and platform compatibility are your absolute top priorities, nothing beats it. Every mainstream OS runs JavaScript, and it’s already pre-installed in the form of a web browser. On any desktop system (and even mobile systems with some effort) you can use any text editor to write an HTML file with inline JavaScript and run it by just clicking it.

    Python, the next best option IMO, still requires knowledge of how to use the command line, and on Windows, requires installation that is slightly more involved than installing a regular program (adding it to your PATH, etc). Python for beginners are also limited mostly to console apps, and making a GUI is much more difficult especially for new programmers. Again, you’d first have to teach them what a console even is and how it’s actually still used by developers and is not a relic of the DOS days (something I’ve noticed non technical people tend to assume, they think GUIs made consoles obsolete). JS on the other hand is literally made to create GUIs on the web, meaning they will be able to create the kinds of software they’re already used to interacting with, which is both easier for them to wrap their minds around and also more enticing. Someone with no technical experience might wrongly assume that a text only interface is like “training wheels” and what they’re learning doesn’t apply to “real” software.

    More importantly, they will be able to show off what they built to their friends, without needing them to install anything or send source code or executables which can get blocked by social media filters. Services like Netlify will host your static pages for free, making sharing their work as simple as posting a link. Having a GUI is even more important in this regard, so they don’t have to walk their friends through how to use a console app when they barely understand it themselves.

    JS in the browser also has the benefit of being in a sandbox, meaning they can’t easily interact with other parts of their computer like files or system configurations. This may seem like a disadvantage but for someone just learning what programming is, it’s reassuring that they can’t accidentally kill their OS or delete their files.

    However, keep in mind that JS is pretty infamous for teaching bad habits that will have to be un-learned when switching to other programming languages (and so does Python TBH, though to a much lesser extent). It really depends on what kind of developers you want them to be by the end of this. For people just looking to casually make some interesting software they can show off to their friends, JS is probably the easiest way to do it. If this is meant to be the start of a path toward becoming actual professional developers, Yogthos’s suggestion of Clojure or Scheme is probably better because those languages will teach much more rigorous programming and software design practices from day one.

  • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

    I would suggest taking a look at Scheme or Clojure for somebody who has no development experience. The big reasons being that these are high level languages so you can focus on learning the actual concepts without all the incidental complexity of imperative languages. Scheme in particular was designed as a teaching language. The other aspect is interactivity, Lisps have a tight integration between the editor and the REPL and you can evaluate functions as you write them. This is incredibly helpful for learning as you can write a function, send it for evaluation, and see the result immediately. So you can play with code and get an intuition for how things work.

  • Arcanoloth@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

    I’d be surprised if MS Windows came with a C compiler, tbh. But it’d be a bad choice for non-technical people anyway; it’s not exactly a user-friendly language…

    Python would’ve been my choice, but maybe also consider Lua (a lot of games include it as their scripting language, which might be an easy selling point for people)

  • bradboimler@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    3 days ago

    I suggest having your students install IntelliJ IDEA and using Java. A full blown IDE might be much but I can’t think of an easier way to install a JDK and an editor suited for it.

    • communism@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      3 days ago

      That might be a good idea actually. I think Java’s a good balance of demonstrating a variety of programming concepts (I think Python obscures too much that would be good to learn about for a beginner), and telling them to install IntelliJ should be straightforward enough without needing to babysit too much the install/setup process.

  • Ziggurat@jlai.lu
    link
    fedilink
    arrow-up
    2
    ·
    3 days ago

    What’s your target audience ? An what’s the goal ?

    There is a difference between Giving a programming training to scientist/engineer who may need more than just Excel for data-processing/visualisation, and giving a discovery what programming looks-like for a general public, or people who want to do their own website.

    For general public, the good-old “Logo” that kids learned programming with in the 70-90’s is still great

    for scientists engineer, I would go for python which is the de-facto standard for data visualisation/processing when performance doesn’t matter

    For a more foundation course, I think the everything is object approach in java can be pretty great

    • communism@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      3 days ago

      What’s your target audience ? An what’s the goal ?

      Good questions. The goal is not to make new programmers but mostly to satisfy curiosity and help people learn about how the world works, specifically how computers work, and to feel more confident around tech. It’s for a non-technical crowd. Mostly just to give them a taster/peek “under the hood”.

      • halfdane@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        3 days ago

        If it’s a nontechnical crowd with no intention of using this knowledge in the workplace for actual programming, I’d agree with the other poster who recommended scratch: it’s a visual, object oriented language, so there are hardly chances for typos, it’s designed for learning, it runs in the browser. It’s a great language for kids and older “first contacts”

  • jacksilver@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    Use Google Collab or another web hosted platform. If you’re unfamiliar Google Collab is a part of Google docs that you can run Jupyter Notebooks on (and it’s free). This avoids the need for anyone to install anything and means you can test materials in the same environment everyone will run against.

    Additionally, Jupyter notebooks makes it easy to add markdown, so instructions can be in stylized format and the students can run the cells over and over again to see how the output changes in real time.

    Lastly, I would lean towards python, but there are many different languages supported in Google Collab and similar web hosted tools.

  • presoak@lazysoci.al
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    3 days ago

    Python, definitely.

    It’s easy. Succinct. You can use any text editor. Has a huge community. Huge library.

  • BassTurd@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    3 days ago

    Python 100%. It’s the most human readable and easiest to pick up, especially for a non tech person. It’s easy to setup contrary to what I’ve read in the comments. Go to python.org install the latest version and that’s it. The downloader includes Idle so no other ide is required, but I’d consider vscode as well. Either watch an install video or better yet do it yourself before going to class.

    I think you need to highlight the differences between OSs when it comes to setup if you plan on having a mixed environment of systems. It will also affect the code you write, so to be thorough, you’ll need to cover those differences as well.

    Don’t go low level like C. These people will die the first time they have to compile in terminal.

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      2 days ago

      You should read the Python documentation for how many ways there are to set it up. It’s not easy. It might be easy for a pro, but for a beginner it will be a nightmare. Python’s own documentation is thousands of words long for how to get it running correctly, it’s the exact opposite of what you want for beginners. And no it’s most definitely not the most human readable. They call it Ruby Prose for a reason.

      I’m not here to have a flame war over Python vs other stuff, but I’ve used both professionally for over a decade. Python is good at stuff, but being human readable by beginners and having good tooling are not even in its ballpark. It has syntax unlike any other modern language and its tooling is shite. https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/

      • BassTurd@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        For a basic setup to learn hello world and basic if/then logic, it’s extremely simple to setup Python on Windows or Linux. For Windows, which I’m guessing every non technical viewer will be using, download the installer and hit next taking the default values. Open idle, type the very human readable, print(“hello world”). Save and press f5. That’s it no complicated setup.

        OP isn’t talking about teaching a lesson where any confusing syntax will come into play. They are giving an intro to programming class. That’s all about learning basic programming concepts which is done very easily in Python. You wouldn’t teach a non technical first time programmer a ternary operator or a list comprehension. You’d teach them:

        if a == 10: 
            print("a = 10")
        else: 
            print("a is not 10")
        

        and simple for loops

        for x in range(10):
            print(x)
        

        I don’t know about you, but to me that’s about as human readable as it gets. No imports required. No extra packages. Just default python install and copy paste and this will work.

        There are other languages with minimal setup that can be used. OP could go as far as basic JavaScript in JS fiddle so no setup would be required. The basics of JavaScript are also very easy to read compared to a language like C where explicit typing is required. That can be a difficult concept for people that have never even seen code before. Python and JavaScript soften that blow. Once the concepts of if/then, loops, and functions are grasped it’s much easier to pivot to other languages with more verbose syntax.

        I’m not here suggesting that Python is by any means the superior language of the universe, just that it’s a very good option to learn with for it’s entry level simplicity and syntax readability, which I’ve demonstrated.

  • tyler@programming.dev
    link
    fedilink
    arrow-up
    1
    arrow-down
    5
    ·
    3 days ago

    Absolutely do not use Python. It’s a nightmare to install on random computers and the majority of your time spent will be trying to get it working on everyone’s computer (that was my job at one point). As far as I remember, there isn’t a “good” C compiler that comes on windows and the one on Mac is missing some stuff.

    I’d go with Ruby, it’s dead simple to install on every OS, easy to teach and learn, and doesn’t work differently across OSes. There’s an installer for it for windows and it comes installed by default on Mac (or it did? Maybe they stopped that).