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.
Good luck convincing the suckless autists here. They'll just scream "closer to da hardware" while ignoring everything else and citing compilation times.
Carson Ward
>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.
Sebastian Price
I’m gonna need sauce
Jaxon Morales
>b-but my legacy project from the 90s uses C, therefore it must be good! C is literally the COBOL of the 90s.
Colton Parker
I hate C as much as the next pajeet but that entire post was basically 12 different ways of saying C should have generics.
Asher Myers
>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.
David Peterson
This cult of programmer productivity, development speed and convenience and high-level abstractions uber alles, is behind everything that's wrong with modern software.
Julian Perez
Yeah you're right, we should continue using shitty languages and writing shitty inefficient unmaintainable code.
Gabriel Nguyen
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.
Easton Parker
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.
Zachary Young
>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
Nathan Jackson
Yet it's still the fastest, how do you explain that?
Jose Richardson
>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.
Mason Gonzalez
No you're wrong: high level abstractions often make software harder to maintain.
James Fisher
it is not the tool, but who is useing it
OP is confirmed for language bikeshedding brainlet
Bentley Garcia
is that his sister?
Jeremiah Garcia
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
Sebastian Brown
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.
Gavin Gray
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.
Michael Torres
I saw this pasta months ago. Amazing how none of these complaints are technical.
Jonathan Butler
>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.
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.
Bentley Sanchez
Hahahahaha
Dominic Roberts
darashinai imouto ni itazura shitemita 2 Learn to use saucenao.com you dumb niggerfaggot.
Owen Gutierrez
Do you have any idea how a computer works?
Camden Turner
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.
Chase Hughes
>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.
John Bell
Reminder objective-c is based
Wyatt Campbell
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#.
Carson Powell
>C++ is certainly an alternative. Haha, no.
Ian Jenkins
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.
Colton Powell
Learn English before learning how computers work.
Parker Thompson
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.
Jack Jackson
>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
Samuel Baker
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++.
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.)
Brandon Long
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?
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.
Mason Smith
Not true, C++11 thread support alone is a huge reason to prefer modern versions, and much better than pthreads.
Michael Cooper
So what language do you recommend instead of C to satisfy most of those complaints, OP?
Jacob Morris
It's a dumbed down version of POSIX threads.
Jaxson Price
I'm sorry, but, have you ever worked on an embedded project in your life?
Eli Long
I think it's pretty safe to say he hasn't.
Adrian Scott
Samefagging the same wonderful arguments.
Ryder Green
More like a verison without the "unnecessary complexity" that Cniles repeatedly blame on C++.
Leo Williams
>m-muh shills Go to bed Bjarne, you're drunk again.
Benjamin Brooks
It's like you didn't even read it.
Samuel Perry
>shills How illiterate can you be?
Isaac Barnes
this parts of my common laptop firmware is written in C++
Joseph Martinez
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.
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.
Ryan Carter
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++
Caleb Hill
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.
Nathan Lewis
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.
Austin Powell
*programms cpp like c*, look see how good my overhead is! Theres a reason fft algorithms are coded in either c or assembly.
Oliver Robinson
Tell us what embedded systems you've worked on using this process?
Ayden Taylor
>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.
William Ross
Mips1 machine with few kb of ram and rom.
Sebastian Johnson
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.
Lucas Murphy
>weeb having incredibly stupid opinions Checks out.
Thomas Cox
>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.
Christian Rogers
>anime Into the trash it goes
Colton Miller
>it's easier to create smaller and more efficient code in C++ than it is in C. lel
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.
William Wright
I know, it's a lot to swallow for a C simpleton.
Ian Young
every second post here reminds me of this
Austin Lewis
All the C programmers in this thread.
Brody Brooks
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.
Isn't Jow Forums just as big if not bigger than /v/?
Hudson Rogers
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".
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.
Jaxson Martin
It's not C programmers who produce the not smaller and not more efficient C++ code in question, though. It's C++ pajeets.
Sebastian Fisher
And you have no proof of that.
Asher Allen
Are you saying C programmers are sneaking in and making the C++ code less efficient to make pajeets look bad?
Christopher Perry
>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 I implied "a variety of topics" means "anime"
Gabriel Brown
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.
That's a cute loli. I read her text in a high-pitched moe voice.
Alexander Allen
Is this fallout new vegas?
Ayden Nguyen
that's not the dunning kruger effect
Aiden Fisher
>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.