[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Impressive C\C++ Programs

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 66
Thread images: 5

File: 1452073157348.jpg (105KB, 1052x1342px) Image search: [Google]
1452073157348.jpg
105KB, 1052x1342px
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]
>>
>>58074011
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
>>
>>58074011
https://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.
>>
>>58074207
C runs faster than C++. This is a fact.
>>
>>58074215
The differences aren't huge, though.
>>58074011
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.
>>
>>58074011
Fizzbuzz
>>
>>58074011

You learn C when you learn C++.
>>
>>58074215
That's a meme. You get the same binaries with C++ as you do with C.
>>
>>58074245
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.
>>
>>58074207
try to write library for other languages to bind to, c++ sucks.
>>
>>58074245
inheritance is a meme though
>>
File: 1461104063337.png (721KB, 830x987px) Image search: [Google]
1461104063337.png
721KB, 830x987px
>>58074320
>Writing a HUGE Fucking kernel in non maintainable code.
>>
>>58074215
no. c++ is actually faster
>>
>>58074867
If you say so hoss
>>
>>58074981
ever heard of constexpr?

https://roartindon.blogspot.be/2014/10/compile-time-murmur-hash-in-c.html
>>
>>58074011
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).
>>
>>58074297
>>58074867
Why are you spreading false information on the internet?
>>
>>58074245
I'd love Go-style OOP in C.
>>
>>58074693

yeah so just don't use it incorrectly (or at all if you can help it)
>>
>>58075037
see >>58075020
and that just one example. c++ has more optimization rooms than c, especially with the templates.
>>
>>58074207
>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)
>>
>>58075056
Still spreading your lies? I'm gonna let you believe whatever you want but your link proves and means nothing in this debate
>>
https://www.youtube.com/watch?v=tCRPUv8V22o
>>
>>58074207
>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.
>>
>>58075075
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.
>>
File: systemd_logo_small.jpg (33KB, 640x372px) Image search: [Google]
systemd_logo_small.jpg
33KB, 640x372px
Pic related.
>>
>>58075161
>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.
>>
File: based_linus.png (39KB, 625x675px) Image search: [Google]
based_linus.png
39KB, 625x675px
>>58075372

daily reminder why the linux kernel is not written in C++
>>
>>58075548
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.
>>
>>58075107
Test std::sort against qsort, friend. Or anything that takes function pointers instead of template arguments.
>>
>>58075548

And he's right: OOP is a mistake, C++ is a mess and abstraction is creating retarded programmers.
>>
>>58075683
>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.
>>
>>58075683
>daily reminder that he admitted linux is bloated mess.

Yeah, intentionally and by design. It's how the bazaar model works.
>>
>>58075749
>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.

>>58075749
>intentionally and by design
not really
http://www.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.
>>
>>58075730
You can go back to wonderland and believe... whatever you want to believe.
>>
>>58075986
>shared_ptr
>marginal performance cost

Haha.
>>
>>58075986
are u fucking dumb? C has all those move semantics shit. u just dont write std::move instead just pass as ref pointer.
>>
>>58076038
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.
>>
>>58078178
How would I do logic programming in C?
>>
>>58078223
Because you can do it does not mean it's easy.
developping the whole jvm is a lot of work for example.
>>
>>58078272
Then what's your actual point?
I can write a C compiler in Brainfuck - what does that say about anything?
>>
>>58078298
>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.
>>
>>58074011
>impressive
>written in C
>>
>>58078178
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.
>>
>>58074095
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
>>
>>58078465
It's easier than ever to develop and distribute games.
>>
>>58078490
That's not my point
>>
>>58078502
What is your point?
Masters of Doom was all about a small independent group of misfits hitting it big.
>>
>>58078547
The then radically new technologies and techniques
>>
what's wrong with C#
>>
>>58080349
It's not near to the bare hardware.
>>
>>58080349
It's the new Java and attracts pajeets.
>>
>>58074011
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.
>>
>>58080480
>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".
>>
>>58081162
Concurrency is the killer.
>>
>>58078429
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.
>>
File: 1462503142983.jpg (56KB, 717x775px) Image search: [Google]
1462503142983.jpg
56KB, 717x775px
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
>>
>>58081392

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".


>>58081202

Concurrency is not parallelization..

Parallelization is rather easy, concurrency is rather complex, there's a lot to know here.
>>
>>58082186
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
>>
>>58082929
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
Thread posts: 66
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.