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 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: 1523367126149.jpg (1128x986, 737K)

Other urls found in this thread:

queue.acm.org/detail.cfm?id=3212479
github.com/jypma/AvrLib
youtube.com/watch?v=zBkNBP00wJE
twitter.com/SFWRedditImages

Good luck convincing the suckless autists here. They'll just scream "closer to da hardware" while ignoring everything else and citing compilation times.

>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++
People who say C++ is a good programming language are dumb. Y'all motherfuckers need to shut the fuck up and go back to CS 101. C++ an ass of a language and is still doing nearly as well as it does out of sheer inertia and literally nothing else. Every single real developer who says C++ is good is either a lying little kid who thinks he's cool for using a "real" language or a crusty old fart who've been too busy manually hardcoding his own diabetes medicine to look outside in the last 15 years.

>b-but, but...
NOT BUTS. C++ is shit. Every single possible positive thing you could say about C++ involves C++ acting like some language other than C++. Even now I can hear your filthy cheetos-stained mechanical keyboards rattling away, typing those same old tired bullshit arguments about "performance", "optimization" and how it gives "good coders" the power to do amazing things (and make lots and lots of hair-pulling mistakes). Except you pissheads forget to mention one fatal detail: All these amazing things are only possible because C++ allows you to drop down into C and manually reinvent the wheel every fucking time. C++ is at its best... when it's actually C.
In contrast, when C++ is used As Intended™ you get literally nothing out of it but a compiled version Python with irritating syntax, annoying header files, frustratingly obtuse compiler errors, aggravatingly small standard library and a rage-inducingly fussy manual memory management.

>b-b-but doesn't that m-mean C++ p-possesses flexibility that other langua--
I SAID NO BUTS YOU STAMMERING DICKSHEATH. C++ is only that way because it's a frankenstein's monster of a cruft-ridden idiotic attempt at modernly squaring a 1967 circle. If you had any sense you'd realize what a goddamn mess it is and switch to Rust already.

I’m gonna need sauce

>b-but my legacy project from the 90s uses C, therefore it must be good!
C is literally the COBOL of the 90s.

I hate C as much as the next pajeet but that entire post was basically 12 different ways of saying C should have generics.

>All these amazing things are only possible because C++ allows you to drop down into C
This is the argument of someone who doesn't understand C++.
Also, if you think this is somehow an argument against C++, there's something wrong with the way you think.
C is so shit that the only way to use it effectively and efficiently is through another language.
The thing you don't get is that C++ allows you to abstract and generalize that C into efficient, high level, powerful abstractions. Something that C on it's own can't do.
>every fucking time
You're thinking of some other language.

>switch to Rust
Rust is another language that is almost always better and faster than C.
However the difference between C++ and Rust is that one treats you like a braindead retard who hasn't got a single clue what they're doing, while the other one doesn't.

This cult of programmer productivity, development speed and convenience and high-level abstractions uber alles, is behind everything that's wrong with modern software.

Yeah you're right, we should continue using shitty languages and writing shitty inefficient unmaintainable code.

Also, you seemed to have completely missed the point about performance, which was kind of 90% of the post you're replying to.
Good job on being blissfully ignorant though. C programmers seem to be quite good at that.

Too bad all drivers and all OSs are written in C, so that kinda makes your point nothing but a dog barking at a wall.

>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.
As an electronics engineer I can say that you are laughably wrong

Yet it's still the fastest, how do you explain that?

>have access to higher level languages
>still manages to produce unmaintenable blobs of code
tell me again how's the language fault and not the code monkey writing it. As far as I'm concerned programs don't write themselves.

No you're wrong: high level abstractions often make software harder to maintain.

it is not the tool, but who is useing it

OP is confirmed for language bikeshedding brainlet

is that his sister?

gang of four style object oriented design patterns do often make software harder to maintain

modern C++ generic programming is a joy to maintain IF you know the language well

Except it isn't.
It only looks that way because C is always used when performance is needed.
However that's a misguided decision. It can be faster than that, and much cleaner than that, if you used a better language.

