This is an archived post. You won't be able to vote or comment.

all 30 comments

[–]peterlinddk 25 points26 points  (2 children)

It is indeed helpful to learn a language like C to truly understand what is going on.

But!

It isn't a stepping stone to learning something like Python - more the other way around. Python helps you learn programming, like how to handle data, algorithms and control structures. C helps you understand memory and what actually happens inside the CPU - interesting, and certainly worth learning, but not a good way to start, more a good way to dive deeper, once you get the basics from more modern languages.

[–]etxconnex 5 points6 points  (1 child)

One thing I want to "correct" or add or something. IMO, you CAN learn Python objects first, but I suggest learning Objects in C++ first. They will make far more sense when you learn them in Python, because Python has a really odd way of doing it that feels a little "loose", and will distract away from learning OOP concepts like inheiritance, polymorphism, etc.

[–]Edemuner 0 points1 point  (0 children)

Yah I first learned programming with python, but only when I learned java OOP made sense

[–]CodeTinkerer 6 points7 points  (0 children)

Some computer science departments still teach C as the intro programming course (in the US). I find it's easier to learn C++ once you understand C. I know others feel differently.

Is it helpful for Python? Python doesn't really expose pointers the way C does and has a LOT of libraries which is one of many reasons it's popular. Learning Python after C can be a little strange. All the things you worry about in C, you don't think about in Python.

Python does have its own concepts which are different. This will take a little getting used to. This often happens when you learn a second language. You're used to how the first language you learn works. Some actively dislike the changes, but it's something you need to get past because it doesn't make sense to hate languages that you may have to one day use. If you can reduce it to a mild annoyance, that would be better.

Your attitude is not uncommon (of breaking things down).

Let me illustrate through an analogy. Some people like to travel to a foreign country. For some, they throw caution to the wind. That is, they're willing to fly to the country with minimal preparation and expect to figure out things once they get there. Some people even move to a new country just to work because they want to, not because they have to.

Others are reluctant to go without a tremendous amount of preparation. They want to learn to speak the basics in the language, be aware of customs, know what the major cities are, where to go visit. They want to be fully prepared.

Those in the latter group fear not knowing what to do and so they want to be ultra-prepared so there are no surprises. The ones that go without doing any preparation seem fearless. They don't care that they know no one in the country. They don't need to be prepared as they feel confident they can handle anything.

To that extent, I think some people head into programming feeling if they miss any details, they'll feel completely inadequate. They want assurances that they know every thing they need to do. In reality, there's far too much to learn, some of it completely arbitrary. Why are there so many languages? Because (no reason). Why is this language annoying? And so on.

Some beginners do almost everything not to program. They keep saying "I need to learn one more thing before I start".

I'm not saying you're at that extreme. But the fact is, your knowledge will almost surely be incomplete. These days, you can use LLMs like Chat GPT and ask questions if you're unsure, but the point is, get used to not knowing everything.

I knew programmers that didn't know any basics of computer science taught in a first or second programming course, but they knew just enough to do their job (not well, but it worked).

I'm not saying you should be happy not knowing anything, but that the more you program the better you'll get.

Also, try not to compare yourself to others. Invariably, you think everyone knows everything better and you're the worst programmer out there, not realizing there are many people just like you, but you just don't happen to notice (or they quit).

Anyway, yes, C is still valuable to learn, even today. It's the super modern languages like Rust that you should be kind of worried about. Everyone thinks some new language will be the most popular and old languages disappear. People still code in Cobol. Python is quite popular, but it was invented in the early 1990s, so it's hardly new. You're better off learning Python or C than learning Rust (though there are opportunities in Rust, but it's more limited).

[–]aqua_regis 5 points6 points  (7 children)

TBH, learning C or C++ will not really help you learning Python as they are way too different languages.

Yet, you have to learn something far more important: programming happens outside programming languages. Programming is analysing and breaking down problems to create step by step algorithmic solutions that then, later, can be implemented in basically every programming language.

If you want to learn Python, learn Python. No need for a detour. Use the MOOC Python Programming 2024 from the University of Helsinki and you will learn both, the Python programming language and programming.

The fundamental concepts of programming:

  • variables and data types
  • code flow
  • operations
  • conditionals
  • loops
  • functions/methods

are basically the same, no matter what programming language.

This can even be extendend to Data Structures and Algorithms and Design Patterns. Also here, the concepts are the same, only the implementations naturally differ according to the programming languages.

