• @kirk781@discuss.tchncs.deOP
    link
    fedilink
    English
    7127 days ago

    Java was also my first introduction to programming as it was included in Computer Science in final year of school (at college, we did the trusty C).

    I think they have replaced Java with Python now in schools because of the latter’s popularity and also because many would argue, Python is slightly easier to learn than Java.

    • @kescusay@lemmy.world
      link
      fedilink
      English
      6827 days ago

      Python is easy, but it can also be infuriating. Every time I use it, I’m reminded how much I loathe the use of whitespace to define blocks, and I really miss the straightforward type annotations of strong, non-dynamically typed languages.

        • @kescusay@lemmy.world
          link
          fedilink
          English
          826 days ago

          Oh, I know you can, but it’s optional and the syntax is kind of weird. I prefer languages that are strongly typed from the ground up and enforce it.

          • @sugar_in_your_tea@sh.itjust.works
            link
            fedilink
            English
            326 days ago

            Python is strongly typed, it’s just not statically typed. Python with consistent type hinting is extremely similar to a statically typed language like C#.

            • @kescusay@lemmy.world
              link
              fedilink
              English
              226 days ago

              I would argue that without consistent and enforced type hinting, dynamically typed languages offer very little benefit from type-checking at runtime. And with consistent, enforced type hinting, they might as well be considered actual statically typed languages.

              Don’t get me wrong, that’s a good thing. Properly configured Python development environments basically give you both, even if I’m not a fan of the syntax.

              • @sugar_in_your_tea@sh.itjust.works
                link
                fedilink
                English
                126 days ago

                What’s wrong with the syntax? It’s just var_name: Type = value, it’s very similar to Go or Rust. Things get a little wonky with generics (list[Type] or dict[Type]), but it’s still similar to other languages.

                One nice thing about it being runtime checked is you can accept union types, def func(param: int | float), which isn’t very common in statically typed languages.

    • @gravitas_deficiency@sh.itjust.works
      link
      fedilink
      English
      3127 days ago

      I don’t think weakly- or dynamically-typed languages are a good thing to base computer science curriculum around. Yes, it’s “easier”. But you will genuinely have a FAR better understanding the language and the logic you’re writing in it if you work in the scope of strong and static typing - or, at least have linters that force you to (e.g. mypy for Python)

    • @padge@lemmy.zip
      link
      fedilink
      English
      1327 days ago

      The argument I agree with is that Python is the best language to learn if it’s your only language, and Java is the best first language if you’re going to learn others. The syntax from Java is shared across so many other languages and it forces you to learn about things like objects and types. You could make an argument for C or C++ but Java’s handholding is more beginner friendly imo

    • @MolecularCactus1324@lemmy.world
      link
      fedilink
      English
      11
      edit-2
      27 days ago

      I learned C++ as my first language and it was a great way to understand the core issues of a programming language — like memory allocation, memory freeing, the difference between memory addresses and the memory contents themselves, threads, system calls, etc. Java obscures these nuances to a degree, but Python is too friendly and makes it hard to understand them at all.

      I believe if you learn C++ you can easily learn any other language. After C++, I learned Python, JavaScript, and Java in a few days each without formal instruction. If you learn Python first, you’re probably going to struggle learning those other languages because you haven’t grasped the lower level concepts yet and may never if you’re not in a formal setting that forced you to learn them.

      No one disagrees that Python is easier, but if your goal is to get a foundation in programming that allows you to easily pick up other languages, you should start with C++.

      • @pycorax@lemmy.world
        link
        fedilink
        English
        326 days ago

        Imo people should start with C first since it is a lot simpler than C++ while still providing a lot of what you mentioned. C++ adds a lot of things like name mangling, templates, L & R value references that can quickly make things a bit more daunting for beginners.

        I also generally find error messages for C a lot more parsable for beginners than C++ ones.

        • @MolecularCactus1324@lemmy.world
          link
          fedilink
          English
          1
          edit-2
          26 days ago

          C++ has classes though and if you start with C and then try to go to other Object-oriented languages you’ll be a little lost. But, by learning C++ first, you’re pretty much learning C at the same time, you just need to avoid using classes.

    • @chakan2@lemmy.world
      link
      fedilink
      English
      927 days ago

      They did, but it makes me sad. Python is becoming the next JavaScript because of its ease of use.

      The Java guys simply don’t understand how to code without the gang of 4 crutch to lean on.

      • @jenesaisquoi@feddit.org
        link
        fedilink
        English
        226 days ago

        Not true. They use the same model, executing compiled bytecode. It just feels like directly running a script because Python compiles it to bytecode on the fly, and because it is embarrassingly slow.

    • @MrRazamataz@lemmy.razbot.xyz
      link
      fedilink
      English
      226 days ago

      In a first year computer science course at uni I can say they teach us Python, Java, and C, all with slightly different use cases.