Reminder that C is simply inappropriate for writing performant code

Reminder that C is simply inappropriate for writing performant code.
Not only does C make it difficult and tedious to write efficient code efficiently but it even lacks a lot of the facilities to make it possible.
C cannot monomorphise code based on type or value parameters at compile time or specialize parts of code based on type traits.
C cannot create efficient abstractions that allow you to naturally and easily write efficient code.
And in fact C makes it so difficult that most C programmers simply do not bother with it (considering the alternative is repeating the code for each possible case) and prefer to use less efficient solutions like void pointers and runtime metadata which erases valuable compile time information that the compiler could've used to optimize.
C lacks the ability to design general interfaces with automatically specialized implementations at compile time causing C programmers to prefer shittier, less efficient, less powerful, less maintainable and less elegant interfaces.
This extends to all the other zero-overhead abstractions that C potentially could have but lacks, causing C programmers to fall back to inferior solutions.

C is not good for writing efficient software.
C is not good for writing well designed software.
C cannot into efficient abstractions.
C is not good for high level application development.
C is not even good for low level systems programming or embedded anymore, and is continually being proven inferior in that field.
C is not good for anything.
There is no field that C excels at over other programming languages, there is always a language better and faster than it, and most of the time that language is C++ as it addresses every issue I've brought up so far.
The difference between C and C++ is that C allows you to write highly efficient code in theory, while C++ allows you to write highly efficient code in practice.

tl;dr if you're looking to write fast code, C is the wrong language.

Attached: 1532769521370.jpg (622x815, 397K)

Other urls found in this thread:

youtube.com/watch?v=zBkNBP00wJE
twitter.com/SFWRedditImages

>this is your mind on sepples

Attached: 1553040071076.jpg (1000x600, 117K)

Bad shitpost try again

Attached: bait.png (1126x1900, 3.3M)

What is the right language? verilog?

C++
Latest standard

And yet there isn't a single language that rivals the power of C/C++. Rust can't, Go can't, Java, python? pfffhh

Javascript

>C/C++
This programming language doesn't exist.
Did you mean one of the following?:
C
C++

Who is that girl?

So what use Rust and let our girlfriends and wives be ravaged by negros?
Sounds like a dumb plan desu

Why don't you reverse image search it yourself and find out

No, of course not. Rust isn't fast nor does it allow you to write elegant and efficient interfaces.

Attached: 1542612128701.png (900x2648, 296K)

You know you can use both at the same time, right?

you think you can just post a cute anime girl and get away with everything dont you?

You mean I can't?

Attached: 1546123714092.jpg (540x840, 324K)

i sort of agree, in that writing C that attempts to adhere to OOP abstractions is tedious and stupid.
i think you are not seeing the use case for embedded systems in which things like virtual function tables and raii are usually not possible.

>embedded systems in which things like virtual function tables and raii are usually not possible.
Of course they are.
They may not be appropriate, at least virtual methods, but they definitely just werk.
And there's nothing unappropriate about RAII in embedded. RAII is literally just automatically inserting destructor calls for you instead of you inserting them yourself.

OOP abstractions are tedious and stupid.

but user, why does the destructor automatically get called? because the object is on the stack. embedded systems generally don't have large enough stacks to accommodate large programs that make use of raii. some microcontrollers i've worked with can't into function tables either

Why are you assuming the program is large?
RAII is fine for small programs too.
Check out this video. He writes a game in C++17 for the commodore 64.
youtube.com/watch?v=zBkNBP00wJE

B-b-but memory safety!!

while i watch this boring video can you post more anime girls with nice thigh creases

Attached: 1540079343165.jpg (596x821, 340K)

Attached: 1548058881296.jpg (739x850, 277K)

post more bandori girls

god i wish that were me

fuck off tranny

I hope this isn't too NSFW

Attached: 1552340065041.jpg (624x850, 314K)

Attached: 1459239762488.jpg (723x691, 99K)

wtf is wrong with you, disgusting pedo scum?


why aren't you just dead yet?

pedo weebsite

Attached: 1539769712905.jpg (601x812, 353K)

Attached: 1537771536105.jpg (708x1067, 597K)

Attached: 1537308899919.png (1087x1184, 925K)

they're at least midschooler to me

What about this?

Attached: 1539930565795.jpg (646x850, 322K)

If you keep calling everyone who likes cartoon pictures of obviously developed girls pedos, being one will soon be considered entirely normal.
You're normalizing pedophilia.

ok i watched the entire video on 1.25x speed and i have a few thoughts.
one: i have to say i agree with your premise for the most part. c is still faster in benchmarks but it takes much longer to develop.
two: using intelligent planning with c code (i.e. not forcing oop or doing retarded state piles) can still be an effective strategy for those who don't want to put all the super optimizing effort in like he did.
three: you have impeccable taste in 2d harlots.
much respect user, even if you were trying to bait people

You don’t just write C programs. You write them also for the Unix command line obeying POSIX standards and interfaces. These days microcontrollers are running Unix with soft real-time so there’s no need to whine about the size of the hardware.

elementary school

not into underage, post something similar to OP

