Is there any point/aspect in which C is superior to C++?

Is there any point/aspect in which C is superior to C++?

Other urls found in this thread:

harmful.cat-v.org/software/c /linus
yosefk.com/c fqa/
docs.wxwidgets.org/3.0/page_introduction.html
twitter.com/NSFWRedditGif

what a low effort thread. I'm a C++fag but even the most autistic retard knows C absolutely crushes C++ in build times.

i wouldn't know, i just larp here

I don't see building faster as a practical advantage since the final user won't build it.

As linus says, C++ attracts some terrible programers, so even if the only reason to choose C over C++ was to exclude them, it'd be worth it.

Binary size and memory footprint

OO software usually has a lot more cache misses than imperative code.

C is more portable than C++. C++ compilers will compile C code, with a few exceptions, mostly related to stricter type checking.

Top fucking kek
Linus has always great lines.

C++ needs big ass compilers.
C++ is too big; find me something they DIDN'T put in it.

I prefer C simply for the reason that I can actually read one book in a realistic time and know the language (as well as a low-level language like C can be known at least). With C++ they have bolted so much onto C that at this point it might be better to just throw away the syntax and invent a new language that does everything C++ does without looking like an abomination.


Hygienic macros. C++ 20 when?

Yes, simplicity.

That means that you can throw out almost all advantages almost any language has over almost any other language since the final user won't write it.

tl;dr you're fucking wrong etc

Enjoy the entire rant.
harmful.cat-v.org/software/c /linus

BTW, did you guys know the creator of that site committed suicide a few years ago? Sad. Bloat in your software, is more hazardous to the public health than you think.

C++ compilers cannot compile modern C. Any of the new C11 features are a syntax error. Some C++ compilers have very incomplete implementations of the latest C standard though.

Most C compilers can't compile "modern" C either. If you want to write portable C then you write C89 with one or two C99 features (stdbool.h).

pocc and gcc can both compile C11. I haven't tried others but i seriously doubt C11 support is lacking in most C compilers.

Yes, Uriel realized he was harmful and deprecated himself.

*Keks politically incorrectly*

Should have mentioned I write firmware so my definition of portable is a bit different. For embedded compilers "C99 support" usually doesn't mean much more than C++ style comments.

Eh, stdbool.h is 45 lines and defines true/false. Guess I'll stick with plain ANSI C. Anyway I only really care about old 8-bit systems and m68k, modern computers are dogshit.

variable length arrays

It appears to me he was a lefty faggot of some sort, went by Lucy on twitter. Also a Swede.

cat-v and suckless have interesting rants and sometimes a point, but their solutions are mostly crap.

C99 has variable-length arrays.

t. NEET who never wrote anything of significance

lol retard

Compile errors are understable
Also: yosefk.com/c fqa/

And c++ doesn't

He died before getting to see cloud computing really come into fruition, and the rise of the nu-swedes deprecating his country.

C has and designated initializers, I guess. Barring those, C++ is simply better.

C11 also has them but they are optional.

some kind of bytecode that is JIT-compiled at runtime
C++VM WHEN

Better portability and a MUCH leaner runtime.

C++ is for niggers. for example game developers (which are largely all niggers) use it as if it's C, so they got about 50K features in there for no reason

go back to Holla Forums faggot

What? Laughing at SWEDEN YES isn't really exclusive to Holla Forums.

Device drivers have consistent operational timing. Fewer faults.

Believing or caring about muh evil gypsies (or whatever race is in question here) is some turbonormie bullshit and so is LARPing about nationalism. The irony is that only nu-channers (people who joined after 2006 or 2007) do this shit on imageboards today.

|
|>
|3
|

Anally conflicted.

Okay, that's more understandable now. I write C for applications so I have it a lot easier.

Why are his lips so swollen?

...

Only in the fact that C was established first. This gives it a slight edge in compilers available for very weird architectures.

Otherwise today C++ is a notably superior choice from the maintenance perspective on any medium-scale (say 20KLOC) projects and larger.

just learn c++ already

Less indirection, concise syntax. You know more or less exactly how the compiler output will turn out. Far less corner cases and footguns.

How does one make a GUI app in C without objects? Checkmate, atheists :^)

