C is dead

C is deprecated. No one uses it and it's not even self-hosted anymore, its compilers themselves are written in C++. Development stalled for the last 3 decades, and the latest major update desperately tries to mimic C++98 templates and fails miserably.

If C++ is too hard for you, learn Rust, it has no OOP, overloading or templates (which seem to overflow a typical C tard's primitive peanut brain capacity). And using C and Rust both lead you to adopt a CoC anyway so you shouldn't be complaining.

C tards waste their time pointlessly reinventing the wheel (probably because no generics lol). C is popular in Jow Forums because making a linked list of int is what Jow Forums can manage to do.

Attached: 1539959093749.png (1834x1200, 639K)

Other urls found in this thread:

github.com/KhronosGroup/Vulkan-Docs/blob/1.0/src/vulkan/vulkan.h
youtube.com/watch?v=D7Sd8A6_fYU).
modelingguru.nasa.gov/docs/DOC-2676
modelingguru.nasa.gov/docs/DOC-264
ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20080039927.pdf
modelingguru.nasa.gov/docs/DOC-2642
github.com/nasa?language=c++
twitter.com/NSFWRedditVideo

ok but is modern c++ comfy? show me some comfy modern c++ code and i'll change my mind. in the meantime i'll enjoy my monster

>reinventing the wheel
the wheel has been reinvented many many many times, the wheels on your car come from ages of reiterating the same general idea. at the end of the day it's just wheels and the rest of the car is what matters

don't get me wrong user c and c++ are pieces of shit but imo the least shitty of them is c with the direction c++ is going (it's better in the same way that using duct tape to stop a leak is better)

also just curious but what are your thoughts on c with classes as opposed to full on c++ autism?

>comfy

>shaming people into not using C
kek like if that tactic ever worked in Jow Forums

>C89, C99, and C11 were about C++ templates

okay retard

>Be me
>Work in embedded development (ECUs)
>Work with other companies swearing on C++
>Their codebases are as bad as it can get, whereas most C codebases I've seen are perfectly fine - save for a couple of retards maintaining some
Fuck off. Your kind is cancer, stop forcing a language or a paradigm just because it's ""newer"". Use the right tool for the job - and sometimes this might just be C.

>C is dead
>github.com/KhronosGroup/Vulkan-Docs/blob/1.0/src/vulkan/vulkan.h
???

the consistency in having to repeat the same thing over and over again pleases my auts

yeah really, go look at any c programmer (like the stb guy for instance) and tell me that's somebody who gives a fuck about what OP has to say lmao

based

>using C++ when Common Lisp exists

Attached: .jpg (362x346, 38K)

>the consistency in having to repeat the same thing over and over again pleases my auts
that's the opposite of good programming you fucking retard
never get a job

i was poking fun at op's reinventing the wheel thing

My theory is that most people who do this are afraid of us leaving their autistic plantations where we have to suffer their package managers, codes of conduct, etc. C is a language completely devoid of any angle in which an sjw developer can insert their tranny cock and force others to do what they want.

Only hipsters hate C because it is too popular and mainstream for them.

C is a systems language, C should never have been used for user space programming, the unix designers made unix for themselves, it was never meant to be a user facing operating system. C is still the defacto systems language, no one in their right mind would use C++ and its black box template abstractions to do systems programming. Any C++ programmer who says they know how any part of the STL is implemented is lying. C++ was designed for user space systems, the only good part about C++ was its design of OO which became widely copied. Anyone who says they do metaprogramming in C++ is lying, its just used as a weak polymorphism

Only hipsters cling to mid 70's pretend boomer bullshit.

Attached: DnWSialX4AA20Gd.png (550x641, 312K)

We already had this thread. People are still using C. Time to delete yourself

>C hating meganiggerfaggot accuses anyone else of reinventing the wheel

Attached: 1528385180218.gif (272x281, 1.99M)

F77 is the master language. Only the most red pilled of programmers can wield its mighty power.

>do you even statement function bro

STRINGS, VECTORS, STL, BOOST
all this shit slow as f-ck
INSTEAD OF USING NAMSPASES CREATE MUH OBJECTS
then use em for creating memory leaks everevere

>next generation proprietary memory allocation techniques.

Attached: MEMORY_ALLOC.png (699x701, 269K)

