Why is C so prevalent?

I just started programming with C, i feel like it's a bad choice for a beginner. Do i fell for the C meme?

Other urls found in this thread:

youtube.com/watch?v=rX0ItVEVjHc
youtube.com/watch?v=QM1iUe6IofM
twitter.com/AnonBabble

>just started
>I-I-I'm not so sure about this
If you don't commit to doing anything then you won't fucking find out if it's a good fit for you, genius.

for a beginner i'd recommend python3 desu. c should come later, once you know the basics.

>Why is C so prevalent
1. It's not that prevalent anymore.
2. It was one of the only choices for beginners for a long time.

>Why is C so prevalent?
Excuse me? C is dying.

The argument I usually hear is something to the effect of "C is portable assembly". I think the idea is that assembly is close to hardware, but anyone who knows anything about modern CPU architectures knows that there's enough magic silicon for this to be bullshit.

C is popular because it's popular, the network effect. There wasn't a reasonable alternative in the past, and there's too much C code around now to switch to anything else (disregarding whether or not a reasonable alternative exists yet).

> i feel like it's a bad choice for a beginner. Do i fell for the C meme?

It's not a meme. C is simple enough and makes it easy for you to pick up other languages you want to learn later on. It teaches you the importance of memory safety from the start without too much hand holding, where the latter usually just ends up creating bad habits that may or may not transfer to other languages.

I went from python to C, and I regret learning python first because it gives you an unrealistic expectation of how other languages work in relation to what python tries to abstract. C imo is a good benchmark that translates well to any other modern language being used today.

What do you mean "magic silicon"?
Assembly is closer to the hardware than C. It is purely platform dependent. x86 runs on x86, arm runs on arm, etc. And many architectures have differences between specific processor implementations.
C is low-level enough to do what you please with memory but high-level enough that you don't need to learn a whole new instruction set when switching platforms.

>but anyone who knows anything about modern CPU architectures knows that there's enough magic silicon for this to be bullshit.

Thanks for saying to everyone you know nothing about modern CPU architectures.

As an example, x86(_64) is a CISC instruction set, but actual hardware switched to using RISC internally some time around the Pentium era.

C is a great language to learn, that way you can appreciate and understand the automated features that younger languages offer. I enjoy C, its a small language and a great place to start coding.

Just remember: the more esoteric the language the better it is

Other languages are generally more productive for 80%+ of problems, but eventually there's a point where your software needs to interact with the operating system or hardware, and C is the language to do it with.
Every non-meme language has an FFI to call code written in C (and usually no other language), hence why it's the preferred choice for general reusable libraries.

that's a poor measure to base your thoughts on.

Github is the literal epicenter of SJW JS faggotry starting repos with a single index.js that does nothing and a Code of Conduct and README that's a mile long about the communication of the ORG for the repo. C is still very much alive and well. I would argue that C++ is more reasonable to learn unless you want to work on legacy systems/embedded systems.

>asm isn't close to the hardware because out of order execution

srslee? just because your asm doesn't always run the way you wrote it doesn't mean the cpu isn't running your asm.

>It's not that prevalent anymore.
>An 40 years old programming language widely used for system programming and embedded system applications.

>assembly isn't close to hardware
As opposed to what? Assembly is as close to the hardware as you can get. Every language compiles to assembly.

>C++ is more reasonable
C++ is OO clusterfuck central. OO is garbage anyway but C++ makes it worse than trying to figure out perl coded by some regex-happy neckbeard.

C is and always will be the superior language. End of fucking discussion. If you think C is insecure, or problematic, or whatever, you suck at coding. Go back to your baby language that coddles you and picks up after you at the cost of control and speed.

Learn ruby
Python is split and shit

hhahahahahahahahhhaha

>OO is garbage anyway
I see this meme all the time on Sup Forums, usually referenced along with indians and Java. Mind explaining?

C's a fine language to learn the fundamentals with. I probably wouldn't recommend it anymore, but concepts are concept. Just don't try to actually make anything with it. Not as a neophyte, anyway.

The thing that most Pajeets don't understand about C is that it's never really lost a lot of ground in terms of popularity. C isn't really used for webshit and shitty phone apps (most of githubs traffic) but none of those things existed back in the 80's anyway. In the area of shitty business bloatware, COBOL was used instead. C's speciality however, operating systems, embedded solutions, libraries and desktop apps where performance matters, C is still being used as always. Even for video games some developers prefer to use C over C++ since object oriented programming really fucks with cache efficiency.

Basically, C isn't dying, a bunch of Pajeet languages have simply sprung up over the years in an attempt to solve street-shitting areas like webdev.

Bump

>Just don't try to actually make anything with it.
What kind of cuck advice is this? Why not? How else would you learn the language?

He thinks making toy algos is knowing a language

Reminder that everyone on this board is a fucking webdev cuck

It's a start, isn't it?

Bump again

Why do people think C is better than ASM?
Sure it's easier to port, but multi architecture is bad, not good.

It's actually pretty funny than Linus Torvalds is basically a Sup Forumsentoomen but github is an sjw shithole.

>multi architecture is bad, not good.
Dumbass. Easier to port means that if x86 is botnet (which it is), Free Software applications can be easily ported to other architectures.

Stop pretending you know anything about anything