Any person to do with hardware is often completely and utterly retarded when it comes to software so that's no surprise that everyone in your field is ignorant and uninformed as fuck when it comes to software and programming languages.
Your opinion on software is utterly worthless. Equivalent to dog shit.

Non argument. Uninformed retard.
You are missing the point. And that is a typical uninformed argument of a C programmer.
First of all, retarded people should never be considered ever.
And with that out of the way, the language does matter, because it determines how easy it is to do something, such as writing both efficient and high level code.

Small correction: Only if you don't understand the abstraction, which is typically the case for C programmers.

The tool matters.
If you disagree then go unscrew a screw with a saw.

Yes.

>object oriented
We're not talking about that here at all. Please stop.

Based.
Not only that, but because of the compiler having more information about the program, C++ can also be faster in theory, not only in practice.

I saw this pasta months ago.
Amazing how none of these complaints are technical.

>Any person to do with hardware is often completely and utterly retarded when it comes to software so that's no surprise that everyone in your field is ignorant and uninformed as fuck when it comes to software and programming languages.
>Your opinion on software is utterly worthless. Equivalent to dog shit.
Here's a newsflash: Programming languages are not only used to make PC software. Your opinion is clearly equally worthless when it comes to anything outside your own narrow field, and thus you have absolutely no right to say anything about it, including what programming languages are good.

>closer to da hardware
C isn't even a low-level language queue.acm.org/detail.cfm?id=3212479

When it comes to programming your own devices you designed, you're still fucking hopeless, and an actual programmer would do far better than any hardware shitter could do if given the specs.

Hahahahaha

darashinai imouto ni itazura shitemita 2
Learn to use saucenao.com you dumb niggerfaggot.

Do you have any idea how a computer works?

Generic programming isn't free from problems either.

Most modern problems stem from the "everything is a nail" phenomenon when simple programs are designed as if being a multi-million LOC beast maintained by hundreds of people. Sometimes just writing some simple code is the best choice.

>C is not even good for low level systems programming or embedded anymore, and is continually being proven inferior in that field.
I have no idea about that other shit, but there's really no alternative to C for embedded except asm if you like pain. No, Rust is not an alternative.

Reminder objective-c is based

Typical uninformed argument of a C tard.
I know how computers work, probably better than you.
Here's a question for you: Do you know how programming languages and compilers work? Are you aware of the fact that compilers can do things for you at compile time without introducing any runtime overhead whatsoever?
No of course you don't because you don't actually know anything about computers.

Laugh all you want, but hardware people's opinions on software are dogshit worthless. You are clueless.

>Sometimes just writing some simple code is the best choice.
And C++ allows you to do that efficiently (in terms of runtime performance, and programmer convenience).

C++ is certainly an alternative. You're just uninformed and don't know anything about C++. You probably think C++ is like Java or C#.

>C++ is certainly an alternative.
Haha, no.

t. uninformed retard
If there's a compiler, and there usually is, C++ is always the better choice on embedded.
Even for embedded applications, the abstractions C++ allows you to build benefits you everywhere.

Learn English before learning how computers work.

Memory leaks, a very frequent source of pain in current software, are caused by bad abstractions.
Buffer overflows often happen due to bad abstractions (null-terminated lol).
Hell most memory corruption exploits are avoidable. The cruft C left on software will be felt for centuries.

>multi-million LOC beast maintained by hundreds of people
this is true for many projects, but in my experience generic programming results in the least possible amount of code for any moderately complex libraries.

simple example: algorithm operating on multiple types with slight variations in implementation

more importantly, lots of early design decisions - especially when it comes to types - turn out poor. generic programming allows you to postpone those decisions, e.g. replacing float with a fixed point type and all the algorithms still work

I'd just like to interject for a moment. What you’re referring to as C++, is in fact, C/C++, or as I’ve recently taken to calling it, C plus C++. C++ is not a language unto itself, but rather a superset of a fully functioning C system made useful by the C standard libraries, idioms and compilers comprising a full programming language as defined by Jow Forums. Many developers program in a modified version of the C programming language every day, without realizing it. Through a peculiar turn of events, the version of C which is widely used today is often called “C++”, and many of its users are not aware that it is basically the C programming language, developed by Bell Labs. There really is a C++, and these people are using it, but it is just a part of the system they use. C++ is the abstractions: the layer in the language that allocates the machine’s resources through higher-level syntax. Abstractions are an essential part of a programming language, but useless by themselves; they can only function in the context of a complete programming language. C++ is normally used in combination with the C programming language: the whole system is basically C with C++ added, or C/C++. All the so-called “C++” dialects are really extensions of C/C++.

