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?

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

    • forestbeasts@pawb.social
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      JS is actually pretty great as a language these days.

      It doesn’t have to imply NPM hell. And it’s got normal syntax and doesn’t do Python’s weird meaningful-indentation thing.

      (It does have the == typecasting weirdness though.)

      – Frost

  • traxex@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    7 days 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
    11
    ·
    7 days 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)

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    12
    ·
    7 days 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
        ·
        6 days 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.

  • Paulemeister@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    6 days ago

    I’ve studied with (now) engineers and there is large portion of people having a hard time with even the concept of a function. We learned C(++) at the time. I guess being forced to learn about what the hardware does kinda messed with people being able to just think about algorithms. As a first programmig language to just write some basic functions I like Python, but to be honest I don’t understand what’s going really going on behind the scenes either. But C is a really solid choice, as what’s really happening is easy to reason about (at least unoptimized) and every other language will have to abstract these same concepts.

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

  • gnuthing [they/them]@lemmygrad.ml
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    6 days ago

    If you’re wanting to teach programming concepts, I would start with scratch instead. This can be taught to little kids or older students. It’s what the free comp science class from Harvard starts with

  • Masterkraft0r@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    6 days ago

    So, of the two JavaScript, because motivating them to program is more important than anything else if they have no prior knowledge. javascript has great tooling and faaar less hurdles to get something going then C. Personally i’d go with TypeScript if it has to be anything in this family of languages, because making them think of types early on is helpful when moving to anything more than little web apps. If any other languages are considered, i’d go with python with type hints because it forces you to format your code somewhat readably (believe me, i know that it’s possible to write unreadable python code) but is really low on boilerplate, has great tooling (at least third-party, use uv) as well as stellar IDE support and allows for multiple different paradigms to be explored.

  • crimsonpoodle@pawb.social
    link
    fedilink
    arrow-up
    1
    ·
    6 days ago

    Let them learn what they’re interested in so long as it passes muster as capable of sufficiently handling the concepts you wish to convey. Some will want low level, some will want an app, some will want to make games. The cross pollination of concepts will demonstrate that while languages may have individual benefits they should not stop at one.