C > C++

C > C++

Attached: cosinus_play.jpg (1367x2048, 385K)

Other urls found in this thread:

vocaroo.com/i/s1k5N2N3GV4o
twitter.com/AnonBabble

I find C++ quite ugly.

The flaws of C++, as I recall from when I studied the matter around 1990, include syntax and semantics. As for syntax, its grammar is ambiguous, and it is gratuitously incompatible with C, which blocks the smooth upgrade path from C to C++.

As for semantics, the abstract object facility of C++ is designed around the case where the real type of an object is known at compile time. However, in that case, abstract objects are equivalent to a naming convention for functions to call. The case where abstract objects add real power to a language is when the type is not known until run time. C++ does handle that, but it seems to be an afterthought, a poor relation.

I suspect that I would find plenty of ugliness in the template library, but I don't know. That was added to C++ after I studied it.

C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said "to piss you off", but it's actually true. I've come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn't come and screw up any project I'm involved with.

C++ leads to really really bad design choices. You invariably start using the "nice" library features of the language like STL and Boost and other total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it's not even funny)

- inefficient abstracted programming models where two years down the road you notice that some abstraction wasn't very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don't screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don't screw things up with any idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary objective, the "advantages" of C++ is just a huge mistake. The fact that we also piss off people who cannot see that is just a big additional advantage.

Just use modern C++ brah

God I want to fuck those tits so bad

vocaroo.com/i/s1k5N2N3GV4o

you're not wrong

Attached: ECSTcl3VAAEx5hm.jpg (1241x1655, 315K)

I hope you know they're fake

I hope you will have sex at least once

C# > C > C++

thanks

Very based, C99 was the closest we've gotten to the perfect language, and the chance won't come again given current state and direction of technology.

how do you feel about C#

Attached: 5.png (500x764, 203K)

are you under the impression we have poster-IDs here?

Bloated proprietary Java from Microsoft? Probably the worst idea of all times.

This but ironically.

both posts are dumb as fuck, c# is a totally different class of language

i don't care if it's the same person you autist

no

Attached: 1554737728583.png (1339x862, 42K)

Bjarne's worst and smartest decision was basing his language on C.
It resulted in an abomination while enabling its success.

>VLAs
>Perfect Language

>as I recall from when I studied the matter around 1990
Why talking about legacy C++ in 2019
>As for syntax, its grammar is ambiguous
example needed
>and it is gratuitously incompatible with C
C/C++ is technically wrong, C++ is an entirely different language. Sure you can write C in C++ but that's not the point of C++ and it's currently a burden.
>which blocks the smooth upgrade path from C to C++
Wrong. It's the same with every language.
>the abstract object facility of C++ is designed around the case where the real type of an object is known at compile time.
Fake news everyone
>abstract objects are equivalent to a naming convention for functions to call
Did you just discovered how compilers work?
> The case where abstract objects add real power to a language is when the type is not known until run time.
fake news again

>I suspect that I would find plenty of ugliness in the template library, but I don't know. That was added to C++ after I studied it.
Why do you have an opinion about something you don't know a single thing about?

C++ post 11 is a totally different level, the metaprogramming facilities are beyond anything else that currently exist.
There is not a single language that does expression template natively, this allow performance levels in linear algebra or things like it that you simply can't achieve with anything else outside assembly.

C++ is literally a superset of C.
Even if nothing else, just std::function and lambdas would be enough to convince me to not not even look at C with my ass. But there's also templates, proper, powerful compile time logic, a standard library that is full of useful and safe functions, smart pointers, type-safe polymorphism and soon even proper modules.
C is good for writing kernels, C++ is good for writing the userspace software you actually use your computer for at good speed with good performance and ending up with something readable that future developers will understand, much unlike C software that usually takes decades to reach even a semi-functioning state and is then prone to memory leaks, segmentation faults, buffer overflows, race conditions etc. despite C-tards constantly claiming that they are smart enough to avoid them "without the language helping them"

inb4
>Butbut umm ackshyually, it can't be a supashet of Cshee becaush you need to casht the reshult of malloc(), durrrrrrr

What's wrong with C11?

And yet ID software refuses to move last C++11

The only people who think this are people too stupid for C++. Also she's hot and it hurts me to think she'll become old and saggy some day.

>the metaprogramming facilities are beyond anything else that currently exist
Except Lisp.

base :DD

Attached: 1561117952524.png (824x701, 61K)

Not sure about this one, C++ templates can build domain-specific languages this translate to AST and the gang.
Clojure uses value and C++ types, C++ can then work at compil-time and it's a feature mathematicians and physicists want because you can bypass the language evaluation order and have orders of magnitudes faster calculations.

That pointer based nature means that in a C or C++ program, it's *very* hard for a compiler to figure out what things are independent. It comes down to a problem called *alias detection*. Alias detection is identifying when two variables *might* be referencing the same location. Alias detection becomes a horrific mess in the presence of unrestricted pointers. Let me show you an example:

for (int i=0; i for (int j=0; j x[i][j] = y[i-2][j+1] * y[i+1][j-2];
}
}


If you look at that loop, it can be parallelized or vectorized without any problem *if* and *only if* the array pointed to by `x` and the array pointed to by `y` are completely distinct with no overlap. But there's no way to write code in C or C++ that guarantees that. If it were Fortran-77, you could easily check if they were distinct. If it were Fortran-98, you could check if `x` or `y` were declared as possible pointer targets, and the programmer could make it obvious that they didn't overlap if they wanted to. But you *can't* do that in C or C++. (And Fortran isn't even the best - an experimental language called Sisal from Lawrence Livermore labs used to be able to beat Fortran by around 20% on typical code!)

That example involves parallelization of code, but alias related problems aren't just an issue for parallelism; it's just easiest to show an example for parallelism. The aliasing issues in C and C++ have a very direct impact on real code.

if the code is simple you can just write simd instructions yourself, you case is trivial.

Lisp doesn't require what is essentially two different languages in order to do completely Turing-complete code generation.

>But there's no way to write code in C or C++ that guarantees that.
Yes there is, just put "restrict" on the pointers.

can it generate the ast at compil time?
Or even better can it also performs computation at compil time?
Can you do one part on the gpu and one part on the gpu if needed (at runtime obviously) ?
If the answer is no at atleast one question then C++ is ahead.
I know julia is coming full force and some people in my lab start writing linear algebra proof-of-concept but it's not quite there yet.

>Can you do one part on the gpu and one part on the gpu if needed (at runtime obviously) ?
cpu*

>can it generate the ast at compil time?
Duh.
>Or even better can it also performs computation at compil time?
It literally runs the same language in the compilation environment as the final runtime language, so you can literally do anything at compile time that you could do at runtime.

>on the gpu if needed (at runtime obviously) ?
You could do GPU calculations at compile-time if you so wanted.

asm > c

>so you can literally do anything at compile time that you could do at runtime
And vice versa, including JITting code at runtime.

See

There is literally nothing wrong with c++.
Rustfags have worse syntax. Go dilate.
Cniles don't get function overloading. Go implement the same function for every type or use horrible void* tricks and say hey to godevs while you're at it.

You should really give Julia a try. It feels like a juiced up Scheme. I've enjoyed some speed ups with the CuArrays library for throwing things at cuda.
Just understand it won't always hit c++ speeds, though you'll occasionally kiss the boundary.

hurr durr I'm a C programming hurr
struct useless_ambiguous_t {
kPtrSzWtf* hello_ptr;
ppKBuff** buff_x;
}

void c_is_garbage(useless_ambiguous_t**x, random_what_t* y, ppSzBuf** z, int* in, int** out, brbkms* buff) {
/*
* thar be dragons here haha!
* make sure to use this annoying comment
* style or i'll reject your code!
* -- Mike 'GnarGnash1969' James
/*
}

FUCK C
People who care about writing good code use C++, Rust or Go.

Attached: 7099f1.jpg (200x245, 62K)

using a lang which is company property is a bad idea. if u want freedom use C/C++. no real prog cares about a meme llvm front end.

Assembly or GTFO

the fact that I agree that this is true for me is pushing me slightly closer to the edge

Attached: vlcsnap2018091219h48m30s776.png (960x540, 431K)

*yawn* dude just go look at cppcons for c++17 or c++20, you can now write typescript but with C performance. Everything is standardised.
I don't know why anyone would still write C in this day and age when you can very easily write unambiguous and bug-free C++ for the same performance.

OP == faggot

D > C++

Just use C# bro; it just werks

Annex K

Attached: me.jpg (225x225, 6K)

Yes if you are on windows, but if they dont fuck up .net 5.0 then C# will be based

>The flaws of C++, as I recall from when I studied the matter around 1990
>DURRRRRRRRRRRRRRR I AM C PROGRAMMER C PLUS PLUS BAD LOOK AT ME I AM ELITE C PROGRAMMER I AM A 300+ IQ GENIUS WHO ONLY NEEDS TO PROGRAM IN C. C PLUS PLUS IN THE 90S BAD.
The absolute fucking STATE of c-niles... Jesus fucking Christ they literally live in the stone age.

It's optional.

>That pointer based nature means that in a C or C++ program, it's *very* hard for a compiler to figure out what things are independent.
I can hear your brain caving in from there.

>the metaprogramming facilities are beyond anything else that currently exist.

D simply destroys it in this regard.

Attached: 525_1551554398.png (500x281, 198K)

it literally isn't tho

Yeah but I like classes too much, also better string support is always a plus. The way I usually write c++ is just to write regular c code with the added classes and strings.