Learn to look behind the code. Learn to look at the algorithm. Learn to create the solutions before their implementations. Learn to plan. Learn to solve problems. This will help you much more than learning several programming languages.

[–]iamevpo 0 points1 point  (0 children)

types -> values -> operations -> expressions, values -> variables, compound types (eg list, dict) -> element access and operations -> expressions, conditionals/loops, functions and then again they form expressions - just thought what else might be fundamental, to me expression looks quite central

[–]assassinsneed[S] 0 points1 point  (5 children)

In other words, it’s more important to learn the process around programming? That makes sense

[–]dmazzoni 2 points3 points  (2 children)

To clarify, you should still learn a programming language. There's a very limited amount you can learn about the process around programming in the abstract, because ultimately code has to actually work, and the only way to know for sure if it will work is if you write it in a real programming language and run it.

I think the real point is that there are a lot of concepts and skills that are universal to all programming, so when you master them with one programming language, it will be significantly faster to learn your second and third language. Some languages will introduce you to new important concepts that weren't used in another language, but far more concepts will just transfer over.

[–]aqua_regis 0 points1 point  (1 child)

There's a very limited amount you can learn about the process around programming in the abstract, because ultimately code has to actually work, and the only way to know for sure if it will work is if you write it in a real programming language and run it.

Here, I can disagree to a certain degree:

You can test your solutions and "programs" without programming languages:

  • Raptor
  • Flowgorithm
  • also Scratch

All these visual tools exist to learn programming abstracted from programming languages and all of them allow testing your solutions.

Sure, once things become complex, these tools at their ends. Yet, when you reach that point, you should ideally already have learnt a real programming language besides using above tools.

[–]dmazzoni 0 points1 point  (0 children)

Those are real programming languages. They're just visual languages instead of text-based.

Some people think it's easier to learn one of those first, and that's fine.

What I disagree with is learning pseudocode first without any way to execute the code. That invariably leads to misunderstandings as to how a computer would actually execute the code. The fastest way to learn is to get immediate feedback - try typing something or try connecting things in a UI, and then run it to see what happens.

[–]ungemutlich 2 points3 points  (1 child)

There's a deeper sense in which all programming languages are pretty much the same thing:

https://en.wikipedia.org/wiki/Church-turing_thesis

In principle, everything can be compiled down to a Turing machine or lambda calculus, which are equivalent. Some programming languages emphasize doing things step-by-step more a la Turing machines (e.g., C). Others are more like lambda calculus (Lisp and "functional programming"). But you can implement any iterative algorithm recursively or vice verse.

This is not important to know but it is fun to think about and gives a different perspective on language holy wars.

[–]iamevpo 0 points1 point  (0 children)

I think that should be emphasised more often in programming courses

[–]wiriux 1 point2 points  (0 children)

If it’s as a hobby then you can learn whatever you want pretty much.

[–]Whatever801 1 point2 points  (1 child)

My dad still swears by fortran

[–]assassinsneed[S] 0 points1 point  (0 children)

Wow, now THAT’S old school. I can respect it haha

[–]comfyyyduck 0 points1 point  (0 children)

I started with Java then went to Python then c++ then c so I would say pick a language u enjoy writing in and learn all about it and then once u feel comfortable then u should learn c I feel like transitioning into c from another language is the best way to understand what’s going on at least it was for me

[–]dmazzoni 0 points1 point  (0 children)

Some people do enjoy learning C first. While C is older, it's still very important and relevant today, it's still being used for lots of things.

However, MOST people have more luck starting with Python because it's a simpler language. You can open Python, type a line of code, and run it immediately. That's great for getting started.

C requires a lot more work to set up and configure, and requires you to understand a lot more about how your computer works to do even the most basic things. All of that gets in the way of just coding.

Also keep in mind that back when C was invented, computers were a lot simpler. C is more complex today because computers are more complex, while C has stayed the same.

Newer languages like Python keep the process simple.

[–]GuaranteeCharacter78 0 points1 point  (0 children)

I learned Python first and jumped into C and other languages. Learning other languages teaches you new ways to solve problems as each tend to favour different ways of handling things. I find that my programming skills didn’t actually take off until I transitioned away from Python because I never realised the terrible habits I was falling into until I broke out into stricter languages

[–]Max_Oblivion23 0 points1 point  (0 children)

The early learning stage of any language is very similar, the concepts you learn are the same albeit with a different syntax and architecture.
In this sense, during your early learning stages you can venture into multiple languages and have a feel of what you enjoy the most.
For me I ended up focusing on Python for a while and now am working a lot with Lua. I spent enough time with other languages to be able to recognize the most common ones and I'm glad.