Saw this good example from Dan Saks at cppcon 2016 (youtube.com/watch?v=D7Sd8A6_fYU). He used it as an example of making C programmers lives easier whilst not jumping straight into things like the STL. Unlike memcpy this function works on all types, ensures that the static array types and sizes match (easy to use correctly, difficult to use incorrectly). I modified it slightly to use C++17 if constexpr, which is a equivalent to a #ifdef but done within the language.

template
void array_copy(T(&dst)[N], T(&src)[N])
{
if constexpr (std::is_trivially_copy_assignable_v) {
memcpy(dst, src, N);
fmt::print("Using memcpy\n");
}

else {
for (size_t i = 0; i < N; ++i)
dst[i] = src[i];
fmt::print("using loop\n");
}
}


Here's another version if say, your codebase doesn't permit exceptions.

template
void array_copy(T(&dst)[N], T(&src)[N]) noexcept
{
static_assert(std::is_nothrow_copy_assignable_v, "T must be nothrow assignable");

if constexpr (std::is_trivially_copy_assignable_v) {
memcpy(dst, src, N);
fmt::print("Using memcpy\n");
}

else {
for (size_t i = 0; i < N; ++i)
dst[i] = src[i];
fmt::print("using loop\n");
}
}

whoops ignore the fmt::print statements, just needed to check that it was behaving properly.

use #ifndef NDEBUG blocks

Oh ffs its way too late, another mistake.

template
void array_copy(T(&dst)[N], T(&src)[N]) noexcept
{
static_assert(std::is_nothrow_copy_assignable_v,
"T must be nothrow copy assignable");

if constexpr (std::is_trivially_copy_assignable_v) {
memcpy(dst, src, sizeof(T) * N);
}

else {
for (size_t i = 0; i < N; ++i)
dst[i] = src[i];
}
}

if 4gag::g::thread.get_kewords.can_find(any!("programming", "C++", "C"))
println!(storage::local::get_pasta("autistic spam 32.txt").read_text().unwrap());
future::when(4gag::g::comment_cooldown_status != clear)
.std::thread.sleep(1);
.on_completetion( println!(storage::local::get_pasta("autistic spam 26.txt").read_text().unwrap());)

Attached: 1536432080312s.jpg (250x208, 5K)

Holy shit this might be the ugliest code I’ve seen in my life. Someones got to put c++ out of its misery.

Based.

What a load of retarded nonsense. FreeBsd, I3, and now the Linux kernel are all written in C and have codes of conduct. Cniles are pathetic.

The rust language itself offers nothing new and is poorly implemented. So what's left besides marketing wank and the community full of shills who harass everyone.

>The rust language itself offers nothing new
In comparison to C?
Can C even handle unicode strings? It's 2019 already.

C is never the right tool for any job.

Only took 81 seconds for a rust shill to respond. Thanks for proving my point.

What is this no generics meme I keep hearing about C? Just grab pointers and cast to (void*)

>no argument

try again, I'm

>no type safety
>runtime crash

>When to use C:
1) Maintaining an existing code base written in C
2) Making drivers and kernel modules and kernel hacking
3) Implementing an FFI, for example Java's JNI or extending CPython or using ctypes or cffi
4) Implementing a software library where a simple and long-term ABI is a requirement
5) Working on a large-scale open source project with thousands of contributors, C is preferred over C++ simply because it's easier to maintain strict guidelines and rules

Other than these, there are very few reasons to use C over any other language. There are edgecases where you might need to write C++ as C (for example when it is critical to fit data structures in the cache and indirections would lead to cache misses), but all in all you should generally prefer C++ and all its safety features over C (type safety, memory safety, exceptions, generics, standard library containers, etc).

Just dont be an idiot

>advocating weak typing as generics

When to use C++: never

Common Lisp is better.

Why do you use C instead of assembly? Completely unnecessary, just don't be an idiot.

CL is not suitable for the tasks you'd typically use C++ for, for example in performance critical applications, real-time applications or embedded systems.

Attached: 1544709762837.png (944x539, 57K)

>implying I dont

freedom and simplicity is better than defining redundant tools

CL does just fine when performance is needed by adding in types and optimizations

>SEPPLES
>simplicity
LOL

This syntax is disgusting

>CL does just fine when performance is needed by adding in types and optimizations
This is some low effort baiting.

