• MolecularCactus1324@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    edit-2
    5 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
      arrow-up
      3
      ·
      5 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
        arrow-up
        1
        ·
        edit-2
        4 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.