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?

  • Paulemeister@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    7 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.

  • gnuthing [they/them]@lemmygrad.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 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

  • who@feddit.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    8 days ago

    I think JavaScript and web app development will be among the first programming jobs to be eaten by LLMs, and it’s already a crowded field. I’m skeptical of that being a wise career move for newcomers today.

  • Daedskin@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    8 days 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.

  • greenashura@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    8 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
      0
      ·
      8 days 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 ?

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 days 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.

      • MagicShel@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days 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
        0
        ·
        8 days 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.

      • who@feddit.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days 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.

      • grue@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 days 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.

      • BillyClark@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days 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.

  • abbadon420@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    8 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
      0
      ·
      8 days 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.

      • Mirror Giraffe@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days 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.

      • chicken@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        8 days 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.

  • raicon@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    I would say C first. You need to learn the fundamentals:

    • pointers
    • allocation
    • reference vs value
    • recursion
    • stack
    • panics, errors, error propagation
    • data structures

    Many devs don’t know it and they are honestly just clueless about anything they are doing. They just want to make it work.

    JavaScript is just too high level, and makes you think you are immune to these low level concepts, but you are not.

    And not only that, but also good practices, like:

    • git
    • linting
    • types of tests and how to implement them
    • working with third party dependencies
    • Flamekebab@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      I’ve been working as a software engineer for years and not once have those “fundamentals” been relevant to the work I do.

      If I question their usefulness then I don’t think it’ll sit well with no experience at all.

      • grue@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 days ago

        If you’ve been working as a software engineer for years and things like error handling and data structures (let alone git and testing!) are not relevant to you, I fear for your employer’s codebase.

        • Flamekebab@piefed.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          8 days ago

          Hah! You picked the two of your list that I actually do care about.

          • pointers * allocation * reference vs value * recursion * stack * panics, errors, error propagation * data structures

          I don’t know what pointers are. I don’t care about memory allocation. Recursion rarely comes up.
          That’s not the kind of codebase I work with. I guess I’m not a proper big-boy programmer 😢

          Anyway, your snide remarks about my abilities aside, that doesn’t address my point at all.

          • grue@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            8 days ago

            First of all, it’s not my list. Check the usernames of the comments you’re replying to.

            Second, you didn’t make any sort of distinction limiting which ones you were talking about before, which means that you expressed that none of them were relevant. You don’t get to move the goalposts and then pretend it doesn’t address your point because of that.

            Third, that sloppiness and failure to pay attention is only reinforcing my initial impression.

            • Flamekebab@piefed.social
              link
              fedilink
              English
              arrow-up
              0
              ·
              8 days ago

              Calling me out on a clarification when you’re banging on with ad hominem rubbish?

              Respond to the point or bugger off. I’m not here to impress you, you’re not my dad.

              Third, that sloppiness and failure to pay attention is only reinforcing my initial impression.

              A good engineer knows when the details matter and when it’s just wasting everyone’s time. Would you classify responding to someone being needlessly hostile as something other than a waste of time?

              If anything you should be criticising me for choosing to spaff more time on this conversation.

    • mimavox@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      I wouldn’t say that pointers and memory allocation is a good thing to start with. I teach programming to students with no prior experience, and sometimes it’s hard to even get them to grasp basic programming in Python. At least in the beginning. You have to start slow.

  • Diplomjodler@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    If you want to help people develop a fundamental understanding of IT concepts, teach them Python. C is very hard for beginners and will discourage most people. JavaScript is too inconsistent. Python will let people get results quickly and that way encourage them to carry on. Plus, it’s one of the most popular languages out there so Python skills are definitely useful in the labour market.

    • ghodawalaaman@programming.devOP
      link
      fedilink
      arrow-up
      0
      ·
      8 days ago

      Yes, python is very easy language for begginers and they might need it to create backend however most students don’t even know the difference between frontend and backend. They just want to create few simple website. And even if I teach them python first to write APIs, I eventually have to teach them about html, css and js

      • tortiscu@discuss.tchncs.de
        link
        fedilink
        arrow-up
        0
        ·
        8 days ago

        You want them to create websites and consider C, but python is too much “back end”? My mate, you already decided what you want, no need for discussion (:

      • Diplomjodler@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 days ago

        You can use Flask. With that you’ll have your first website up and running in minutes. Then you can move on to templating in HTML and CSS.

  • jtrek@startrek.website
    link
    fedilink
    arrow-up
    0
    ·
    8 days 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
    ·
    8 days 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
        8 days 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
          ·
          8 days 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
      ·
      8 days 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