...

It has a MT-safe function for converting timestamp to printable format.

wat

Why the fuck would I want custom widgets that look off on any OS they're used in?

Don't you like special snowflake retro and colorful user interfaces?
I confess I do actually

I prefer an interface that looks and "feels" native on the OS it is being used on. If the OS lets me customize the UI to look like that, then the app will also look like that if it uses native widgets.

Is it even possible to use FLTK with pure C?


Because it's lightweight as fuck.

Looks comfy, like 90's desktop.

What's the point of being lightweight when it sucks at its job?

A major complaint in this thread seems to be C++ compilers and their build times, C compilers seem to compile faster. I saw a talk about the Plan9 compiler and how they targeted build time optimizations, but is it practical to use Plan9 C and its compiler outside of Plan9? Is it better than other popular dialects and compilers, is there tooling for it like there is with regular C and C++?

It doesn't suck at its job. It's a GUI toolkit and it does what it should do, which is serving GUI widgets and windows for GUI programs. Being able to rice the visual look of a program is not a necessary part of a GUI toolkit, it's just homossexualism.

Using native widgets properly is a requirement for any good GUI toolkit. If it doesn't, it's shit.

I remember it from read-only readme files in Apple's System 7.

...

There unfortunately isn't such thing as "native widgets" on linux.
The closest you'll get is pure Xorg, which can be themed with the .Xresources file.
But nobody uses that, since it isn't portable or "modern".
The next closest thing is GTK2. But good luck trying to get GTK3 applications to have your "native" look and feel, because it doesn't support GTK2 themes and has shit such as autohiding scrollbars, overscroll, client-side decorations, hamburger menus and all that shit. Qt, while it "supports" GTK2/3 themes, the behaviour of the application differs a lot from GTK2/3 as well. And don't get me started on the dissonance with different window managers/DEs and different file pickers.
In the end, most themes for linux opt to theme as much shit as they can. If you look at such a theme, they probably have a theme subfolder for at least 3 versions of GTK3, GTK2 and a plethora of DEs, as well as google chrome, firefox and probably spotify. There's very little themes that actually manage to stay coherent across all these different toolkits, and haven't broken with a recent GTK3 update.
In the end, you end up with different behaviors and looks for each different application, and there isn't really any coherence on the linux desktop. Not like any other OS has really managed to pull this off properly, besides arguably Android due to constant shilling of the "Material design" and hipsters, or small hobby OSes like Haiku.

I prefer C in almost everything. I actually tried this today on my ARM tablet:
% printf '#include \nint main(void) { printf("Hello world!\\n"); return 0; }' > test.c; printf '#include \nusing namespace std; int main(void) { cout

Why doesn't the c++ compiler just compile it to the same instructions as the C one? Also how well does this scale?

Iostreams and stdio APIs are not equivalent.
Compile these two to machine code and compare for yourself. Iostreams introduces way more bloat because it is polymorphic, and has a more complicated and stateful logic underneath it. Also it's partly defined in header code so some of the code gets systematically inlined at the call site, which is why the output is also larger.

But wouldn't using the X protocol's requests (with Xlib or xcb) make it portable and coherent by default on every system that have an implementation of the X protocol?
Unless you talk about the .Xresources file

What the heck is wrong with you?

I meant it isn't portable to anything other than X. Both GTK and Qt run on windows and mac as well. Hell, GTK can even run in a web browser.

Just use wxWidgets.

Except WxWidgets runs on... You know... GTK.

Can't OS/X run X shit? Fuck Windows tho.

I really wish more applications used FLTK. It is extremely quick and responsive, which is what a user interface should be.

What? You're confused with wxGTK, which is a port.

docs.wxwidgets.org/3.0/page_introduction.html

WxWidgets doesn't do anything on it's own. It's merely a frontend library to several backend libraries, such as GTK, Cocoa, and whatever windows uses.
Aka WxWidgets runs on GTK on linux.

Extremely high predictability and proveness, facilitating things like structured programming and formal verification, making it easy to analyze time and static path complexity and to prove correctness of programs rigorously.
Add coding guidelines to that (MISRA-C, JSF-C, JPL-C etc), and you have an ideal language for critical systems and control applications.