Has anyone learned C as their language as people usually don't recommend learning it as your first language because it's hard because of pointers, ...
For further actions, you may consider blocking this person and/or reporting abuse
I fully agree with your opinion on learning C language as first programming language. I started first with Pascal and then got to C language (well, my very first language was actually BASIC, but it was when I was 9 years old).
I learned C as my first language at college and don't regret it. Everything you do in C is from scratch and this is really good for long term knowledge.
I think the same as you. The C was hard for me as well (especially pointer concepts), people around me always tell me why still learn a traditional language, why don't go javascript, even more, start learning program by tools or frameworks.
My first language was C++, however the way to learning C++ is by learning C firs. Especially back when i was young and all we had were dry boring manuals which guided you through variables, arrays, if statements etc and finally to structs and classes.
Would I recommend people take the same approach as I did? No.
Everyone learns differently and not everyone has the same end goal in mind.
Not everyone will respond to it the same either, some might like this path and others might hate it so much that they instead completely change careers.
A couple of nit picks:
Pointers are only hard if you're not paying attention and didn't have them explained properly. If you properly explain the concept of indirection first (which most people will have no issue understanding, as the concept is baked into most natural languages), pointers will often come naturally as a logical extension when explained.
DMA is not a thing in most C coding unless you're doing OS-level code (like Linux kernel code) or tight embedded stuff that doesn't involve an OS. In fact, I've done a decent (not huge) amount of work in C and never touched DMA at all. It's more an assembly thing in many cases anyway.
OOP and abstractions are absolutely possible in C, that's part of what pointers (especially function pointers) and structs are for (your object is a struct, your methods are function pointers, and you use a constructor method just like you would in many languages). Check the Linux kernel source code if you don't believe me, they're more object-oriented in some places than a lot of C++ code I've seen.
I agree with you. I meant that the standard library does not provide with abstraction like modern languages give. You can even in OOP in ASM as well if you see it that way.
I mostly agree with this. OP does have some opinionated arguments. But I feel as though C is a programming fundamental language like Python. At some point no matter what kind of developer you are you will have to interact with some C/C++ level issues. Another thing that is good to learn from C is the top down approach, because in JavaScript there is hoisting so the top down approach isn't always enforced regardless of the fact that certain things don't hoist.
I strongly agree that at some point, it's necessary to understand how things work, and C is perfect for that. However, in my opinion, the introduction to Computer Science should start with basic coding and introduction to Programming. By basic coding, I mean learning the basic concepts such as loops, variables, functions, etc. Students first need to understand what they are doing before knowing how everything works under the hood. I think that languages with simpler syntax may be better as the first language. After understanding what programs are and how they work at higher levels, it's time to dive in deeper and explore how everything works using C.
Hmm instead Rust? Learn a low-level language which is very modern and also offers many abstractions you would expect from a modern language. At the same time, performant, memorysafe and a great active community.
That is a nice idea for sure but what I have seen beginners doing while finding the length of array in Rust and C is you can just do
arr.len()
as it is a method but in C they will get confused on how to do it because they are used to in-built functions. You have to dosizeof(arr)/sizeof(arr[0])
in C. I think it is necessary to know how it's done in the inner workings.C is just the base for everything, almost everything has C API.
If you add Nim nim-lang.org that allows to interoperate with JavaScript,
you have C, C++ and JavaScript at your finger tips with 1 code base.
:)
The problem with C as a first language is that it's difficult to build something useful early on. You're left doing low-level exercises, rather than creating an application that can help your folks or impress your mates. I imagine this can be off-putting. Beginners might be left wondering: "Is this what programming is all about?"
Don't get me wrong, C is a fantastic language to learn. And for some people starting out, it might be exactly what they're after. For others, not so much.
One other thing: C can be a nightmare to google, purely because of its name. I remember pulling my hair out at that when I was learning.
In my University, at CS, they teach first functional with Haskell, one semester, then 3 semesters to understand fully C. I agree with you, but the only thing is that it makes it harder for you to learn functional programming, because you'll get used to imperative. Knowing that, C is a really good lang to start with CS.
It is a great language that pops up all over the place, it teaches good fundamentals, to be cautious and not to waste resources. Its a great first language and I would and have recommended it
I agree with you specially that if you learn a relatively low level language, it will make learning other languages easier.