Hello,

I am thinking about teaching my students JavaScript first so that they can start creating websites and make their career, what are your thoughts?

  • traxex@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    4 hours ago

    C teaches a whole variety of low level concepts that are helpful in any comp sci field. That’s my vote. Python holds your hand too much and JS would require more to get started. If they aren’t shooting for a comp sci degree and are just looking for helpful scripts then python would be fine.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 hours ago

    As a first language, JS is too much. They would need to learn three languages to make websites (JS, CSS, and HTML).

    I’d start with Python. It’s easy to learn, and modern Python gives you the tools to write code that’s easy to read and follow without being too verbose.

    uv should make things very easy to setup too. Install uv, then give them a starter repo with the Python version set. uv run should just work after that, no manual venv/conda/etc nonsense involved.

  • Sivecano@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    8 hours ago

    I mean, they’ll probably learn more from C. But please. You can do better than javascript. At least teach them python or something.

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    10 hours ago

    I would teach Typescript. Being able to write the types down and hover things to see what types they are will definitely help them.

    I think C would put them off. I also wouldn’t go with Python, in case they want to do things like write games or make websites, which are common tasks you can do with Typescript but not very well with Python.

  • Daedskin@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    16 hours ago

    Like a lot of people mentioned, there’s a few good things you could start with, but C is probably not one of them. At my old job I ran a course for software engineer 2s to go over C, and even they had some struggles with it. If professional engineers struggle with C, it’s maybe not the best starting point. Even C++ might be better, but still adds a lot of complexity that isn’t necessary to know as immediately as the beginning.

    Whenever people ask me where to start, I say python. It gives you a relatively tame taste of environment setup, and can run code very easily and flexibly. Its type system is flexible enough to make a user aware of it, without it being as rigid as C or as vague as javascript. Because there’s enough libraries that are easy to pull in, even a beginner can start building useful programs without having to know how to build something equivalent to those libraries themselves.

    Obviously if you want them to make websites, javascript will be necessary eventually, and isn’t a bad place to start. If you’re going purely for CS knowledge, I do think python is a little better; going from python to JS is probably easier than JS to python.

  • lorty@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    16 hours ago

    The fact that every computer has a browser where they can practice javascript probably makes it the better option. Python would probably require, on Windows, some setup that isn’t what you want to spend time on, and may be a barrier to them trying stuff on their own time at home.

  • Anaeijon@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    18 hours ago

    Depends in the goal.

    If they are interested in Hardware, there is no better solution, than buying a hand full of cheap, “knock-off” Arduino Nano or RP2040 boards, a couple of LEDs and resistors and then let them Experiment with Arduino C, which teaches C programming in a fun and meaningful manner.

    If they should get actual useful skill, start with Python. It’s easy to learn. It’s widely used for small, single-person projects, e.g. for gathering and analyzing data, running simulations, organizing something, interacting with APIs…

    For any project, where I’d say, that it can be done quickly by a single person quickly on the side, Python is usually the best option. Even for experienced programmers. But especially for people that are new to programming or learning. It’s easy, approachable and (because everything is handled by some library) quite safe to work with.

    It’s by far the most useful language for anyone that isn’t a full software developer. And it’s among the easiest to learn.

    Also, when teaching Python, consider teaching with Jupyer documents. It immediately shows, what the short block of code is doing, instead of writing a huge and long script file, then executing it and struggling with debugging where students might not even know, how to start. An easy to host solution to supply Jupyer to a whole class is JupyterHub. If you aren’t concerned about your students data, Google Colab is a JupyterHub for free.

    And now, finally, if you want a course that has some practical use (e.g. data analysis and math stuff) while also doing fun things and being incredibly interactive because of the use of hardware… Well… It’s python again.

    Let them write a short branching story using Ren’Py. It’s easy and will get them engaged. Go on and switch to Jupyter/Colab and do a bit of data scraping, data analysis/math or image filters. Basically introduce numpy, then pandas, then scipy, beautiful soup or openCV. Pure hard skills, that are applicable in many jobs. But realistically, due to time constraints in normal courses, all you want to do here, is numpy to get into it and automate math homework, followed by pandas, to load and automate excel files. And finally, let them do something with hardware, by programming a RP2040 in microPython. It’s not as widely adopted as the Arduino ecosystem, but it’s good enough for the simple stuff students will be able to learn, and you don’t have to introduce a completely different language.

  • communism@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    19 hours ago

    Without knowing anything about your students, it’s hard to say. If I were the student I’d much prefer to be taught C, but that’s because I have an existing interest in computers and a desire to develop systems programming skills. I wouldn’t like to teach JS to anyone because it’s a bad language and I don’t want students to go away making more web 3 slop but if they actively are interested in making web 3 slop that’d be a case for teaching JS. I’m of the pedagogical school of teaching students what they are actually interested in learning. They might not know enough about programming to know which language they want to learn off the bat, but maybe ask them what sort of software they’re interested in making. If they want to make websites, you might want to teach them something like Python with Flask, as something less bad than JS as well as easy enough to learn.

    Imo C is a good teaching language as it teaches you a lot about how computers work, as well as the fact that nearly everything runs on C. It is “harder” though, and imo is also for students who are actually interested.

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    19 hours ago

    I would start with Python. It’s a fun language to learn, and generally recommended for beginners. Towards the end, I would spend a few sessions on c, not to teach them c but to give them an appreciation for what they get for free in higher level languages.

  • jtrek@startrek.website
    link
    fedilink
    arrow-up
    0
    ·
    20 hours ago

    Javascript is a horrible language, but it is ubiquitous. You’ll want to spend a little time on html and css if you expect them to do more than print output.

    You could focus on TypeScript, which will help them avoid some of the worst things, but then you spend more time on tooling and it won’t just run in the browser console.

    Python is a reasonably popular language with a good standard library. It has fewer bizarre quirks like adding two lists of ints together to get a string.

    I wouldn’t teach C to a general audience.

  • Cryxtalix@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    20 hours ago

    No way it’s C. The average student will go home and find that they can’t do much of anything they like, with the level of C they know. Even printing a string is famously hard in C, they’ll hate it.

    The average students wants to build games, websites, discord bots etc. Javascript makes it easy, none are easy in C.

      • Cryxtalix@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        16 hours ago

        Yeah it’s not for the students! OP even specifically said they aren’t CS students.

        Now start doing concatenation, splitting, replacements, char/string/integer conversions, something as simple as returning a string from a function etc. Students will start banging their heads against a wall, a wall that can only be overcome by studying the intricacies of memory management, pointers and char encodings. They will not be producing results for a very long time.

        I have no reason to believe this is remotely interesting to non-CS students. Even for CS students, most opt to work in higher abstraction levels given the option.

        • Flamekebab@piefed.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          15 hours ago

          I’m glad someone is saying it. I’m a software engineer and someone elsewhere in this thread is giving me shit for not having much use for the low level stuff.

          I was teaching a junior about character encoding a couple of months ago (I suspect his CS degree came free in a box of cereal) but most of what we do is build tooling on top of other tooling. I’m not working on bare metal here!

    • thehairguy@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      17 hours ago

      +1 to scratch, I’ve used it to both teach kids at one of those “stem summer camps” and adults who do recruiting for tech firms. Both groups were able to pick it up pretty quickly

  • grue@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    20 hours ago

    Neither. Teach them Scheme. They need to start by building good habits (functional programming).

    “Learn the rules like a pro, so you can break them like an artist.” ― Pablo Picasso

  • MonkderVierte@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    21 hours ago

    Python. They’ll only learn bad patterns from JS. Please teach bottom-up knowledge, not top-down narrow scope.