Impressive CC++ Programs

What's the most impressive piece of software or exciting github project that you've seen written in C? I'm trying to decide whether I should dump the language or not because my next few courses are all in C++. It's not the most in demand language I know, and as far as I know, there aren't too many places hiring C devs.

General C\C++ thread too I guess.
[spoiler]C# users can fuck off[/spoiler]

Other urls found in this thread:

github.com/torvalds/linux
roartindon.blogspot.be/2014/10/compile-time-murmur-hash-in-c.html
youtube.com/watch?v=tCRPUv8V22o
theregister.co.uk/2009/09/22/linus_torvalds_linux_bloated_huge/
twitter.com/NSFWRedditImage

C will never die. There's no reason to dump it.
As for your question, the most impressive things I've seen in C were any of the id Tech engines from 3 on up. John Carmack is a god and C is his lightning bolt thrown from the heavens

github.com/torvalds/linux

C++ is (mostly) a superset of C and if you know what you're doing, it will almost always be the better choice.
C is for autists who believe that the less features a language has, the better.
The only thing I could see being in favor of C is that the compilers might produce slightly faster code, since it's been around for a long time.

C runs faster than C++. This is a fact.

The differences aren't huge, though.
An experienced C++ developer will produce much more readable and maintainable code. And face it, OOP is not a meme, it's the standard, and while doing OOP with C is possible, it's clearly not created for that. And that's why so much of C code is unmaintainable garbage, even if the devs are competent.

Fizzbuzz

You learn C when you learn C++.

That's a meme. You get the same binaries with C++ as you do with C.

The difference isn't huge but still prevalent. That's why (windows for example) the kernel is in C and the OS in C++. C for speed, C++ for easily manageable code.

try to write library for other languages to bind to, c++ sucks.

inheritance is a meme though

>Writing a HUGE Fucking kernel in non maintainable code.

no. c++ is actually faster

If you say so hoss

ever heard of constexpr?

roartindon.blogspot.be/2014/10/compile-time-murmur-hash-in-c.html

Read "Expert C Programming".
Though I couldn't point you to any bit of impressive C source, simply because I haven't got around to read some source code.
It's really about how much you enjoy the language, I love the language and want to do it professionally, I don't care about the market share, there aren't many good C programmers out there anyway.
C++ has more market share, you can take most of your C knowledge to C++ and it applies (C++ builds on C, and has largely the same domain in the low-level/high-level scale).

Why are you spreading false information on the internet?

I'd love Go-style OOP in C.

yeah so just don't use it incorrectly (or at all if you can help it)

see and that just one example. c++ has more optimization rooms than c, especially with the templates.

>C is for autists who ...
lo and behold, a dumbass who says "autists" to dismiss a point!
I'm not here to argue with someone who actually thinks C++ is better than C, but OP should know that C++ is a mass of complexity, if it means anything to him.
Not that C is the cleanest language, it's, quoting Dennis Ritchie: "quirky, flawed, and a great success". But it definitely looks clean and simple when compared to a behemoth like C++, for which the standard fills over 1000 pages.
Nobody can expect to know C++ entirely, though it IS possible to know C completely.
I would suggest reading "C++ the core language" for anyone interested. It's a bit dated, but I believe the main point holds (it is C++ for the C programmer, it presents the main ideas of C++ without getting to the more advanced stuff)

Still spreading your lies? I'm gonna let you believe whatever you want but your link proves and means nothing in this debate

youtube.com/watch?v=tCRPUv8V22o

>C++ is (mostly) a superset of C and if you know what you're doing, it will almost always be the better choice.
>C is for autists who believe that the less features a language has, the better.
I will never understand this argument, "c++ is more limited but comes with free templates, hence it's better" / "C is for autist because you can literally make anything with it but there's no free class and it's not even OOP"

C is a horrible programming language which has now ignored 50 years of plt.

to elaborate, the creators of C knew where to stop.
Bjarrn Soupstrap slapped a shitty OOP system on top of C (if you want to know actual OOP, look at smalltalk or it's descendant: ruby (inb5 muh sjwwws if you refuse to try things because a bunch of nameless strangers says it's used by landwhales then you need some helium)), the language adds little abstraction with a shitload of overhead (in terms of mantainability and code complexity: lurking bugs); you have to keep track of all the special cases and subtleties that each feature introduce. Then C++ started stacking features without cleaning up the mess it did before that, because muh backwardz compatibility, and now they're trying to clean up a bigger mess, standard after standard (see C++11, C++14, C++17) constrained by a much much bigger codebase in need of backwards compatibility.....

That's why I suggested the Core Language book though, it is possible to do C++, and you should start with a firm footing and also just enough to get things done without getting bogged by the tangled mess of a language that it is.

Pic related.

>to elaborate, the creators of C knew where to stop.
no, they were forced to stop because C targeted the worst, the shittiest, computers of that era (PDP). C is a rip of BCPL which is already a rip of CPL. If CPL would have been implementable on PDP, C would have never existed.

daily reminder why the linux kernel is not written in C++

daily reminder that linus admitted he doesn't code anymore.
daily reminder that he admitted linux is bloated mess.
daily reminder that linux is now (poorly) emulating c++ oop by defining virtual procedure tables by hand.

As some guy on the internet once said, programmers like to treat programming like it's monolithic and that the features they need are vital to everyone and the ones they don't are unimportant garbage.

What I'm essentially saying is that anyone who says "C++ is better than C" without adding caveats is full of shit, and the same presumably applies in reverse. It all depends on what you want to program.

