[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

C

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 7
Thread images: 2

File: img000008.png (211KB, 781x1150px) Image search: [Google]
img000008.png
211KB, 781x1150px
Is there any point of using C over C++ nowadays? (Other than for some embedded devices that don't support newer standards I guess)
I never liked the OOP approach C++ provides, but I would gladly use C11 for some of my pet projects.
>>
File: img000009.png (223KB, 781x1150px) Image search: [Google]
img000009.png
223KB, 781x1150px
next page btw.
>need more manga about coding
>>
Arguably, the best use case for C is in libraries, or at least the C ABI. It's a pain to get C++ libraries to be used with other languages, but C libraries are pretty trivial for FFIs. Granted, you can use C++ to do this, but if you're gonna extern "C" everything, you might as well just write in C.
>>
>>61016788
>if you're gonna extern "C" everything
Not everything, just the exposed functions.

I don't know why /g/ pretends that making C++ extensions is somehow extremely difficult. I've implemented plenty of CPython extensions in C++ and I've extended Java code with JNI/C++ for over a decade.

It's fucking trivial, and no, it didn't require wrapping half the code in extern "C". I truly believe that the reason people continue to spout that bullshit about "hurr durr broken ABI" is because some poster read that somewhere on a blog in 2005 and others on /g/ are repeating it because they don't really know C++ and need to justify their ignorance.
>>
>>61016788
Look at the c2
>>
>>61017127

It's not that it's difficult, but there are some gotchas. One of those gotchas is exceptions, which are basically undefined behavior outside of the context of a C++ program.
>>
>>61017320
>there are some gotchas
Well, that's true for C++ in general though.
Thread posts: 7
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.