>>SEPPLES
>>simplicity
Using C, declare a function that takes an int and returns a function pointer to a function taking a double and returning void, preferably without using typedefs and macros.

This language wars bullshit just keeps polluting this board. 99% of you are probably console warriors kids that grew up (not mentally).

t. someone who never used SBCL

Have fun with your spaghetti of a mess that SEPPLES is.

Literally the smartest people like scientists and researchers use C instead of garbage like C++ that is only used by code monkeys.

>t. someone who never used SBCL
probably because it's not useful
>appeal to authority, no argument

Attached: Screenshot_2018-12-14 Lisp SBCL vs C++ g++ - Which programs are faster Computer Language Benchmarks (1372x4026, 307K)

>t. someone who never used SBCL
Stop memeing. CL is not suitable for real-time applications and embedded systems.

>non-deterministic garbage collection
>memory exhausting runtime
>no mechanism for controlling memory locality of data

Why do C++fags have meltdowns over CLfags?

The only one having a meltdown here is the CL guy (you).

>t. someone who never used SBCL
That would be you.
Last time I checked, a hello world executable is almost 30 MB.

void d(double { ... }

auto func(int) {
return &d;
}


;)

If you knew anything about scientific computing, you'd know that C++ isn't even brought up, it's literally non existent.
modelingguru.nasa.gov/docs/DOC-2676

>c

NASA uses C. Enough said.
C++ is not suitable for real-time environments.

repeatedly appealing to authority is no argument

>i-it's fine we don't need one of the prime cases of run-time systems to use our language. t-they are just dumb, c++ is fine for real-time, don't listen to NASA.

They only use it for book keeping software. You can bet your ass they’re using a safe high level language for mission critical systems.

From that very website: modelingguru.nasa.gov/docs/DOC-264

That said, Fortran is still unmatched for scientific computing.
The moment you step into general HPC territory, however, C++ ia the superior choice.

>Development stalled for the last 3 decades
What development do you picture happening? C is a portable fairly thin abstraction on top of assembly for systems programming and as that it's pretty much perfect.

>Not Found
>The item does not exist. It may have been deleted.

lmao, posting fake links

>retard doesn't even know how appeal to authority works
What did I even expect from code monkeys?

Appeal to authority is only a fallacy when the authority is not an authority on the subject, when it comes to scientific consensus and the authorities being an authority on the matter then it isn't.

>Exception: Be very careful not to confuse "deferring to an authority on the issue" with the appeal to authority fallacy. Remember, a fallacy is an error in reasoning. Dismissing the council of legitimate experts and authorities turns good skepticism into denialism. The appeal to authority is a fallacy in argumentation, but deferring to an authority is a reliable heuristic that we all use virtually every day on issues of relatively little importance. There is always a chance that any authority can be wrong, that’s why the critical thinker accepts facts provisionally. It is not at all unreasonable (or an error in reasoning) to accept information as provisionally true by credible authorities. Of course, the reasonableness is moderated by the claim being made (i.e., how extraordinary, how important) and the authority (how credible, how relevant to the claim).

Javascript.

NASA uses C++, even your premise that NASA does not use C++ is false, let alone your easily debunk-able appeal to authority
ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20080039927.pdf
And your samefagging doesn't help either.

Sorry, messed up
modelingguru.nasa.gov/docs/DOC-2642

Attached: Screenshot_2018-12-13-17-34-19-126_de.baumann.browser.jpg (1080x891, 237K)

>draft, WIP
>last update 2005

kek, just because some employee that wanted to push C++ posted a style guide doesn't mean they use it.

>Appeal to authority is only a fallacy when the authority is not an authority on the subject, when it comes to scientific consensus and the authorities being an authority on the matter then it isn't.

Attached: 1512287655455.png (936x772, 28K)

github.com/nasa?language=c++

C++ is not suitable for real-time environments.

>it's not relevant of i don't like it
What was I expecting?

>Appeal to authority is only a fallacy when the authority is not an authority on the subject,
No, appeal to authority is a fallacy when not accompanied with the argument.

Saying "C++ sucks for embedded because NASA doesn't use it" is an appeal to authority fallacy, because the relationship between why C++ sucks for embedded and why NASA doesn't use it is not given. There may be many or even entirely nonrelated reasons why NASA doesn't use C++.