Test std::sort against qsort, friend. Or anything that takes function pointers instead of template arguments.

And he's right: OOP is a mistake, C++ is a mess and abstraction is creating retarded programmers.

>daily reminder that linus admitted he doesn't code anymore.

And how is that any surprising? He doesn't have time to write any code personally, managing kernel development is a full time job.

>daily reminder that he admitted linux is bloated mess.

Yeah, intentionally and by design. It's how the bazaar model works.

>bazaar model
Bazaar is nothing else the principles from the mythical man-month plus some minor writing on the decentralization of open source projects. Raymond is a scam.

>intentionally and by design
not really
theregister.co.uk/2009/09/22/linus_torvalds_linux_bloated_huge/

Newer versions of C++ added some really cool performance and convenience features, especially C++11 (inb4 >new).
As for performance, move semantics and constexpr, for example.
As for convenience, unique_ptr and shared_ptr really do help with memory leaks, with marginal performance cost.

You can go back to wonderland and believe... whatever you want to believe.

>shared_ptr
>marginal performance cost

Haha.

are u fucking dumb? C has all those move semantics shit. u just dont write std::move instead just pass as ref pointer.

OOP is garbage you can find a shitload of litterature on the subject, just google it.
OOP push the developer to think more about what he wants than how he can do it and this is a bad thing.
You don't build a home just because you have a good idea of how you want it, you have to actually know how things work together.
OOP allows such a thing and it's bad, really, really, really bad.
You can't do serious dev in C++ by ignoring C and its original way of thinking.
It's funny to see how almost every language are in fact converted in C at some point during compilation or rely on a vm written in C.
EVERY paradigm ever, can be implemented in C.

How would I do logic programming in C?

Because you can do it does not mean it's easy.
developping the whole jvm is a lot of work for example.

Then what's your actual point?
I can write a C compiler in Brainfuck - what does that say about anything?

>Then what's your actual point?
It's better to write it in C than in any other language. How can you explain that? SImply because C is better.

>impressive
>written in C

this.
OOP INTRODUCES complexity into a project.
Complexity means bugs and oversights, which means security flaws and unmantainable code.
OOP forces you to work around OOP.
There are some domains for which OOP may be a good idea, like game programming, but in big development environments, it just generates codemonkeys that can be replaced like cogs.
In any case, where OOP might be needed, it would make more sense to just implement it atop a language that permits it (it's just a datastructure after all). OOP is artificial and lacks generality, it's a fixed model to which the programmer has to adapt, instead of adapting it to the problem.

I sometimes lay in my bed and notice my copy of Masters of Doom and imagine how exciting the 90's must have been for game developers and then I'm overcome with some weird sadness

It's easier than ever to develop and distribute games.

That's not my point

What is your point?
Masters of Doom was all about a small independent group of misfits hitting it big.

The then radically new technologies and techniques

what's wrong with C#

It's not near to the bare hardware.

It's the new Java and attracts pajeets.

1.
M:N threading runtime for my programming language to automatically parallelize. Very interesting but didn't work out well as you might have guessed.

2.
Embedded firmware that was written really portable. Also proven to run in real-time and scheduled with a cyclic executive.

>M:N threading runtime for my programming language to automatically parallelize. Very interesting but didn't work out well as you might have guessed.

Isn't it obvious? It's not worth it to parallelise if your workload takes less than overhead/(cores-1/cores) time.
Turns out just the overhead of just issuing work to a threadpool and waiting for the result alone is around 50 to 90 microseconds which means any task that takes less than 120 microseconds is not worth it to parallelise and even beyond 120 microsecond you also have to consider that at the breakeven point you're burning 4 cores instead of just one which means you're wasting power so it's actually only worth it when the task takes at least 360 microseconds. So basically you can only start 3000 parallel loops per second.

Parallelisation itself is trivial. In C++ you just throw #pragma omp parallel for firstprivate(var1,var2) if(iterations > magic_number) on your for loops.

The hard part is determining the magic_number since it's highly dependent on the single core performance of the CPU you're using. On a 6700k it may not be worth it to parallelise but on a FX 8350 with less single core performance it may be worth it. What if CPUs with more multicore performance but less singlecore performance are available in the future? They would perform worse with current applications even though the program was parallelised and could in theory take advantage of multiple cores. magic_number can certainly not be a constant if you want the holy grail of "better hardware makes our software faster".

Concurrency is the killer.

Why is OOP more apt for game development?

Wondering because I've been playing with UE4, and as fun as the engine is to use, I'm stuck with C++. I don't hate it, but I don't like it that much either.

Hey guys anyone fluent in C++ want to make some extra cash before the holidays? I have some intro level assignments that need to be completed. Compensation will be done via PayPal. Let me know at [email protected]

I like python desu

Different praradigms solve different problems.

OOP encapsulates state, basically a "class instance" is only a certain state of that class.

This comes in handy in games where you have a lot of tiny objects (=states) which interact with each other. So you can just add i.e. an event listener and when something happens you tell all other objects "hey, object, you have -20 HP" and the object decides "oh shit, I'm dead".


Concurrency is not parallelization..

Parallelization is rather easy, concurrency is rather complex, there's a lot to know here.

OOP is way too slow for game programming, sure it is used when you are turn-based or have certain aspects of a game that you don't care about running fast, but for the things you need every frame you aren't going to use OOP

OOP is a concept, not an implementation. There are plenty of shit implementations of OOP but that shouldn't discredit those who actually use it efficiently.

Most game engines worth a damn roll their own classes for strings and arrays and whatnot anyway. STL a shit

dont die pls