>three: you have impeccable taste in 2d harlots.
Thanks!
>can still be an effective strategy for those who don't want to put all the super optimizing effort in like he did.
The optimizations he did are far easier to achieve in C++ than it is in C, and he didn't have to put a lot of time into "intelligent planning" either. That doesn't mean you can just not think about it, that's dumb, but you don't have to spend extra time planning purely to work around or fit C's limitations. I think that's objectively a good thing.

The philosophy of piping programs together is outdated and more importantly inefficient as your programs waste of a lot of time copying data around (twice), parsing text, and doing context switches. The unix philosophy is bad in that way.
It is better to apply the unix philosophy to libraries instead, and enable LTO.
The core utilities are still useful for small things and should be kept, but anything less trivial than that is better not done by piping a bunch of processes together.

Attached: 1555162704772.png (804x1130, 647K)

Attached: 1553702030720.png (1198x1193, 951K)

Piping is great for automation. Why would I write a whole new program to automate a simple task when I can write a one line bash script instead?

Yeah when you write C you write against 1970's teletype devices.

>The core utilities are still useful for small things and should be kept, but anything less trivial than that is better not done by piping a bunch of processes together.

Attached: 1548361132467.jpg (646x850, 230K)

Data structures are usually more important than algorithms for performance on modern computers. C gives a lot of control over how data is stored in memory.

>unix philosophy
how is cs101 going?

expose the program as a library and automate it using a programming language, like how python is used to script c and cpp libraries.
Too many languages? Program and script in the same language by using a self-hosting language.
Need IPC? Don't separate related programs into separate address spaces and let programs share functions, data structures, classes and methods.
Welcome to Symbolics Genera.

So does C++. You're not forced to use the standard containers, but they're there for 90% of cases.

All of the useful parts of C are compatible with C++. It's much easier to express data structures correctly and safely in C++ than C because you can control memory automatically and overload operators to work on your data structures.

You seem to misunderstand. I'm not saying the unix philosophy is good. I'm saying if you really want to apply it, it's better to apply it to libraries, not whole programs.

Attached: 1540992745275.jpg (576x750, 247K)

C is good because it prevents people from doing stupid things like operator overloading, and inheritance, which only make the program harder to understand.

cute Lisa

>anything less trivial than that is better not done by piping a bunch of processes together
No thanks, I would rather keep the flexibility/simplicity. If you want something done fast avoid ipc shit.

C is bad because it allows people to do stupid things like buffer overflows, and null dereferences, which only make the program unstable and insecure.

>buffer overflows, and null dereferences
learn to code

>operator overloading, and inheritance, which only make the program harder to understand.
Maybe for low IQ retards.
Inheritance is shit most of the time, don't get me wrong. It all comes down to using these things correctly.
C++ is not a language that is friendly towards retards, nor should it be. You have to know what you're doing just as much as you do in C.
Operator overloading when used correctly can greatly improve the readability of source code. Same with (virtual) inheritance, when used where it makes most sense.
Example, overloading operator[] for containers. Overloading all the arithmetic operators for arithmetic types such as complex numbers and vectors. Overloading the dereference operators for smart pointers. Using virtual inheritance for drivers (used a ton in kernels).
You just need to know when to use them, and when not to use them. Which usually isn't much of a problem for anyone who isn't a retard.

>If you want something done fast avoid ipc shit.
That's basically what I'm saying. Piping a bunch of programs together is bad for performance.
If you don't give a shit about performance then sure, go ahead. May as well use Python or some other equally trash language while you're at it too.

Attached: 1548273125602.jpg (453x874, 259K)

>Not only does C make it difficult and tedious to write efficient code efficiently but it even lacks a lot of the facilities to make it possible.
This literally translates to "I'm a shitty programmer and someone else didn't make the stuff that I need but can't make myself"
C is the most efficient language for the stuff that it is used and in theory is still the most efficient for everything if one has the time to write for months what other languages would do for weeks, even though the C alternative will surely be faster and hardware efficient. Efficient code is not something that good programmers have to tryhard to achieve. And all these "facilities" are not inbuilt but can easily be made with C, usually in a much more efficient way than their premade counterparts into other languages. The only downside to them in C is that they are strictly meant to be used in the particular program in most cases. It's kinda lame for people who don't know C, nor they need C in their programming, to give their opinion. Just go back to javascript and let the big boys work.

Undefined behaviour allows the compiler to do better optimizations without wasting cycles checking for bad code. Operator overflowing just makes code more ambiguous. The proper way to do abstractions is with functions.

>C is the most efficient language for the stuff that it is used and in theory is still the most efficient for everything if one has the time to write for months what other languages would do for weeks
Yes, in theory.
>even though the C alternative will surely be faster and hardware efficient
Not if you use an actually good language.
C++ allows you to achieve the same performance and control of C in less of the time.

Attached: 1531748752556.png (854x1084, 641K)

*operator overloading

No, you either compile C or C++

>Operator overloading just makes code more ambiguous. The proper way to do abstractions is with functions.
The only way this could be true is if you're unfamiliar with the operators, or it's done badly.
As I said, operator overloading done correctly makes a lot of sense.
I'd much rather see
container[i]
and
a * u + v
instead of
container.at(i)
and
u.prod(a).add(v)