Attached: 1534973815424.png (1164x1738, 2.17M)

>(you)ing everyone to get the slightest chance of attention
wew

thx bby ily

Attached: 1533868658546.jpg (740x960, 180K)

Pic sauce?

Read the thread

The very best language is "old school" C++ (i.e. C with classes).
You have the performance of C with a few nice things from C++ to better manage your program (namespaces, classes, templates, etc.)

Nice. I'm mostly on avr, so please find me a c++ compiler that works properly. It's not like avr is an obscure architecture either, it's one of the biggest. But even if you could use c++ for that, why would you? What does it add except complications?

Yet you replied

Attached: image.jpg (315x315, 107K)

sakura is so fucking hot

avr-g++ and github.com/jypma/AvrLib do the job.
As for what it adds,
>namespaces
>templates
>better encapsulation
>more solid const-correctness
>safer memory management via references, even better if you can use smart pointers
>potentially better performance due to more compiler information
And so on.

Not true, C++11 thread support alone is a huge reason to prefer modern versions, and much better than pthreads.

So what language do you recommend instead of C to satisfy most of those complaints, OP?

It's a dumbed down version of POSIX threads.

I'm sorry, but, have you ever worked on an embedded project in your life?

I think it's pretty safe to say he hasn't.

Samefagging the same wonderful arguments.

More like a verison without the "unnecessary complexity" that Cniles repeatedly blame on C++.

>m-muh shills
Go to bed Bjarne, you're drunk again.

It's like you didn't even read it.

>shills
How illiterate can you be?

this
parts of my common laptop firmware is written in C++

You tell me? I remember distinctly saying that there's no alternative to C for embedded. Not that there doesn't exist some obscure way of pajeeting some C++ into an avr if you really want to. An alternative implies mainstream tools and a developmental ecosystem.

Attached: Dunning Kruger Chart.jpg (639x470, 22K)

I read the tl;dr

C++, which satisfies all of those complaints.

Great argument.

While I mostly agree with OP, C is good for what it was designed to be: a tool for making Unix portable. If you view C as a fancy macro assembler that really abstracts the low-level arch, C is a great language that is very successful at what it does. Unix/Linux has been ported to pretty much everything and Unix = C, C = Unix.

Shoehorning C to be something it's not is why there are so many security problems.

For the professional embedded projects you've worked on how much memory did you have? Mbs or even Gbs? Do you go to the IC guys and ask them to put more eeprom? Have you done any DSP programming, if so I'd love to see how you managed the memory footprint vs performance using c++

speak for yourself pajeet. For those who adhere to the unix philosophy, the best data structure to use is the simplest one, not the one which offers the best performance.

If getting C++ to run on an embedded system is "pajeeting" then getting C to run on an embedded system is pajeeting.
C and C++ are not much different in that regard, you clearly don't understand C++.
It's literally the exact same fucking procedure. Target your compiler to your platform and start writing code. The difference is in the abstraction facilities the language provides you, 99% of which do not require any runtime support.
The only parts of C++ that need runtime support are exceptions and RTTI, and you can quite easily live without those and one of them is rarely used at all.
If you target a bare environment with no standard library and support library, you get a tiny runtime footprint just like C or smaller but with 99% of all the language features of C++.

The memory footprint is exactly the same or less than C.
C++ isn't Java or C#. You've fallen for memes.

We're not talking about data structures, and I'm not going to bother refuting your "argument" because it's fucking stupid.

*programms cpp like c*, look see how good my overhead is! Theres a reason fft algorithms are coded in either c or assembly.

Tell us what embedded systems you've worked on using this process?

