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

Why would you ever use C++ over 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: 93
Thread images: 14

File: C vs C++ book3.jpg (618KB, 2048x1536px) Image search: [Google]
C vs C++ book3.jpg
618KB, 2048x1536px
Why would you ever use C++ over C?
>>
Vectors mostly
>>
>>61568226
RAII
unique_ptr
>>
Because it is better.
>>
>>61568226
OOP.
>>
>>61568241
Just use Rust if that's all you want
>>
Because it's (mostly) a superset of C, so assuming you're not retarded, it's better in almost every situation.
Useful features include classes, templates, function overloading, 1000x better memory management thanks to RAII, and STL.
>>
>>61568264
Rust is retarded
>>
Why would you ever use C over Assembly?
>>
>>61568226
>hurr durr having features is bad
>>
>>61568286
And 20 times longer compilation times even if your code is identical
>>
>>61568286
>mostly a superset
>change compiler from gcc to g++
>941 compiler errors
>>
>>61568329
The features save much more time than compilation time wastes.
>>
>>61568226
Because it's the superior language. C is for cavemen.
>>
File: kill you're self.jpg (78KB, 850x400px) Image search: [Google]
kill you're self.jpg
78KB, 850x400px
>>61568356
>>
>>61568328
it can be bad when it is confusing to the user as to what feature to use. there are many other reason that more mudballed on features are a bad idea.
>>
File: c++.png (40KB, 1620x774px) Image search: [Google]
c++.png
40KB, 1620x774px
>>
>>61568328
http://www.microsoft.com/windows10/features
>>
>>61568226
because i once timed qsort versus std::sort and it was embarrassing
>>
File: finalquotes55.png (269KB, 960x540px) Image search: [Google]
finalquotes55.png
269KB, 960x540px
>>61568385
>>
>>61568329
Hardware has become much better now, the usage of precompiled headers should reduce compile times, if that is such a problem to you.
>>
>>61568264
>Use Rust
No thanks, I'm heterosexual
>>
>>61568622
Such a funny heterosexual...
>>
>>61568226
First for: my employer
>>
>>61568226
what is this image trying to convey?
>>
>>61568226
Post that image where C is cute anime girl and C++ is fat anime girl cosplayer
>>
File: images.jpg (8KB, 249x202px) Image search: [Google]
images.jpg
8KB, 249x202px
>>61568440
Never heard someone complaining about c++ tbqh.
Quite ironic
>>
>>61569873
twitter.com/fabynou/status/784905829866614784
>>
File: dumb nigger.png (463KB, 785x678px) Image search: [Google]
dumb nigger.png
463KB, 785x678px
>>61569962
>>
Why would ever use C? Dont telk me youre a pajeet in embedded. Work with JS like a normal human being
>>
>>61568261
Nice meme
>>
File: fu.png (121KB, 639x349px) Image search: [Google]
fu.png
121KB, 639x349px
>>61570380
>>
>>61568226
No one here programs C, they kode with /dpt/ hello worlds here. They picked couple of non-mainstream languages which use professionals in specific areas to mimic them and look cool. Personally, I'd prefer matlab for modeling.
>>
>>61568261
POO
>>
File: 1460330305439.jpg (25KB, 680x383px) Image search: [Google]
1460330305439.jpg
25KB, 680x383px
>>61570419
Matlab is nice for prototyping but an utterly disgusting "programming language"/framework/whatever the fuck it is now overall. It's not sustainable and it's locked behind an offensive paywall, especially for those who need it for distributed/parallel computing.

Right now, I'm porting a Matlab program to C++ and shit-- my program runs more than twice as fast, even without compiler optimizations. It's also way more efficient.
>>
>>61568226
Because of better libraries, be it standard libraries or otherwise and because of the additional features required to make such a library.
>>61568243
tpbp
>>
>>61570419
Matlab code generation is literally the worst cancer to have ever existed
Mathworks shill please leave
>>
>>61570419
MDE has not and will never be mainstream
>>
>>61568261
OOP NI OOL
>>
ITT: unemployed losers
>>
>>61568226
Fabien Sanglard is a cool guy. He needs to hurry up and release his Wolfenstein Black Book though
>>
>>61568286
>falling for the OOP meme
>>
>>61571006
Yes, and ?
>>
>>61571092
No wonder your opinions have no basis in reality.
>>
>>61571147
Your current statement has no basis, fellow unemployed loser.
>>
I only use C++ for namespaces
>>
>>61570686
>twice as fast
I tried some simple numerical computations (for a Project Euler question) in matlab vs C/Julia, it was more like 2 orders of magnitude faster.
>>
>>61568352
Why does everybody always meme over time being so important for every technological choice? Who gives a shit. Time is just a bullshit argument for people who literally don't have a single other reason.

>I use windows because I value my time
>I use C++ because I value my time

What a load of fucking bullshit. If you value your time, go and become a caveman in the wilderness, or a monk.
>>
>>61571207
Why would you use that garbage just for such a fundamentally useless feature?
>>
>>61571241
Have you ever developed software with a team?
>>
>>61571169
I work as a C++ dev and when seeing posts like this >>61571237 (that could only be made by someone who has not done a single hour of honest work in his pathetic life) it makes me wish I could punch through the screen and right in your bloated, anime-watching faces.
>>
>>61571311
namespaces are fundamentally pointless and add no expressive power to the language, and C++'s implementation STILL doesn't ensure there won't be name clashes.
They also require a language to use name mangling or something on their symbols, which ruins what could be a simple and stable ABI.
>>
>>61568385
This
>>
>>61568261
OwO
>>
Vectors, classes (when used correctly), r-value references (they are god tier), operator overload.
C++ has some interesting features, you just have to use them correctly.
>>
>>61568226
I wouldn't.