WHY
IS
THIS
THREAD
NOT
CLOSED
YET

Why would it be

>May as well use Python or some other equally trash language
There is no reason you can't have simple fast programs + a bloated scripting language linking them together to aid in usability. Why are you such a retarded extremist? Why is it so hard for you to understand that there are different tools for different jobs?

actual discussion on Jow Forums and not mindless consumerism? you have to close it immediately

The only reason you'd need a bloated scripting language to link them together is if your other language was complete trash and had no support for efficient abstractions.
Not to mention you're also wasting time and cycles making the bindings for it.

Attached: 1544110756734.png (816x1303, 888K)

>The only reason
Nope, I don't want to waste time on development which is why your oop shit exists in the first place. Why the fuck do you think python + numpy is so popular?

>I don't want to waste time on development
That's why you use an actually good language that allows you to achieve the performance of C with less of the effort and time.
>your oop shit
huh?

scantily clad women an a work-safe board

Can you guys not respect the work-safe aspect of this board or something? Why post this anime crap?

There's nothing NSFW in this thread.

You're joking right? Anime girls in bikinis with cameltoes and tits hanging out is without a doubt NSFW. If a coworker walks by my work area and glances at my monitor those pics will be the first thing they see and my job is jeopardized.

How is this difficult to understand?

how about not using Jow Forums at work idiot

Are you retarded? There are SFW and NSFW boards on Jow Forums. Jow Forums is a SFW board. Stop posting this crap.

Do you not have a job? Do you not understand thow this works?

There are no true SFW boards on Jow Forums.
If you think you can browse the front page of Jow Forums at work you're retarded.
You're retarded for browsing Jow Forums at work to begin with.

The thing about IPC is that it's just not a problem for single address space systems. You can just give a different program a pointer to some data, or a function, class definition or whatever have you.
An IPC model of single-direction octet streams as the only means of communication is obviously shit.

C is only the 'most efficient' language because its prevalence limits what can be done with conventional hardware. No C standard allows for a programmer or a compiler to manually weight branch prediction, for example.

Undefined behavior is what's behind most security faults in software. Not to mention that these issues are often introduced by compilers, meaning that to move the responsibility for secure code to the programmer means adding practically full understanding of the compiler to his responsibilites as well.
also in reasonable languages operators aren't different from functions. Maybe they have special syntax.

I do have a job. Generally they frown on using the work network for personal use. I actually got Jow Forums blocked at my university VPN, too, for "questionable" content

>unironically browsing sites like Jow Forums while at work
You deserve to be fired.

You've never had a job in your life. You wouldn't be saying this otherwise.

I'm not a programmer by trade but I have to sit in an office with other people sometimes. I'd like to browse Jow Forums but can't because of autists that need to post anime porn on SFW boards.

>The thing about IPC is that it's just not a problem for single address space systems. You can just give a different program a pointer to some data, or a function, class definition or whatever have you.
Sure, if you can do that go ahead. It's not too different from using threads anyway.

I already saw this thread, but I still agree with it.
However, let's not pretend that C++ is "good". It's bad, but (at least since C++11) it's less bad than C.

Attached: 6C5D1C60580042A0B41629022A93CB63.jpg (575x982, 123K)

Why do people visit Jow Forums and complain about anime? I'll never understand it. There's much worse NSFW shit being posted than clothed anime girls

Jow Forums doesn't use the same definition of NSFW as you. If it did all boards would be red.
Fuck off and actually do your job.

>calls others autists
>rather browses Jow Forums than socialize with his coworkers

I teach at a high school in China. No socializing, and you fucking virgin autists have to post these pictures for some reason.

>The philosophy of piping programs together is outdated and more importantly inefficient as your programs waste of a lot of time copying data around (twice), parsing text, and doing context switches. The unix philosophy is bad in that way.
Finally someone who points this out.
You just have to use Emacs for a while to realize how exposing functions instead, and reusing the code directly, is a much better form of code reuse for scripts and automation. That's what Lisp machines did.

> being this retarded
> doesn't understand the / represents OR
> C OR C++
how did you manage to end up this fucking retarded?

see:

it brings shame, gore at least makes you look edgy

Attached: 1540550073514.jpg (640x426, 80K)

>Efficient code is not something that good programmers have to tryhard to achieve.
Anyone who believes this has never written anything where performance really is important, nor anything with more than one thread of execution. Writing truly fast, efficient code is hard no matter the language. And purely functional languages actually make writing heavily parallel code easier.

Yeah I'd rather my boss saw an anime girl then gore or scat which does get regularly posted on Jow Forums so what the fuck are you doing visiting this place at work

To get you fired obviously.

on Jow Forums? Where?

Gore and scat is more sane (and legal) than pedoshit.

Attached: 1552862132296.png (1255x1403, 186K)

>Writing truly fast, efficient code is hard no matter the language.
not really, compiles should produce fast effcient code by default

You obviously didn't mean OR, because almost every language rivals C in some area. Except Python.