is C still worth learning?
Is C still worth learning?
No learn erlang
no, just use c++
You need C to learn C++, so yes
why?
Yes, easy way learn computer architecture,infosec,algorithms,data structure and operative system.
I dont agree
It's still heavely used to do embedded software shit. It's also one of the best first programming languages to learn because it's unforgiving. Fuck learning JS or python as a first language. School should be focused forming researchers, engineers and scientists not sugar coating every aspect of CS into web dev. Sorry for the rant, short answer : yes.
Well, you can’t truly understand any programming language if you don’t understand C’s fundamental concepts...
Ye
No, you'll be like me and have a hard time un-learning all the autism you learned in C to move to a modern and marketable language if you start out on C.
Learn some form ASM if you want to be autistic and larp as an embedded systems engineer.
I love C, but most things you do nowadays pretty much require OO tech, so (unironically) Java should be your first language.
It's been proven that the first programming language you learn is a great factor in how you think, and if you wanna be marketable you need to start off in OOP, simple as that.
Definitely learn C though at some point, helps you understand everything from the kernel itself to memory management.
t. started-with-C-and-it-was-hell-to-learn-OOP-fag
Yes, it's still the best language ever created by far, and it gives you a solid foundation
Except OOP fries your brain, imperative or functional gives you the best habits. Haskell -> C -> Python would be acceptable too, since functional-style C is decent, but OOP taints the brain too much, especially Java.
I can agree with the fries your brain part, but again I didn't start with OOP
Route was C->Cpp->ASM->Lisp (scheme ofc)->Java->HTMLCSSJSPHP meme languages
Cpp fried the brain, that was your second language, you start abstracting shit to hell and back until it becomes "enterprise grade"
As much as i love python i agree with you. C is the best choice for first programming language
Yep, if want reason, just keep in mind almost every language, compiler, even your browser is written in it. Also microcontrollers...
When you already know Python, Java and vba.
>objectively superior language to most modern webshit
>still can't find a job for it
It is better to learn upward when it comes to programming.
Half of the reason most python libraries are bloated and garbage is because the people making them never learned the basics.
Start with C and work your way to higher level languages if you want.
I agree. I started out learning python and when i tried to pick up C i carried all my python habbits over with me and it made learning C very difficult.
I'm learning C# as my first language so I can be a web dev etc, thoughts?
If you don't have any serious Unix/Linux/Apple tendencies, you can't make a mistake with learning C#.
Yeah boyeeeee
Stop sugar coating every aspect of CS into high level, just do assembly .
Yes. It's not worth using, though.
You need abstractions if you're working on something massive
C is like learning English: it's easy and it will take you anywhere.
It's called "the lingua franca of programming" for a reason.
Sure, though you'll never write anything in it hopefully.
Read that book, it's tiny. It's all you need as a spec of the language itself like how to read declarations.
Then take a systems course that shows you pointers at the assembly level, how memory works ect cs.cmu.edu
After that you can read those Art of Programming books and understand what's going on, but you'll never write shit in C or assembly unless you're an embedded developer (which are all in China these days) or you're a finance tech guy writing a customized FPGA for trading but even then it'd be in a high level language with you dicking around with the bytecode measuring everything trying to optimize
The difference is you learn English to actually use it and not because "it makes you understand the fundamental concepts of communication"
So, is K&R is still the best book for learning C? Or there's better ones?
>java programmer: how many layers of abstraction are you on?
>C programmer: like, maybe, 1 or 2 right now, my dude
>java programmer: you are like a little baby
>watch this
C is called the "lingua franca" of programming not because you are expected to use it for all projects, but because it's the lowest-common-denominator API that can interface with virtually all programming languages and operating systems.
K&R was never that great, because they include too much antiquated "clever" syntax like using assignments in conditionals.
But it still has good examples and the fact that C really isn't all that complex warrants a short book. Just feel free to question some of their programming idioms.
Maybe you can recommend something better? I'd like to develop good programming habits from the start.
Programming brainlet here. How fucked am I learning python first? And what language should I learn after to get good habits down?
Don't bother, the only thing anyone uses C for nowadays is embedded software (and the embedded software job market blows unless you live in China or India) and operating systems (which is pretty much a mature field at this point, so demand is also low).
Also the idea that "it makes you a better programmer since you *really* know what's going on under the hood" is just a meme propagated by oldies who are mad that their knowledge of C they spend their whole career amassing is basically irrelevant in the current year.
>not using patch cords to manually define register on contents on steam powered babbage machine
Learn machine language
forget the compilers and shit.
At that point, any language should do.
You just need to practice, and read well written code.
Not fucked at all. It is like an artist being worried that he learned how to paint before learning drawing with charcoal. The majority of skills carry over and the abstract ideas are the same.
The biggest difference is memory management and declaring the variable type. Basically in C you have the freedom to do more but that inherently means there are more ways things can go wrong. You'll have to exercise more caution and discipline to accomplish the same tasks, but if you know what you are doing you can take shortcuts and other fun stuff.
C programming a modern approach is much better.
Yes. It's small and simple.
Looks good, thank you.
Yes, ignore C++ pajeets telling you otherwise
>falling for the OOP meme
how many levels of abstraction, user?
no deprecated since the release of HolyC
>falling for the unemployment meme
>unironically believing object model garbage is efficient
maybe you should stick with java
cheers, thanks lads
>believing big corps care about efficiency
It's all about readability and ease of use
>believing Java's concept of "abstraction" aids readability
>you can't even write a "main" function without a class
Maybe you really should stick with Java. To paraphrase Linus, a good reason to choose C is to keep other programmers away from your project.
Corps like java because it is so verbose, makes it look like your worker drones are busy.
Go for C++.
C is an old thing that only appeals to some system programmers that think having weak typing and memory errors makes you leet.
That image is unsettling.
>memory errors
>C++
oh the irony
Not really.
Use RAII. Put stuff on the stack. Use smart pointers.
You can almost write proven code that will only compile if safe.
In C well... Time to show your leet skills and get exploited by an off by in the kernel and blame "subpar programmers" instead of your portable assembly
Dont bother unless you already know Python/Java.
throw yourOpinion;
> ^absolutely safe, no problem with this shit
>t. brainlet who couldn't get past first chapter of K&R
yes
I have a job writing embedded software in C and assembly.
I'll have you know Im a nuclear physicist and a beautiful woman
Well you can only be one or the other.
well then, tits or GTFO
====================================================================
Step 1: Read K&R, realize the style of declarations used in it won't be used today but it still is the definitive resource on how to read a declaration/bracket order operations ect.
Step 2: Read these lecture notes, slides/additional resources cs.cmu.edu
Step 3: Watch these lectures, read the course book (click on 'old lectures') cs.cmu.edu
Step 4: Read this modern C guide matt.sh
Final step: Read this and use for reference cert.org
That's all you need. K&R will teach you what is undefined behavior. 15-122 will teach you to write safe programs and how to analyze existing programs. 15-213 will teach you what C looks like at the assembly level, stack frames, two's complement representation, floating point ect. That 'How to C in 2016' guide will teach you how modern C is written to avoid classic C problems like throwing around char's and ints. The CERT guide is a good desktop book to have around to make sure the shit you are writing cannot under any circumstances lead to undefined behavior. Whatever project you decide to contribute to after doing all this to obtain base competence in modern C programming, they will have a contributor's style guide which you must read like the kernel.org style guide or OpenBSD man style
====================================================================
I normally shill Rust as much as possible, but I'll admit C is worth knowing (especially if you're gonna be doing shit on embedded systems)
This is a good post.
how did you not get OOP with C data structures? they're basically data structures with function pointers and some bells and whistles.
this desu. c++ is not required if you "need" object abstraction
Thanks, I copied it from another user who posted it long time ago but I thought it'd be useful for op.
I'm a complete jackass so I started with C++ but can't complain so far.
Alice studies computer science. She wants to become a web developer and has no interest in embedded systems or high performance programming. Should she learn C?
Bob is a mechanical engineer. He uses matlab and CD-adapco at his job. Should he learn C?
Charles is a PhD student in theoretical physics. He mostly uses python but sometimes expands legacy fortran code for simulations. Should he learn C?
Danielle is doing her postdoc in biogeography. She doesn't like computers but sometimes writes R code for her research. Should she learn C?
>you can't even write a "main" function without a class
You would have to change the entire design of the language for that. There are valid criticisms of Java, but that's not one of them.
you're thinking of pascal
It's basically a requirement for doing anything serious beyond web development and scripting.
>Alice studies computer science. She wants to become a web developer and has no interest in embedded systems or high performance programming. Should she learn C?
No, she should stop studying computer science. This current trend of "you need to have a CS degree to be a code monkey" needs to die. It's bad for webdevs, because they have to go into debt and spend years of their life learning things they won't need, and it's bad for actual computer scientists, because the large number of "I just want to make money with this shit" retards will inevitably lead to a decline in the quality of CS education.
I'm learning C++ as my "first" (I already had some experience with C and Python but not enough to do anything serious)
I figured that starting with something complex, unforgiving and with a lot of features will make it easier to learn other languages afterwards.
Is learning to program in general really worth it? I mean maybe not for me I'm in my 30s now it's too late for me but it just seems like a lot of those people that were in college with me end up in dead end code monkey jobs? Is there too much competition for those jobs or are they all being outsourced or something?
if you would enjoy learning it then go for it. not worth it if you "just want to make money"
I'm a Scala dev with experience in Java, Python and JS. I probably haven't written a single in C since freshman year but I think it's really important for any developer to learn it because it is a nice abstraction of a machine and this is crucial to understand before you start building your code over this abstraction.
Surely there are some successful code monkeys, JS devs, enterprise slaves which are totally oblivious of what's going on behind the scenes but I've yet to see a decent programmer who doesn't know C. (maybe if they come from functional background it's possible)
>shit-that-never-happened.txt
C is outdated, learn C++ instead
>Should I learn xxx?
In the time it takes for this thread to die you could have read K&R and have learned enough about C to implement most Project Euler-style problems, at which point you would be in an excellent position to decide for yourself whether you want to move forward or not. It's a tiny language.
Maybe that's not the best comparison. It is my understanding that learning low level languages first and higher level languages later makes both way easier, while English seems rather easy compared to other languages. Like, if you want to learn the present tense all you need to remember is that he, she and it get an s, and then a couple of exceptions, while other European languages have tons of different verb conjugations AND exceptions.
I wish there were more jobs in the Erlang/Elixir market but there just arent
Master Python, learn C in spare time to get knowledge of lower level concepts, you're good
i'd actually argue that C is more akin to Latin, it's not really used all that commonly for most things nowadays but it's still the root of most modern languages
this. C is really not hard to learn, and it's great because it does *exactly* what you say so the impetus is on you to not fuck up.
What is proper exception safety? There are best practices to handle that.
It's like saying a language is flawed because you could divide by zero and make it crash. At some point the programmer has to earn his paycheck by not being a total moron.
>it does *exactly* what you say
>what are UBs
I agree with u
>learn C first
>start learning python
>people keep telling me to write more 'pythonic' code
>mfw I'm supposed to import even the simplest shit to appease to someone's autism
how do people deal with this shit
And thats why you learn Python first.
If you have never programmed or just a "hello world" and you want to actually learn programming then yes C is the only language you should start on. It's also really fun IMO.
If you are already a .net dev of 5 years and are curious about C, don't bother unless you just want to fuck around with pointers.
Python is so abstracted to a high level that it teaches bad habits. "Shit, I'mma just google for a library that does this shit for me, import it, and write three lines."
>haskell as first language
that is like teaching a person to run before they can even stand up
I love you.
Every programmer should know how to write good (or at least decent) C and Lisp code. It is like knowing how to knot your own shoes: you could go without knowing that, but no one wil take you seriously.
>NIH
To be a well rounded programmer one should learn at least:
Assembly (how to read it)
C (procedural, metal)
Javascript or lua (prototypal inheritance)
C++14+, C# or Java (oop)
C++ templates or LISP (metaprogramming)
Haskell (pure functional)
A shell script (powershell, bash, w/e)