Whats better? C or C++?

Whats better? C or C++?

Attached: 0C3FA7C0-B58E-4C35-91FC-4A3C5B0CCA95.gif (500x277, 770K)

That's like asking if shit or shit is better. They're both shit in different ways, but they're still shit in the end.

Is java better?

I frequently use them together in the same program, C++ when I need classes or other specific newer features, and C otherwise

If they're so shit then how come every single one of your high level programming languages is implemented at least in part in either of the two?

Go home Rajesh

Pretty sure Lisp came before C.
It's acceptable as long as I don't have to get anywhere near the code.

C. I don't like OOP and hardly ever use it.

/sci/ here,

C++ is scientifically proven to be the best.

So what is your go-to and what makes it better? Genuinely curious.

Considering that /sci/ is full of a bunch of tech-illiterate failed academics who can't program for shit, this is a pretty fucking good argument for the superiority of C.

/sci/ here. Prove your claim.

Why wasn't there a C+ in between C and C++?

C unless your project is complex enough to warrant the use of a few of C++ features.

this

Honest question: what do C-chads do without the and libraries? They are so useful and I seem to use them in so many things I create.

Because ++ is the increment operator.

Glibc

but does that have memory allocation and resizing built in like string and vector?

I will leave that proof as an exercise for the reader.

Quit the pedo posting

The one you need.

>Considering that /sci/ is full of a bunch of tech-illiterate failed academics who can't program for shit

t. ass blasted cs major who failed algorithms and can't stand people saying it's easy as fuck

Reinvent them ever single time, just like every init() call and cleanup() call cause they can't stand to see their job automated.

Use lua, python. If your application requires lots of string manipulation you are better off just using C++.

pink isn't even attractive, only ruby was

your butthurt proves my point. did i hit a nerve?

>he doesn't know the majority of scientific computing is done in fortran and C
>>>/freshman/

C by design is more sane than C++

this

C++,C has none of the advancement and abstraction of modern languages, and none of the power of ASM.

You are basically stuck between a real language and an assembler language that can't do either very well.

Both are pretty good, but if your making something that's closer to the OS then C is your best friend, but if it's just a program C++ is your best bet.

Just a friendly daily reminder that cniles on Jow Forums are literally too stupid to understand things like template metaprogramming, so that's why they lash out at C++; they're literally too stupid and unimaginative to understand anything beyond POD structs and switch statements, so they think such any such feature beyond their piss-poor working memory must be "bloat" by definition. They also like to shout loudly about how the object-oriented paradigm is "forced" upon them and how unnatural it feels without realizing that this is more of reflection of their incompetence at using design patterns properly than any real scathing indictment against the language.

They are also way too stupid to use things like smart pointers and function objects, so they mangle something together with ungodly function pointers and create enough security bugs to keep cybersecurity engineers employed for the next 40 years.

I really feel sorry for the brainlets on Jow Forums who can't handle the beauty of a powerful language like C++ so they have to resort to joining the suckless cargo cult that doesn't produce any real, scalable software and spend their days photoshopping K&R into anime girl images and practicing their fizzbuzz instead of solving actual engineering problems.

Attached: 1548922153416.jpg (733x464, 102K)

