Everyone here seems to hold up C as the holy grail of programming languages, and look down on higher level languages such as Java, C# and Python as languages for Ranjeesh and Pajeet. And yet, C is such a simple language. It has very few features and keywords. The main reference book is a tenth the length of those of higher level languages. It would seem that those languages would be more difficult to learn and program in. Where does the complexity of C come into play? Is there something fundamental that I'm missing? Or have I been memed?
What does it mean to "know" C
machine language has two keywords 0/1
nobody here actually knows or studied C, they just LARP while they make python and haskell fizzbuzz
source: I don't know C yet I shill it
i know c and it's shit
that's my expert opinion
do whatever you like with that opinion
Who else fell for the low level languages meme on Jow Forums here? I forced myself to be so proficient at C and now I can even translate C code into x86 asm with ease. In reality the job postings are just all Java and .NET, either that or webdev.
To add, if you want a job that uses low level languages, EE or telecom degree is a must.
If you're CS just stick to Java, Python or whatever people are using.
This isn't even remotely true lol
C seems easier than it is because of a truckload of caveats, if you want to know in more detail either take the hard route of writing professional C for 50 years or the easy route of referring to the standard document constantly for a couple years. I'm currently writing a C compiler so I feel somewhat qualified to answer.
Literally just got a job in this field without EE understanding sorry bud looks like you're wrong.
C is nothing special. I use C because I enjoy it. I usually just do OOP in it and write my own abstractions. I do feel like I understand how C++ works under the hood better knowing C, even though I barely know C++. C is a very small language compared to C++, Java and C#. I feel like knowing how to implement data structures in C is the best way to understand data structures, however.
Why wouldn't you learn Java and .NET too? I work on .NET mostly at work. I only use C in my free time. A programmer should not be defined by the language they use.
I would imagine that, if you are not trolling, there are a few niche jobs in C that you could easily get into with a little effort.
What do you recommend for an amateur C programmer? I didn't study C in university classes. I just jumped into it because I felt like it; my first programs were neural network applications. I am trying to get a job programming C.
People who think that C "is easy", don't know C. Memory management in non-trivial applications is hard. It's worth it if you care about making things go as fast as possible without using assembly, C is king (inb4 muh fortran), but that's basically it's only use.
Well, my first language in college was C. Not knowing C is actually odd in my university, as they teach it to all kinds of engineering students. Even food engineering, for some reason.
Having said that, the only holy grail of programming languages is, obviously, HolyC.
There's literally a language called holyC
I'm not talking about a meme created by a paranoid schizophrenic.
It's exactly because there's so little to it. Programming in C means implementing everything yourself, optimizing it all yourself and then on top of that managing memory the whole time yourself. This makes programming in it difficult, but if done right leads to greater control and faster programs. Even if not done right it's faster on merit of being C alone.
>Even if not done right it's faster on merit of being C alone.
I'm not sure I believe that meme anymore. I had an assignment on a combinatorial problem that I did in C and my friends did in Java. They ran in about the same time, even after applying all the optimizations I read up on. The structure of the algorithms were about the same. Java may have closed the gap, and even lethargically slow languages like Python have libraries that increase performance.
people sleep on java's performance these days, also what 'optimizations' are you talking about?
EE student here, not a big programmer but knowing and understanding a certain degree of C is a must for me. Is it a hard language? Not really, the only thing I noticed about it is that you dont get alot served ona silver platter for you. There is alot you gotta do yourself and get into, which I guess can put some people off from it. And that might be a good thing to, if you dont need to use C then dont. Nothing holy about it, its just easier to program in C than in assembler.
GCC compiler optimization levels for one, as well as some of the tips I read here:
icps.u-strasbg.fr
I'm no professional, and most of this was trial and error. I did get some results from this though.
I went to C++ because it was a million times faster than python for the stuff I was doing. That is all
>Programming in C means implementing everything yourself
that was a plus for my teachers
they made us implement all the data structures over and over again
when we got to linear programming, it was like heaven to be allowed to use c++ vectors
Of course other languages can compile as efficiently as C in theory. In practice, however, many algorithms are difficult for the compiler to optimize automatically because it can't tell and/or formally guarantee all the invariants that you as a programmer know of, and also because some languages make it easier to use dog-slow high-level abstractions.
It's certainly possible to write a fast Java program, but it's very easy to pull in the whole java.util package and, hashtables for everything, and end up with a very slow and inefficient result. C, by reason of being simple (and also hard for idiots to get into), tends to avoid such tendencies. Also, a C compiler doesn't have to be as intelligent as compilers for higher-level languages, and in C it's always possible to implement optimizations that in other languages you have to rely on the compiler being smart enough to see them (stack allocations being a prime example, not least in Java).
>and even lethargically slow languages like Python have libraries that increase performance.
All of them written in C.
Assembly is even simpler than C, even easier to learn, and yet many would argue that it's even harder to use. Difficulty arising from the language's inherent complexity is the hallmark of a bad language.
Cobol Master Race reporting in
C is good if you don't want to learn Fortran (don't waste time with Fortran kids)
C++ is also good if you want to write C but with more power faster.
Interpreted languages (java, python, .net etc) are awesome if you want to write a quick program and figure out why things aren't working easily, but they are bunk for teaching how data structures work.
Lisp and R are my favorite languages frankly because they work more like your brain and less like talking to a robot.
Do you use Rcpp?
Fairly new to R, so i haven't gotten to that sort of thing yet. its a recreational language i've started toying with (and enjoy!) because i can't afford matlab
>OOP in C
how?
Structural subtyping
C does exactly what you tell it to. Nothing more.
That means it is a very small language. It takes more work to accomplish rudimentary things like garbage collection because it's not built into the languages.
malloc, calloc, realloc and free. If you know how to use them, then you know C.
yes u
Watch these lectuers (15-213 Computer Systems)
functionalcs.github.io
You learn C->Asm and the compiler/linker/ect.
Afterwards, looks up the SEI CERT C Coding Standard, and go through some of it.
wiki.sei.cmu.edu
Now try the following
microcorruption.com
cryptopals.com
Now you'll get why C is 'hard', because as other user said here doing manual memory management in a non-trivial program, without following the CERT guide, and without using a verified toolchain like this: vst.cs.princeton.edu
Also, I should add you can easily just learn SML in a weekend, and using MLton, which is a whole program optimizing compiler, output everything to 'safe' C.
Amazing, most of the replies here are legit. Thanks anons
Pointers!
I miss the bitwise operations and pointers, not having used C in a minute. Talk about washout level instructions for half my C and C++ classmates.
Alright, I'll give this a shot. Thanks user.
>C is easy
>proceed to write a C program
>it crashes
>why is C so hard?
idiot
>68110910
low energy bait. not even giving a (you).
Bullshit, stop lying.
static int module_init(void) {
int* x = 0;
printk("%d\n", *x);
return 0;
}
static void module_exit(void){
printf(":^)\n");
}
module_init(module_init);
module_exit(module_exit);
I think it depends what you're doing. I'd imagine more intense operations start to show bigger gaps between C and languages that use VM's. As such you only *need* C in very time critical and intensive work, and yea you're right that with today's computers the difference between C and C#/Java isn't that large anymore as the overhead is just blitzed through anyway.
Exactly, after doing it the hard way, you could do things the normal way without breaking a sweat
>t. CIA nigger
Checked
But with Emscripten and other recent tools, C can now be pushed in the web with ASM.js or with webassembly. In a way, being proficient in C is kinda cool again.
Thanks pal
Agreed, it's quaint and fun. What do you use it for?
nigger
Try applying for automotive companies or contractors that handle literal military contracts who designs their own embedded systems and protocols over radio with your shitty sorting algorithms and tell me how it goes.
ahaha epic :)
If you know how to spell "int main" you know C
Put your actions where your words are and start contributing to open source projects that are written in C. openssl has 371 outstanding issues on GitHub right now. Contribute something meaningful and put that that on your resume. C jobs are immune to bullshitting your way through the interview and appreciate real world code, because that and only that will show that you actually know C. They don't teach C in college, they teach you how low level programming works, what memory management is, what pointers are and so on, and so forth.
If you are browsing a local job board and seeing only .NET, Java and PHP jobs, it means you are browsing the market for sub-par developers aka code monkeys.
upboated
All comments legit, good discussion, good thread.
I want to learn C and started learning it because everything GNU/Linux is made in C. C is a powerfull language. Moar comments pls.
It's a catch-22. In order to understand why most GNU/Linux is written in C, you have to know C and computer history. However if you are not in for a lot of learning, and I'm talking years, then don't fall for the meme and just learn to program. The genius of GNU/Linux lies within simplicity in design and architecture, followed by brilliant implementation. C does not make POSIX, C helped get there in the 70's when C was considered a high level language.
I repeat, fully mastering C will take you years.
>C web development
I'm not sure how to feel about this.
C is just FORTRAN for dummies
But if you don't know assembly you're basically a poser
Emscripten is a meme. Something you say "neat" to and never use because it is impractical.
What if you're programming for non-hosted platforms? Malloc doesn't work without a kernel, or does it?
> 15 years
You need that much experience probably to do it intuitively. But not if you're quick at researching.
C is shilled by people who are to retarded to learn OOP.
Their brain is too small to even fit a single software pattern so they have to write everything using functions and plain old structs.
This usually results in writing everything multiple times avoiding common DRY-patterns and resulting in horrible cache usage.
If you ever hear another drone on youtube spewing the same old propaganda just ctrl+w that shit.
also
>but muh linucks
you're not writing an operating system brainlet
>I'm currently writing a C compiler so I feel somewhat qualified to answer.
Maybe you could give us some pointers?
He may have been paranoid, and a schizophrenic, but he wasn't a paranoid schizophrenic.
LOOOOOOOOL
KEK
>Maybe you could give us some pointers?
Give me your address
>Give me your address
So you can come kick my as for bad puns? I think not user.
woooooooooooosh
0Xv16b00b5
Whoops
0Xb16b00b5
C has a really high ceiling with what you can do with it, with regards to performance and applications. It is at the heart of every FFI in every other language. It can literally be used to program anything, whether it's a tiny microcontroller or a huge networking application. It's extremely unforgiving if you lack attention to detail, but it is easy to debug because it translates very transparently to assembly.
ever tried writing a web server with c?
>high skill ceiling
maybe for ranjid
>to retarded
The language is small in terms of features because it expects you to do for yourself what other languages will do for you. You really gain an understanding of how the things that other languages abstract away actually function. Perhaps that's the main reason why the vast majority of uni CE programs require C knowledge.
99% of the time it's gonna be pointers/arrays and the holy trifecta of malloc(), realloc(), and calloc(). Master that and you'll be able to get by.
?
>ever tried writing a web server with c?
Not him, but yes, I have written a web server in C, and am currently using it in production.
>food engineering
god bless america
You just use structs and write things like constructors and destructors and the object functions like regular functions. The biggest difference from say Java is no automatic garbage collection so you have to explicitly free all your struct elements instead of just letting them expire.
+1
was it worth it?
It's nice to understand how machines work at a low level but life is too short to write most things in C.
Cniles can't into C++ so they elevate the former to the holy grail.
C++ is better for any purpose.
Definitely. I find it much nicer to work with than Apache/Nginx/&c.