K&R book c doesn't take all that long, very good intro i say, but i never went past that so i dunno.

Then why bother posting your useless opinion?

>memory management in a modern language

You just wiped out all pajeets.

OO isn't bad in and of itself, but people who use OO often use it wrong.

c++ as c with classes > c > "full use" of c++

c++ is superior for dealing with strings. don't have to worry about null terminator faggotry. don't need no gay ass buffers or pointers. just std::string mystr = "my string"; and your dun.

Just some reasons why OO sucks:
1. The entire concept of an 'object' is retarded. It's basically just a function and a struct mashed together into something that provides no real advantage. Pajeets will tell you that an objects allow for 'abstraction' but the truth is that any object can simply be replaced by loose functions/structs with no disadvantage and cleaner code as a result. It also often puts beginners into a mindset where they try to write every part of a program as a class which often leads to code that's simply vague and poorly structured. In programming there's data and there's operations. Why mix the two?

2. If you care about performance, OO is simply not always a good idea. This requires a long explanation but basically it comes down to the fact that OO often causes cache misses, and using your cache memory as optimally as possible is often the key to performance. See this video for more in-depth explanation:
youtube.com/watch?v=rX0ItVEVjHc

3. OOP makes it easy for Pajeet code-monkeys to reuse other peoples classes and glue them together into a bloated abomination. Shit Pajeet code is the reason why computers now often feel slower than back in 1997 despite the fact that our hardware is much faster now.

4. Every time you write OO code, for every problem you're trying to solve you have to ask yourself the question "should this be a class or just a function/struct". With a language like C you don't have that problem and you can focus on actually solving the problem instead of pondering when the fuck to use objects (tip: never).

C isn't one of the basics?

std::cout < "Operator overloading was a fucking mistake." < endl;

Also
>not understanding buffer and pointers

youtube.com/watch?v=QM1iUe6IofM

This video is everything you need to know.

Here, let me fix C strings.
struct string {
size_t size;
char char_array[];
};

>endl
>not understanding namespaces

C is the fast language.
Write in C. Use no other language but assembly.

Yes, it's std::endl. Also it's '

You never made a single argument, there is nothing to refute.
Also namespaces are one of the better things to come out of C++, do you enjoy having to prefix your project name on functions just to avoid the chance of a collision?

C is great but I'd start with something a little less low-level. You'll want to start with something that encourages good coding practice before tackling something like C where the safety rails aren't there.

IMO you need C, Java/C++, Javascript, and maybe something like Python. But it's never that simple or clear-cut.

I started with Applesoft/TRS-80 BASIC, then learned a little Logo, then Pascal, then COBOL (which I then promptly forgot). Then I jumped back in many years later with Java and Javascript. I never did learn C, which I regret and I still have K&R laying around waiting for me to get around to it. The other one I want to learn is Python. In my work these days I only use R, and that requires Javascript.

IMO if you're starting out, you need a good scripting language that's clear and teaches you good coding, but also makes it fast and easy to get from code to results FAST. Then you pick up an advanced OO applications language. Then you can learn C, something low-level and powerful. (Then regex and SQL.)


It IS basic, but it's not a language that teaches you the basics. It's so low-level you can do lots with it that a beginner shouldn't try until they know what they're doing.

don't you mean
typedef struct string {
size_t size;
char* char_array;
} string;

The additional level of indirection isn't necessary with C99 flexible array members. Well and yeah I forgot to add a typedef.

>OO is garbage
OO can be very useful if the situation calls for it. Like most other 'tools' it has its own small purpose where it's good, and also situations for where it's overkill/dumb.
>C++ is OO clusterfuck central
How? It's an entirely optional feature which you can choose not to touch.
Nothing garbage about OO. There are 2 problems with it though. Every language that has OO also has a community OBSESSED with OO. People using OO for situations where they're not really required.
Books and teachers teaching kids about OO early on when they barely taught basic principles yet. Too much of a focus on it.

And also #2, some languages FORCE you to use OO when flexibility is the better alternative. Why does "everything" need to be inside a class, so fucking stupid desu.

...

>C is and always will be the superior language. End of fucking discussion. If you think C is insecure, or problematic, or whatever, you suck at coding. Go back to your baby language that coddles you and picks up after you at the cost of control and speed.
nice argument. what about the times when one is forced to rely on other people's code (i.e. always)?

Good point

Why even use C++ if you're not doing OOP?

yes and no, its partial risc underneath in that there isn't dedicated decoding and hardware for every single instruction that's available in full CISC, but all instructions do have a direct hardware mapping to a predefined sequence of risc instructions.

It doesn't do fucking magic as you so imply, and it definitely doesnt reorder your asm instructions. C is still king for getting close to hardware, because you can predict the pipelining of instructions and therefore get insane speeds.

I know it's too hard for you to understand but please do some education before you go shitting in the streets

It does everything else too. Why not use it?

More like you fell for programming meme. If you fail at understanding C you better pull out.

It's like this guy said but the opposite. You learn C to understand the fundamentals and then switch to some language that allow you to produce results fast while avoiding pitfalls because you understand how it works.

it's general purpose multi-paradigm language
If you ask why - easy memory allocation, STL, large codebase.

No, you are just having a hard time. Nothing wrong with that, you will get better just keep practicing and learning.

it does reorder your instructions if it can get away with it