`this' is a C++ feature, you can't use that.

>C++ is OO
This is not true.

OO is not mandated by C++, but good OO design is an essential part of any good C++ programmer's toolbox in order to decompose non-trivial projects, in addition to the more functional tools added in recent standards that can make things simpler where possible.

I prefer C, because it's simple, and pretty easy to maintain, and all the problems that usually are pointed, are result of the poor standard library C, that could be solved by using a more complete library (i for example have written one to replace the std, at least for myself, that includes functions to manipulate dynamic arrays of "objects"(strings, structures, etc.))

>/sci/ here
homework help, pseudointellectual babble. /sci/ is one of those boards where retards act smart, as apposed to many other boards where smart people act retarded

>pseudointellectual babble

Translation: /sci/ hates muh idol bill nye/black science man/memekins/singularityguy, wah

>one of those boards where retards act smart

That's literally Jow Forums

strawman. not an argument. back to your containment board

imagine going on the internet to defend a shithole board full of pseuds and underachievers for no financial compensation

No, they use C++ since forever ago.

>fortran
only because someone wrote that shit 20+ years ago and nobody wants the asspain of going in and fucking with it since it's working

lel, what did they do to get you so triggered?

You keep saying this, but you're the triggered one trying to come in and defend your shit board. Stop trying to flip this around on us.

C#.

C is low level garbage without OOP.
C++ is low level garbage with OOP. It's also the un-aesthetically ugly roast beef pussy code, but it's tight tho.

C# is easier to program and balaced between high level and features

it's more due to the fact of how let down i am at what /sci/ is. i keep going there every month or so and it's a shame how shitty that board is. it seems to be mostly high schoolers and univ students atop mt stupid.

You're the one that's not articulating why you're so pissed.

nigger you came here spouting that you're a /sci/ regular as though it gave credit to your post. nobody cares

>it seems to be mostly high schoolers
Jow Forums is 18+
>and univ students atop mt stupid
How so?
>it's more due to the fact of how let down i am at what /sci/ is
What do you expect besides shit posting and mocking lesser subjects like business and cs?

I'm not pissed. A /sci/fag came in and said that C++ is better. Naturally, given the ineptitude of your average /sci/fag when it comes to programming, I said that this proves that C is in fact the better language. Then you started getting defensive and bringing up math and other strawman arguments that have nothing to do with what we are talking about. You can be a cutting edge math researcher and still be an abysmal software developer.

You've never seen the " is scientifically proven" meme?

t. freshman
>In a survey of Fortran users at the 2014 Supercomputing Convention, 100% of respondents said they thought they would still be using Fortran in five years. The survey also showed that a large number of people were using mixed code with C overwhelmingly the second language (90%).

t. doesn't know fortran

>We undertook such an exercise to get a feel for what an "ideal" programming language for HPC applications might look like. Our approach was to take existing HPC programs and have someone rewrite them in whatever way suited that individual, not bound by the constraints of any existing computer, compiler, or language. Rather, he was invited to write whatever seemed most expressive. We might not be able to compile or run these programs, but we could at least see what the writer wanted.

>Almost immediately, we were struck by what we were seeing. Of course, the rewritten code was much more compact and readable than the original, but, surprisingly, the "ideal" programming language was basically Fortran.

>given the ineptitude of your average /sci/fag when it comes to programming
[citation needed]

You've described how I use C++.

Look up the syntax of passing a dynamically allocated array to a function. Never touch Fortran again.

>given the ineptitude of your average /sci/fag when it comes to programming
strawman
>bringing up math and other strawman arguments that have nothing to do with what we are talking about
Whoever brought up math? mentioned algorithms which certainly isn't math.

If you do a lot of string manipulation you're better off using Perl or JavaScript since both C and C++ are absolute garbage for that, in convenience, utf conformity AND performance.

>strawman
that's not a strawman you dumb nigger. this is the exact reason i can't stand to browse /sci/

Pajeet

Ok I'm not going to continue this pointless discussion. You can have the last reply so that you feel a sense of accomplishment at out-autisming me.

C++ can do everything C can but not the other way round so C++ is by definition better if still an extremely awful language.

>that's not a strawman you dumb nigger. this is the exact reason i can't stand to browse /sci/

When do you ever see code on /sci/?

>'doing more' is necessarily better
fallacious

string.h and made-to-order data structures. C is designed to not be for the general case. If you're in a situation where it would be acceptable to use a library then you probably shouldn't be using C.

C is for systems-level software and should stay that way. It's not a general purpose programming language.

Then why do people always act like C is the end all be all of languages?

you better not have a smart phone

If you're going to be autistic C++ is "at least as good" as C and by having more ways to express ideas as code it's with high probability better.

because they're LARPing system developers and think their toy software is comparable to any project where C would actually be a good choice.

To put it in a more concrete example, C doesn't "natively" support variable length and dynamic data structures because you're assumed to be working in an environment with limited memory and well-specified data already, bit by bit.

C++:
>Itanium ABI having nondeterministic exceptions
>requiring the presence of RTTI even when you don't use it
C:
>horrible type safety
>absolute dogshit standardized threading library
Pick your poison

off the top of my head:

lambdas
constructors/destructors
new/delete
cout

Ok, good to know. As someone who has used a lot of C++ but no C, this helps clear it up for me. I'm taking a machine organization course soon, so I want to dive into C a bit before going to that level.

C++ is C but with objects. It's Objectively better

You have become more autistic than any Jedi has ever dreamed of.

We need C+++

Got em

Literally every computer science professor I had was a terrible programmer. All of my math and physics professors were better programmers.

Here's the thing you can do anything you can do in C with C++ and a njoy nice features like classes and lamdas. An actually good string library and nice to functions in C++17. If you don't want to use features you don't. I fucking hate iostream. So I use stdio. If you hate stdio you can't use iostream in C. C++ is objectively better.

t math major who took two CS classes
If you were a CS major your school must have been absolute shit

Nice pic, OP. [spoiler]Are you by any chance from /ai/?[/spoiler]
Too bad your thread's complete bait.

No I'm a CS major. I had to switch schools because it was so shit though lol. My data structures teacher was the chair of the department and he said he was terrible it math and failed calculus. He recently left to a lucrative job at the state department.

That's like asking if shit or shit is better. They're both shit in different ways, but they're still shit in the end.

...?

program itsfine
implicit none
integer :: n = 100;
integer, dimension(:), allocatable ::v
allocate(v(n))
v = 1

write(*,'(I0)') mysum(v,n)

contains
function mysum(v,n)
integer n,i
integer v(:)
integer mysum(size(v))

do i = 1,n
mysum(i) = v(i) + i
end do
end function mysum

end program itsfine

C++, but only if you make your program structure mostly like C, and only using classes where it actually help making the code more organized and readable instead of doing a mess of subclasses and inheritance.

Can’t you tell from their names?

Based

C++ is objectively better.

>Whats better? C or C++?
not being op

C++++ or also known as C#

Except even the guy who made the term OO thinks C++ OO is garbage.

>I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. – Alan Kay

>only Jow Forums hates on the pile of garbage called C++, certainly no one that actually understand what they're talking about...

>c++ is a pile of crap. – Theo de Raadt

>Within C++, there is a much smaller and cleaner language struggling to get out. – Bjarne Stroustrup

I'd say C++, even if I code mainly in C. C++ is in fact C with classes. It is just C 99 with a new approach with structures and memory allocation.
If you ask to learn one of the two, i'd personnally recommand going C, as the code is the same. After a few projects you'll get the point of creating classes instead of structures and inherently switch to C++.

Ada.

No
Being from /sci/ proves nothing; I have met a fair share of science people who just can't into programming.

Neither. I have transcended mere mortal barriers and choose to program C/C++ directly in assembly, making them my instrument to shape the reality of my programming.

mos scientific computing is done in python, rust and r. because most scientists arent code gods. its more engineering thats done in c

Both are bad, but out of those two, C++ is better.
Anything that is built on a foundation of shit and manages to stand is better than the shit it was built upon.

>t. doesn't know about -fno-rtti

Theo de Raadt is unironically a retard whose only measure of a programming language is whether it can implement some tools from an ancient operating system.
>inb4 h-he has done more than you will ever...
His greatest accomplishment is making a clone of a 70s operating system which likes to pretend to be secure, but isn't, being written in C.
So no, I don't give a shit about his, or anyone's opinion.

Based.