>>61568261
More like POOP
>>
File: govnocode.webm (924KB, 600x336px) Image search: [Google]
govnocode.webm
924KB, 600x336px
>>61568226
Why not python?
>>
>>61570080
How's your first day here going, Rajesh?
>>
>>61571334
>employed
>browse /g/

Damn. You human trash.
>>
>>61568226
>Why would you ever use C++ over C?
STL containers
Stronger typed
RAII
Exceptions
>>
>>61568226
Never knew a strawman pic existed until now.
>>
>>61571334
I respect you. I bet you have various hobbies, too.
>>
>>61568226
Why would you ever buy this many books on any one language?
Most programming books are literal scams, for people too stupid to google and figure out best practices for themselvs.
>>
So what are good C++ books?
Looking for an introductory book (I'm assuming Stroustrup's is fine) as well as a book/books on C++ applied in finance and math.
>>
>>61575428

>C++ applied in finance and math

Just google "C++ with Numerical Analysis"
>>
>>61568261
This. NEETs won't understand.
>>
File: cpp_loli_goddess.gif (2MB, 640x360px) Image search: [Google]
cpp_loli_goddess.gif
2MB, 640x360px
>>61575607
How can all those OOP haters do shit if not with objects?
>>
>>61568226

Biggest reason for me is the STL. Ready made hashmap, vector, and linked list templates are a big timesaver.

Often I find myself starting a project in C, then realising I need a hashmap and at that point it's quicker to change to c++ than to implement a plain-c one.
>>
>>61571334
>what is fun?
>>
File: book.png (346KB, 800x427px) Image search: [Google]
book.png
346KB, 800x427px
>>61575428
Nenecchi's one
>>
C++ has qt
And wxwidgets and gtkmm and even gtk+, technically.

C only has gtk+.
And if you try to use it on windows the only "source" is the dropbox link someone posted on stackoverflow.

I mean you're all too intelligent to develop programs with an user interface, but still.
>>
>>61576272
>Shit ton of bookmarks

New waifu acquired

The fuck does that book say?

Rebel's C++?
>>
>>61568226
STL, in particular the containers, smart pointers and threading.
RAII.
Just with those two elements it is much easier/faster to write correct multi-threaded applications than in C.
>>
File: shiranai.jpg (94KB, 345x396px) Image search: [Google]
shiranai.jpg
94KB, 345x396px
>>61576343
Probably something like increasing the level (rebeeru) of C++. I can't type the other runes on a dictionary.
>>
Namespace, operator overloading, fonction overloading, default argument and template (nothing crazy just for generic containers)
>>
>>61576383
>much easier/faster
There comes a point whereby it's no longer worth the price. It's why we end up with meme languages like j*va and ES.
>>
>>61568226
C++ is modern, obviously.

BERNARD DENTA
>>
File: 1498925877926.gif (1MB, 512x336px) Image search: [Google]
1498925877926.gif
1MB, 512x336px
>>61576630
>C++ is modern
>>
>>61576530
My main point was about writing -correct- multi-threading.
At least on Linux <thread> is a thin abstraction over pthreads, which provides recursive mutexes and RAII locks, there's little reason not to use it.
>>
>>61568230
>not writing your own lightweight vector struct in c
LMAO
imagine being this guy
>>
File: 1493041263995.jpg (66KB, 450x500px) Image search: [Google]
1493041263995.jpg
66KB, 450x500px
>>61568420
You owe me a new keyboard.
>>
>>61571237
>complain about time
>participate in hour long shitposting wars on /g/ - Techlology
>>
>>61568226
>C++ has more documentation therefore you shouldn't use it.
I don't use C++ or C anymore, but that's a stupid reason not to use a language.

>>61568261
I hope you're trolling.

>>61568328
>more documentation inherently means more features
Anything you can do in C++ you can do in C since the original C++ compilers just transpiled to C, even though it is more effort.
>>
>>61568440
>Bjarne Stroustrup is so stupid he actually thinks that.
MLs are used a shit load in a good handful of fields. Fortran is still in use and is maintained, even if it isn't nearly as big of a deal as it once was. LISP isn't even close to not used yet.

Thinking stupid shit like that is why his language's main competitors are interpreted.
>>
>>61568622
>heterosexual
>in technology
Nice try. >>61570356
>>
Funny to see all of you debate on how C++ is shit when it's in the top 3 most used languages worldwide and is always used over Java for important shit, namely in finance and research.
But as always /g/ knows better right?
>>
>>61577450
Nobody actually likes C++, it was forced into the industry with microsoft's backing and it's only still around because it's compatible with C bindings.
>>
>>61577486
and because there is no better alternative
until you come up with a better alternative stop complaining

always the same with those haters
>>
>>61577521
"B-but muh Rust"
>>
>>61568226
I programmed in c, c++, python, js and golang. I haven't used it in 4 years now but tbqh C++ was always the most elegant to me
>>
>>61577486
Moving goalpoasts
>>
>>61568226
>hurr durr why would you ever need c++, you can emulate every feature through c with elaborate work.
>no, why would i want the simplest things done for me already, i need to do everything from scratch, in fact i write directly in machine code, why would you need higher languages, when you can be as cool as me
>i am also using arch linux with i3 since i am a purist and need to set up everything from scratch. I mean yeah, i only use it for browsing and watching anime, but i can do that now with 2 percent higher efficiency than any noob who uses Debian or any of the dumbed-down distros.

To sum up the answer i was about to give, in four words:
Get a job, /g/ !
>>
>>61576289

>C only has gtk+.

wrong

http://webserver2.tecgraf.puc-rio.br/iup/
Thread posts: 93
Thread images: 14


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