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
    8
    arrow-down
    1
    ·
    14 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.

  • Kache@lemmy.zip
    link
    fedilink
    arrow-up
    4
    ·
    15 hours ago

    What grade sudents is this for? Do you intend for this to be a dedicated class/semester or just a single unit? How good are they at operating a computer? (Typing, clicking, etc)

  • Sivecano@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    19 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
    7
    ·
    20 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.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        2 hours ago

        Python’s performance is too poor to do anything serious. Go and look at the screenshots from Pygame. They look like ZX Spectrum era games.

        Compare that to something like PixiJS.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    17 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.

  • abbadon420@sh.itjust.works
    link
    fedilink
    arrow-up
    68
    ·
    2 days ago

    If you also plan on teaching html and css, than I’d go for js first. Having your code instantly response in a visual way, is super motivating for most students.
    If you just want to tech programming concepts, i’d go for python.
    If you want this to be the start of a complete cs study, than you can start with C

    • ghodawalaaman@programming.devOP
      link
      fedilink
      arrow-up
      11
      arrow-down
      1
      ·
      1 day ago

      That makes sense, I am also teaching html amd css first so I think JavaScript makes sense to teach next.

      I was thinking about C because that’s the first thing I learned in the college and that’s my favorite language till this day.

      • chicken@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        11
        ·
        1 day ago

        The problem with C as a language for learning is that the error messages are not very specific or descriptive and often you need extra context to understand what is happening. Messing up memory management can result in inconsistent gremlin-like behavior from your programs, it can get very tricky. I had a pretty difficult time when I got to classes that taught C compared to other languages, but the main thing was just that I needed someone to look over my work and explain things to me because unlike with other languages, the self-service ways of figuring it out were much more difficult and it’s easier to get stuck with no idea what to look into next. I ended up begging people online for help with understanding what was going wrong with my programs to supplement the limited amount of time the professor and TAs were available, really grateful to those guys as I probably would have failed it otherwise.

        Anyway I would just say that if you do really want to go with C, I think you should be willing to put in more time to explain things to students one on one because many of them may need it.

      • Mirror Giraffe@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Good call. At this point the jankyness of js doesn’t pose a problem and the ones that get enticed will learn about type safety, classes etc down the line.

  • Daedskin@lemmy.zip
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    1 day 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.

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    1 day 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.

  • greenashura@sh.itjust.works
    link
    fedilink
    arrow-up
    35
    arrow-down
    5
    ·
    edit-2
    2 days ago

    Why not python? C needs constant memory management and JavaScript is too chaotic. Both seem to me a bit too complicated for someone just starting

    • ghodawalaaman@programming.devOP
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 day ago

      The main reason to not including python is that students aren’t particularly in the CS field, they are learning it as their “augmented skill” (I don’t know what it’s called bad English). That’s why I don’t want to force them to learn CS concept which they might not even need.

      I was thinking about C so that their fundamentals gets cleared but I think it will be too much for students who aren’t into CS. What do you think ?

      • BillyClark@piefed.social
        link
        fedilink
        English
        arrow-up
        46
        ·
        1 day ago

        If they’re not in the CS field, and you don’t want to teach them CS concepts that they don’t need, then you have eliminated C as an option by your own criteria.

        With C, they’ll have to learn about compilers, build systems, memory management, and pointers at the very least.

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        24 hours ago

        Idk why you are discarding python for the reason that makes python the best option. If there is a programming language that a non-programmer should know, it’s python.

      • who@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        20 hours ago

        The main reason to not including python is that students aren’t particularly in the CS field,

        In that case, I think Python is a better choice for teaching programming. Just skip the fancy features that have been bolted onto Python over the past 15 years or so.

        I might argue in favour of JavaScript if web application programming is specifically the goal. But for programming in general, I consider it a troublesome language.

      • MagicShel@lemmy.zip
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        1
        ·
        1 day ago

        Python allows you to focus on a single concept in isolation (building on what you’ve already learned, of course). JS has a bunch of other stuff mixed in. Like the DOM. Interacting with the DOM is necessary for any browser code. You can hide it with abstractions and boilerplate, but it’s always going to surface in error messages. Debugging JS can be quite a bit harder than other languages.

        Caveat: beginner JS is many years behind me. It may not be as bad as corporate code full of react and angular and all kinds of requirements.

      • VeryFrugal@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        20 hours ago

        The main reason to not including python is that students aren’t particularly in the CS field

        If that’s the case C is the very first thing they should avoid spending time on.

      • grue@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        1 day ago

        The main reason to not including python is that students aren’t particularly in the CS field, they are learning it as their “augmented skill” (I don’t know what it’s called bad English). That’s why I don’t want to force them to learn CS concept which they might not even need.

        That’s an even better reason to pick Python, then.

  • Cryxtalix@programming.dev
    link
    fedilink
    arrow-up
    15
    arrow-down
    4
    ·
    edit-2
    1 day 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. Nothing drains their interest in programming faster than segfaults.

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

  • lorty@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    1 day 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.

    • thehairguy@lemmy.zip
      link
      fedilink
      arrow-up
      4
      ·
      1 day 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

  • MagicShel@lemmy.zip
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 day ago

    Probably JS as the fact that every computer has by default everything you need to execute JS. But there is a bunch of browser stuff you have to worry about before you can do anything with it. I’m not sure how you learn JS before html.

    With Python you can do simple command line stuff without having to really know anything else. You can learn one concept at a time.

    That being said, people have a lot of familiarity with browsers and it might feel less abstract. JS might a better choice for demystifying coding. Python is probably a better choice for accomplishing anything useful.

  • jtrek@startrek.website
    link
    fedilink
    arrow-up
    7
    ·
    1 day 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.