>Assumes I program C++ like it's C
The more you post the more you make it obvious you don't actually understand C++ or compilers in general.
Take a look at this video youtube.com/watch?v=zBkNBP00wJE and learn something before arguing about topics you have absolutely no clue about.

Mips1 machine with few kb of ram and rom.

Well perhaps Im dated, I mainly use an inhouse assembler to code audio algorithms in dsp asm.

Either way, youre argument is the same as a toddler slamming a square cube into a triangular hole. Just cause cpp can work for the specific case doesnt make it the best choice.

>weeb having incredibly stupid opinions
Checks out.

>Either way, youre argument is the same as a toddler slamming a square cube into a triangular hole. Just cause cpp can work for the specific case doesnt make it the best choice.
Basically "la la la la la I can't hear you~ I won't accept it~ la la la la la~"
C++ is a better choice than C for embedded because it's easier to create smaller and more efficient code in C++ than it is in C.

>anime
Into the trash it goes

>it's easier to create smaller and more efficient code in C++ than it is in C.
lel

Anime website.

Attached: 1508695679983.png (541x702, 361K)

Do you have brain damage? Are you overdosing on drugs?
For starters, your CPU is anything but simple. Read Define a "simple" data structure, because STL containers are exactly that, simple and correct.

I know, it's a lot to swallow for a C simpleton.

every second post here reminds me of this

All the C programmers in this thread.

If it's easier to create smaller and more efficient code in C++ than it is in C then why don't people do it then? Pajeet btfo.

Attached: pajeet_please.jpg (780x863, 109K)

>you will never reach as much confidence as you had before knowing shit
Why even bother with learning anything?

[citation needed]

Attached: we wuz weebz.png (772x2344, 774K)

Isn't Jow Forums just as big if not bigger than /v/?

Because, as is clear in this thread, the vast majority of C programmers are dumbass retards who ignore any evidence of C++ being better than C and come up with half-assed excuses and "arguments".

Attached: 1529885578916.jpg (897x445, 202K)

>C is not good for anything.

That right there is all I had to read to know you're a Pajeet who learned Computer Science through Javascript and Ruby.

Link me your github, and let's see what you have done.

Attached: How_Do_Communities_Work.png (800x2810, 580K)

I hate dynamic languages and I have literally never even touched Ruby before, but nice try.

>Link me your github
I'm not linking my github here fuck off.

It's not C programmers who produce the not smaller and not more efficient C++ code in question, though. It's C++ pajeets.

And you have no proof of that.

Are you saying C programmers are sneaking in and making the C++ code less efficient to make pajeets look bad?

>implying I implied anime wasn't allowed
>putting a false-report ban
>what is "Inspect element"?
Why are all weebs, without any exception, incredibly retarded?

>implying "a variety of topics" means "anime"

Attached: brainlet49.png (394x450, 17K)

/thread

Why not C/++

>implying I implied "a variety of topics" means "anime"

No, why did you come to that conclusion.

>All this mental gymnastics
Take one fucking look at the sites homepage, it's obvious this is an anime website.
Fuck off somewhere else if you don't like anime. That fact that I keep seeing anti-anime tards constantly being triggered left and right for years and years is quite telling.
Anime is absolutely everywhere on the site, and you loud minority refuse to either put up with it or leave.

>Bjarne is a weeb
This explains everything.

Attached: 1534316405651.jpg (206x150, 15K)

That's a cute loli. I read her text in a high-pitched moe voice.

Is this fallout new vegas?

that's not the dunning kruger effect

>Take one fucking look at the sites homepage, it's obvious this is an anime website.
What can be asserted without evidence can be dismissed without evidence.

>I keep seeing anti-anime tards constantly being triggered left and right
>projecting this fucking hard

>Anime is absolutely everywhere on the site
Not on /an/, /sci/, /vr/, Jow Forums, Jow Forums, /o/, /p/, Jow Forums, /ck/, /diy/, and not even in the faggy board Jow Forums. Maybe, JUST MAYBE, you should stop thinking Jow Forums boils down to /h/ and /v/. That won't get you a third digit in your IQ, but you won't be as full of shit.

Attached: wew lad.png (276x314, 6K)