[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]

Honest question, /g/ Why is C still used over C++ ? Why would

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: 55
Thread images: 7

File: Tiobeindex.png (69KB, 704x426px) Image search: [Google]
Tiobeindex.png
69KB, 704x426px
Honest question, /g/
Why is C still used over C++ ? Why would you avoid the object paradigm?
>>
>>59692545
C++ adds nothing useful, only longer compile times.
>>
>>59692545
embedded devices
>>
>>59692545
You can make objects in C if you really, really want
>>
>>59692545
I like to be able to read my own code. And I'm not a communist.
>>
>>59692545
Because C(and its standard library by extension) is an incredibly simple standard to implement, making it the base of pretty much every operating system in existence.
>>
File: 1490909882687.jpg (49KB, 600x381px) Image search: [Google]
1490909882687.jpg
49KB, 600x381px
>>59692545
The C++ standard is enormous. If you have a new platform (an embedded one usually) porting C++ to it is far more costly than porting C.
>>
Check the 2017 index, C has dropped soooo much. Anyone have any explanations?
>>
>>59692634
Can you give an example of an embedded device? Don't they all have widely used processors now like ARM ?
>>
>>59692677
AVR is going to be a big one, or older 16/8-bit cpus.
>>
File: TIOBE 2017 index.jpg (63KB, 945x482px) Image search: [Google]
TIOBE 2017 index.jpg
63KB, 945x482px
>>
>>59692719
looks correlated with the spike in java

more likely they're all switching to dumb meme shit like rust and nim

they'll be back
>>
>>59692677
AVRs and PICs are used in about 20 billion devices.
>>
>>59692754
is that all the shit that is going to have the year 2038 problem for time?
>>
>>59692800
No, it's very cheap microcontrollers used in industrial applications, etc. most of which don't even run an OS.
>>
File: cpp.png (34KB, 200x209px) Image search: [Google]
cpp.png
34KB, 200x209px
>>59692545
Dunno much about professional use, but C makes my eyes bleed a little less than C++.
>>
>>59692800
Stuff that uses 8-bit MCUs generally don't care about real world time.
>>
Beginner programmer here: I enjoy C but haven't programmed beyond command line stuff..

How difficult is GUI for C? Or do most people use a hybrid of multiple languages to do this?

Say I wanted to make a desktop program for windows/linux using C.
>>
>>59692861
>>59692896
oh I see, even smaller things

I saw some shit on the nyc train system that all had to be replaced, rip whoever has to do that
>>
>>59692944
Look into ncurses if you need to make simple GUIs for console programs
>>
>>59692944
I've written GUIs for C, but the actual presentation code is usually in a scripting language like Python or Tcl.
>>
>>59692944
GUI stuff may be intimidating for beginners. You could either try a framework like GTK or draw everything yourself with OpenGL
>>
>>59692677
The Myriad 2.
>>
>>59692665
With Go and Rust, there's little-to-no reason to start a new project in C.
>>
Because C++ has no stable ABI, so you can't just pass your objects to non-C++ code. On the other hand, every language worth its salt has C interop baked right in and as others have said, every platform has a C compiler. So it makes a lot of sense to continue to write certain widely used software (e.g. zlib) in C.
>>
>>59692800

this:
>>59692896

