Honest question, Sup Forums

Honest question, Sup Forums
Why is C still used over C++ ? Why would you avoid the object paradigm?

Other urls found in this thread:

msdn.microsoft.com/en-us/library/windows/desktop/ms632586(v=vs.85).aspx
winprog.org
twitter.com/NSFWRedditGif

C++ adds nothing useful, only longer compile times.

embedded devices

You can make objects in C if you really, really want

I like to be able to read my own code. And I'm not a communist.

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.

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?

Can you give an example of an embedded device? Don't they all have widely used processors now like ARM ?

AVR is going to be a big one, or older 16/8-bit cpus.

...

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

AVRs and PICs are used in about 20 billion devices.

is that all the shit that is going to have the year 2038 problem for time?

No, it's very cheap microcontrollers used in industrial applications, etc. most of which don't even run an OS.

Dunno much about professional use, but C makes my eyes bleed a little less than C++.

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.

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

Look into ncurses if you need to make simple GUIs for console programs

I've written GUIs for C, but the actual presentation code is usually in a scripting language like Python or Tcl.

GUI stuff may be intimidating for beginners. You could either try a framework like GTK or draw everything yourself with OpenGL

The Myriad 2.

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.

this:
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.

>Why is C still used over C++ ?
C++ is harder than C.

RIP C

win32 will make you a man

I'll look into all that, thanks famms.
how so? Maybe im 2 new but thats too cryptic 4 me

I don't know,
for simple things it's OK, but doing GUIs in MVC is where OOP's money is at.

it will teach you how to use verbose, poorly documented API's with tons of quirks, which is like 99% of real programming

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

>slow
>good for video games

C++ OOP is fast enough, ask any AAA engine programmer.

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.

it's literally molasses

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.

are you afraid of getting your hands dirty?

>C++ OOP is fast enough, ask any AAA engine programmer
Such as Mike Acton?

What are you talking about?
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: winprog.org is always a better start anyway.

No, he's a faggot. Ask someone at Sony WWE or Valve.

*WWS

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

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.

OO is shit for GUIs - why do you think everyone has a declarative meta language on top of their OO shit for defining GUIs?

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

OO makes sense for GUIs.

>declarative meta language
That's just masturbation. Use a visual gui designer, like all the pros.

Honest question, OP
Why would you lump C++ and OOP together? Why would anyone be that kind of faggot?

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

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.

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

Yes it'\s slower, but msdn google search is way superior to the help chm shit.

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.

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?