One reason ffmpeg uses C and not C++ is because, as large-scale FOSS project, it's simply easier to find people who can contribute with C rather than C++. This does not mean that C++ sucks, it simply means that the original developers of ffmpeg made a design decision based on the community.

GCC is implemented in C (it's using g++ to compile now because of STL containers, but most C++ code is discouraged, even generics and overloading). Saying that C++ sucks because GCC doesn't use it is an appeal to authority fallacy, it does not mean that C++ is unsuitable for compilers (see clang), simply that the maintainers of GCC have chosen to stick with C.

Literally look at the post right above yours and come up with an argument of more substance.

Care to elaborate?

Unless you can find some statement from NASA stating why C++ is unfit for their use case, a generic statement like "they don't use it so it's bad" is absolutely a fallacy. It's even more wrong since they do use it, as evidenced by the thread.

Attached: Unreal+Engine_ue4-on-github_Image1-858x317-04d36c69bd65ac31e86d02770bd39f3d5d883e56.png (858x317, 123K)

>literally missing the point
Look at the paragraph I quote.

If the authorities back their positions with evidence, then it isn't a fallacy, easy, in that case, a link to nasa.

>inb4 ">unreal engine"
The use of C++ is incredibly common in game development.

>Sepples suck because NASA doesn't use it

Attached: brainlet-1.png (543x443, 24K)

My argument:
>If you knew anything about scientific computing, you'd know that C++ isn't even brought up, it's literally non existent.
modelingguru.nasa.gov/docs/DOC-2676
>c++ not brought in article nor even linked articles, not comparisons at all using it
>hence barely used compared to other options like C

From that it follows that only code monkeys use C++, hence why it's a language for brainlets

>Sepples rocks because it has horrible syntax and is an absolute mess

Sure, what would you use in embedded development then?

Which means C++ is unfit for real time applications is false.
>If the authorities back their positions with evidence
I don't see any statements from NASA backing your claim that C++ is unfit for scientific computing. You actually can't because someone ITT already posted a link that shows a subset of NASA's C++ projects in scientific computing on github.

It seems that C users of Jow Forums form their strong belief based their emotion rather than facts.

>it's not evaluated in this single link/use case, therefore this is evidence that it isn't use
I hate to quote religiousfags, but they sometimes have a point:
Absence of evidence is not evidence of absence.

In this case, the fact that C++ is included in this specific evaluation does not mean that it isn't worth evaluating at all.

Rust

Java

>It seems that C users of Jow Forums form their strong belief based their emotion rather than facts.
Don't drag all of us into this. I'm a C user (as in I work mainly with C), but I clearly recognize its shortcomings and would recommend C++ over it any day any time.

None of the other comparison's on the site use it though, one of the linked articles in one of the older comparisons claimed to use C++, but it was pretty much just C , so yeah...

ECL

>None of the other comparison's on the site use it though
This is not an argument for anything. It simply means that for those comparisons, it wasn't compared. As demonstrated by the user that posted a link to their repos, they clearly use C++ for a lot of stuff, there under including scientific computing.

>comfy
Kill yourself

True enough a lot of the reasons we still use fortran, C and IDL is because of old code and a lot of researchers don't want to learn new languages, but they still perform excellently.

But the overall feeling I get from either from asking online or on the department is that C is faster and that's why we don't use C++.

>But the overall feeling I get from either from asking online or on the department is that C is faster and that's why we don't use C++.
As someone who programs both C and C++, this is a cop-out answer either given by someone who doesn't understand how systems work, or by someone who can't be bothered with justifying his views and resorts to parroting.

I work with C all day in my day job, but C++ is a better language. It is more complex and has a few gotchas that you need to be aware of, but in all regards C++11 and newer is a modern language, while C is a remnant from the past and barely any more than a portable, human-readable assembly.

C++ is fucking awful and the syntax makes any sizable project turn into a spaghetti code wannabe that is so annoying on the eyes. The only people using C++ are monkeys in enterprise who are forced to because their company's legacy apps are in it due to some chucklefuck who thought it was a great idea at the time over C.

>the overall feeling I get from either from asking online or on the department is that C is faster and that's why we don't use C++.
it's not faster, that's just sunk cost fallacy speaking

>baby duck syndrome

C with classes is a terrible language.