and generally MCUs don't run an OS, so if they need time they implement their own time handling, which means that they can do unsigned/signed 32-bit starting from year 2000 or whatever.
>>
>>59692545
>Why is C still used over C++ ?
C++ is harder than C.
>>
>>59692719
RIP C
>>
>>59692944
win32 will make you a man
>>
>>59693015
>>59693022
>>59693041
I'll look into all that, thanks famms.
>>59693140
how so? Maybe im 2 new but thats too cryptic 4 me
>>
>>59692944
I don't know,
for simple things it's OK, but doing GUIs in MVC is where OOP's money is at.
>>
File: IMG_1378.jpg (26KB, 300x350px) Image search: [Google]
IMG_1378.jpg
26KB, 300x350px
>>59693177
it will teach you how to use verbose, poorly documented API's with tons of quirks, which is like 99% of real programming
>>
>>59692545
The object paradigm is only good for making GUIs or video games, it's harmful for anything else. Also, objects are not the only difference between C and C++.
>>
>>59693258
>slow
>good for video games
>>
>>59693270
C++ OOP is fast enough, ask any AAA engine programmer.
>>
>>59692753
The tiobe index is calculated by normalizing the total number of hits of all languages to 100%, so a decrease or an increase in tiobe ranking doesn't imply increase or decrease in language usage.
>>
>>59693292
it's literally molasses
>>
>>59693140
You can't even program Win32 these days. Most of the documentation and samples have been removed from MSDN, so learning even the most basic concepts requires either tracking down a set of old MSDN Library CDs, or asking pajeets on StackOverflow for seventh-hand cargo-cult information.
>>
File: IMG_1353.jpg (18KB, 340x191px) Image search: [Google]
IMG_1353.jpg
18KB, 340x191px
>>59693348
are you afraid of getting your hands dirty?
>>
>>59693292
>C++ OOP is fast enough, ask any AAA engine programmer
Such as Mike Acton?
>>
>>59693348
What are you talking about?
https://msdn.microsoft.com/en-us/library/windows/desktop/ms632586(v=vs.85).aspx
that + Dialog Boxes and Menus covers basically everything you need to write traditional win32 programs.
But the classic: http://winprog.org is always a better start anyway.
>>
>>59693385
No, he's a faggot. Ask someone at Sony WWE or Valve.
>>
>>59693410
*WWS
>>
>>59693410
>Ask any AAA engine programmer
>no not this one!!!! any who agrees with me!!
Even Epic Games programmers admit you have to rely a lot on metaprogramming not to have OOP poop your performances.
>>
>>59692545
I do use object orientation in C, just without the bloat and templates and long compile times of C++.

OO isn't a language with a "class" keyword, it's a way of thinking.
>>
>>59693258
OO is shit for GUIs - why do you think everyone has a declarative meta language on top of their OO shit for defining GUIs?
>>
>>59693489
This might not be relevant, but with entity component systems you can use mostly OOP with eventhandlers and custom EventArgs. That's what I've done while programming my game's inventory, equipment, and status effect systems. The code is much more performant than relying on pure EC because I separated state data from gameobject data, enabling me to perform multithreaded operations on arrays of that data. And if that isn't nice enough, I know exactly where to look if something goes wrong; my event pipeline is really helpful with that
>>
>>59693489
OO makes sense for GUIs.

>declarative meta language
That's just masturbation. Use a visual gui designer, like all the pros.
>>
>>59692545
Honest question, OP
Why would you lump C++ and OOP together? Why would anyone be that kind of faggot?
>>
>>59693577
I forgot to mention that making the UI became simpler with a pseudo MVA implementation. This means thst EC only applies to instantiated gameobjects so that I can setup references when managing the scene. So other than that it feels almost like developing separate systems in a wel structured way. Most game indie game developers don't try to separate models from views because it violates EC. And that's why the indie market is saturated with small games that perform awfully
>>
>>59693401
If you try to download the docs, a lot of that will be missing since it's not in the current doc sets. And just try programming Win32 when you have to wait several seconds for every F1 because MSDN is slow as shit. And there are still tons of Win32 samples and TechNet articles that are either missing or buried away and difficult to discover. And MSDN's online search has always been shit. Compared to what you used to get on the CDs (instant help, no bullshit in the search results, and most importantly a proper index like you'd find in a book), it's a disaster.
>>
>>59693580
>OO makes sense for GUIs.
>That's just masturbation. Use a visual gui designer, like all the pros.
Whether you write it manually or use a tool, point is that it's still that meta language which does all the heavy lifting, you don't do the GUI code in OO.
>>
>>59693663
Yes it'\s slower, but msdn google search is way superior to the help chm shit.
>>
>>59692545
C is heavily used for embedded devices and automating machinery.

C++ is used for... high performance applications that need that for whatever reason can't be written in Java.
>>
>>59692944
I've been told to learn JS and use electron to make cross platform programs, and make the GUI that way...

thoughts?

I only know some Java/C so to go into HTML/CSS/JS will take some time but if it means easily making cross platform programs/GUI's, is it worth while?
Thread posts: 55
Thread images: 7


[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.