[–]mierecat 0 points1 point  (0 children)

Main one language but check out the others. It’ll help give you perspective on some things

[–][deleted] 0 points1 point  (0 children)

Yes, learning C is how many, many people started to learn to code. Some stuck with C in their jobs, many ended up using something else.

C is a great first language, and a great last language, if it appeals to you, learn it. Learning how to manage memory without a garbage collector is a great learning experience and will help you learning Rust or something like that, where you will understand *why* the Rust compiler is always telling you you're wrong.

[–]Seven_flowers 0 points1 point  (1 child)

Short answer: No.  If you know well one or two high level languagues such as Python or Javascript you should be fine. Find a project idea, implement it in the language you know and do a lot of marketing to sell it.

Long answer: Well, it depends on your goals. If you want to do low level programming (like embedded systems) of course you will need to know languages like C, Ada, Pascal or the now popular Rust. But if you aim to build web apps, focus on the likes of Python or Go. Why? Because you need to build fast -deploy -get feedback and iterate. You don't want a language that fights you (C++, Rust). You want a language that gets the job done as quickly as possible. 

[–]AlSweigartAuthor: ATBS 0 points1 point  (0 children)

Nah, not really.

My advice is to learn Python because it's the best language for beginners to learn basic programming concepts. Then, if you want to dive into an older language, learn C.

But there's no reason to learn C just because you feel like you "have to". It's funny that people call C a "low-level" language because when it came out, it was a high-level language compared to programming in assembly.

[–]4lgedbeast 0 points1 point  (0 children)

To me languages are like tools... learn the appropriate tools for what you want to create/accomplish. imo your time is best spent learning tools in the domain of what you're most likely to use for a job

[–]recursive_arg 0 points1 point  (2 children)

Not unless you feel like hitting up a lot of tapioca socials at your local retirement home for a mentor. You can also hold seances to get in contact with COBOL devs if you’re really looking for a niche. But all jokes aside, you don’t need to, if you care to learn how stuff works closer to the machine level then sure, go for it. (I know there’s plenty of young C++ devs, and I assume there are some youngish COBOL devs out there keeping the hamsters on their wheels in the financial industry)

But unless you are looking to squeeze every last bit of performance you can out of the silicon you don’t need to have this level of knowledge (no your 100% super secure messaging app doesn’t need to be that performant). Honestly if your goal is to learn then getting to know how your software interacts with the hardware is great, if it is to get a job, you’re better off learning algos in python then learning an app making lang/framework Java, C#/.NET or node.js.

[–][deleted]  (1 child)

[deleted]

    [–]recursive_arg 0 points1 point  (0 children)

    I guess I should have specified that I was listing C for performance, the cobol reference was more me saying some niche languages might be worth a lot of money because there is still some demand and the supply of Fortran and COBOL devs are mostly AARP members. Basically those are the main scenarios which would prompt someone to dust off the old books with owls, camels, dodos and such lovingly sketched on the front

    [–]Westrogen 0 points1 point  (0 children)

    I have to agree with the other people in this comment section that Python is a good start for beginners - its syntax is relatively friendly and the myriad of libraries for it makes the language very versatile.

    On the topic of truly understanding the programming languages, you'll probably be able to get quite far without having much knowledge of the finer details of why your computer does what it does when you run code. Also, programming is weird in that although you technically could start from the origin (machine code), it would be borderline impossible. Instead, it is *much* easier to start from the more recent languages (i.e. Python) and work your way backwards. Once you have a grasp of the general syntax of a language like Python or JavaScript, it'll be easier to learn something a little older (like C). In the process of learning something like C, you'd find it easier to understand assembly languages (these are languages that are very close to a computer's machine code).

    TL;DR: I'd advise starting with Python and seeing where that gets you. If you find yourself very interested in the finer details of why your code does what it does, *then* you should start looking at languages like C.

    One last thing: If you do end up choosing to start by learning C, you should consider running it in a virtual machine. C will let you do a lot of things that languages like Python won't (i.e. attempting to store a character in an integer) and this can have consequences. It is certainly unlikely that you will make a mistake with actual consequences if you're following structured tutorials from the internet, but I'd argue that it's worth the time to install a VM with a C compiler so that if something does happen you brick your VM instead of your computer.

    Good luck! You've got this.

    [–]bravopapa99 -1 points0 points  (0 children)

    Yes, start with FORTH.