After 40 years, there's still no programming language that comes close to this

After 40 years, there's still no programming language that comes close to this.
Is Bjarne Stroustrup the greatest computer science mind who ever lived?

Attached: unnamed.png (180x180, 14K)

Other urls found in this thread:

stroustrup.com/P0977-remember-the-vasa.pdf
stackoverflow.com/questions/3703658/specifying-one-type-for-all-arguments-passed-to-variadic-function-or-variadic-te
en.wikipedia.org/wiki/Rule_of_five_(C++_programming)
twitter.com/NSFWRedditGif

>what is Rust

Imagine being this low iq

C is way better than C++

language is fine and good, thanks bjarne but do I really have to use stl for everything?

Please don't. You're just going to be attacked by C haxors and upset everyone. C++ IMO is a good language but a few have come close. Rust is one example in recent years. Is Bjarne the greatest computer science mind who ever lived? No, but I still think he's a great one.

Proof needed.

what do you think user

Attached: bjarne2.png (291x383, 244K)

Lol how is C++ good it's full of features that break on one another.

It's certainly large and complex if that's what you mean and that represents something interesting to be sure, but as a tool to make software that fixes things it's not very good.

he's not even the greatest Danish computer scientist

>full of features that break on one another
Could you give an example or two?

Just about any compiled language is better than sepples, even plain C in fact.

meh, C++ was meant to be C but with a new object-oriented design; then it grew into a humongous monstrosity where everything has 1000 different external dependencies like shitty Boost. so many C++ programmers go to the "yeah, it's all been done before, except the glue, so let me import 57 million lines of external dependencies and write 500 lines of my own code, then it'll be good! cuz 'real programmers' wrote the 57 million lines of the actual important shit, not me!"

what that turns into is deeply buried bugs all over the place.

C++ coders should be taught to JUST FUCKING WRITE YOUR CODE AS SIMPLE AS POSSIBLE WITH NO EXTERNAL DEPENDENCIES! problem is memory management, thread safety, etc is just too hard to get right in C++ without relying on externals

so i would argue that if anything's a replacement for C++, it's Java. java also has the added benefit of being compile-once-run-anywhere, unlike C++, where you can run the same code on two different architectures, but you might get different answers because of some floating-point nonsense or something. JVM is good. and Java's performance is nearly as good as C++ nowadays.

What language is better than C++? Rust?

>Java's performance is nearly as good as C++ nowadays.
Are you being ironic?

>Java
>garbage collection
>leaking memory all the time

No thanks, user. I'm satisfied with my smart pointers to effectively manage memory.

Probably some Java advocate that started with C++ but never knew about C++ 11 and onward.

everyone programs like that

D and Ada are direct competitors. Erlang for highly parallel stuff but absolutely fine for general use. Rust is fine as well. Some small meme langs like NIm have better syntax than all of these but less support.

Hopefully Rust will replace C AND C++ in the future.

Is that a bitwise AND?

No. The conjunction 'and'.

>Is Bjarne Stroustrup the greatest computer science mind who ever lived?
No, he is coping:
stroustrup.com/P0977-remember-the-vasa.pdf
Turns out, basing a language on C (which itself is already retarded) and then handing it off to a committee that adds thousands of toy features while not fixing the real issues is a bad idea.

I can give you some examples:
- unions and everything with constructors you look crooked at, the problem being that some parts of the STL would be nice to stick into a union, but no, those methheads need to introduce std::variant
- headers and everything else
- headers and other headers
- headers and some auxiliary stuff, when in doubt
- value types and inheritance (literally)
- all kind of initialization syntaxes with each other
- soon: exceptions and metaclasses
D is dead by long-term cluelessness, Ada is dead by long term greed, though

anything you can do in C++ can be done in C

>- headers and everything else
>- headers and other headers
>- headers and some auxiliary stuff, when in doubt
Be more specific please.

It's got really weird undecidable grammar, which means compilation takes an order of magnitude longer than C, plus changes made to private members require recompilation of anything that uses an interface to the class, so you have to compile a LOT during development.

Manual memory management and exceptions, especially as implemented by sepples, absolutely do NOT work together easily and cause all sorts of weird shit and since an exception can throw any type at all in sepples you can't really write code that accounts for all possible exception types

Implicit generation of copy constructor, constructor, operator= cause lots of issues that just sort of have to be memorized, which is imo an unnecessary burden for the programmer

It's not like you can't work around this stuff, especially once you've plowed a lot of time into the language, but I don't agree with the sort of "look at my gigantic e-dick" mentality that leads people to talk a big game about c++. Most people/projects who use c++ have to restrict themselves to a pretty minor subset of the language, and you get a lot of problems coordinating large projects when people might be used to different 20% chunks of sepples.

I'm not saying you can't build a good project in c++ or that there aren't very specific situations where c++ is the best choice (you want inheritance/polymorphism etc for enterprise code reuse, but need MMM for speed) but for most of us it's just a way to demonstrate how flush with autism we are.

Anything that can be done in C can also be done in Go.
Your point being?

It's too hard to grasp for an average Joe, it will actively hinder any attempts of shooting yourself in the foot. C++, while having more features currently, is easier to get into, but it pretty much encourages shooting yourself not just in the foot but in the head and other body parts, it needs external tools just to make sure it's not doing anything funny with the memory.
>D is dead by long-term cluelessness, Ada is dead by long term greed, though
And C++ is stillborn so it's all fair game.

C is always faster

yeah braw thats y day call it general purpose languages

Is it as easy as doing it in C++?

yes, easier even.

C++ aims for zero overhead. So essentially it aims for the same performance as C while being safer.

Extraordinary claims require extraordinary proofs.

>It's got really weird undecidable grammar, which means compilation takes an order of magnitude longer than C
Compilation times don't matter unless they take an absurd amount of time.

>plus changes made to private members require recompilation of anything that uses an interface to the class, so you have to compile a LOT during development.
I've never seen this as a problem.

>Manual memory management and exceptions, especially as implemented by sepples, absolutely do NOT work together easily and cause all sorts of weird shit and since an exception can throw any type at all in sepples you can't really write code that accounts for all possible exception types
What is a smart pointer?

>Most people/projects who use c++ have to restrict themselves to a pretty minor subset of the language, and you get a lot of problems coordinating large projects when people might be used to different 20% chunks of sepples.
Languages features are meant to make a programmer's life easier. If you're not a using a feature that could help you, maybe you're using the language wrong.

>C++ aims for zero overhead.
Why does it have virtual functions then? It doesn't even have JIT to devirtualize and inline them in runtime.

Okay, how would you do dynamic memory management like in C++? In C++ I would use a smart pointer. How would you do something similarly in C?

C++ is a bad language. It is still the best language in many areas, because C++ is the ONLY commonly used language that even tries to accomplish certain things that all other languages just don't dare to even attempt.

It's a language that allows skilled programmers to write the abstractions and components they want, without being limited in expressive power, to a degree that very few languages can match; without necessarily sacrificing any performance over writing the same thing in C without any abstractions involved, except in a number of cases that is very close to zero.

The language is a horrible mess, because these two goals are very difficult to combine; and it has a lot of nasty gotchas to deal with subtle edge cases without sacrificing either design goal. Every single other language just sacrifices either expressive power or performance whenever the combination leads to nasty special cases; C++ is the only language that even tries to just have both, no excuses.

As such, when you want both these things, C++ is the best language out there. Not because it is good (it isn't), but because it's the only language that even tries to do this.

>problem is memory management, thread safety, etc is just too hard to get right in C++ without relying on externals
Did you ever even use C++? Memory management is the one thing that in competent C++ always just works, with no fuss at all, and works much better than it does in garbage collected languages. Of all the problems C++ has, this is exactly NOT one of them.

Yeah but it's not really that much safer and since it's got so much heavy duty abstraction on top debugging errors when you go wrong is just fucking nightmarish

>but it pretty much encourages shooting yourself not just in the foot but in the head and other body parts
I believe it's the opposite. C++ 11 gives you the tools to prevent this.

C++14 is as safe as Rust.

IF you use the tools provided. If you don't, then not just you're doing a disservice for yourself, you're also making your code unsafe.

>Why does it have virtual functions then
That's the point -- it's to allow you to pay that price only when you want to actually use it.

>It doesn't even have JIT to devirtualize and inline them in runtime.
Neither does any JIT. In languages like java, virtual functions can only be devirtualized in cases where in C++ you could just devirtualize it at compile time, by simply not having a virtual function in the first place. C++ is still strictly faster than JIT-based languages when it comes to virtual functions.

>why does c++ use a small amount of runtime support in the rare case you actually need virtual functions
>why doesn't c++ run entirely on a runtime
Jow Forums was a mistake

>C++ 11 gives you the tools to prevent this.
With unwieldy and verbose syntax when compared to the unsafe alternatives - exactly what I meant when I said it encourages unsafe code.

No need. Gewgle is your fren. Headers are the single thing that ruined C++.
In fact they weren't even state of the art when C was designed.
What's worse, though, is that it is even up to discussion to support macros in modules, ruining modules in the process by making them depend on the preprocessor.
>precise tracing garbage collection
>leaking memory
>And C++ is stillborn so it's all fair game.
It's not. You can't fight the wolves by howling with them. Bright and Andreski would be a perfect member of the C++ standard committee.
It's not a we-like-POOP language. It's merely a tool to implement dynamic dispatch and interfaces if need be. In the second case the compiler can often devirtualize at compile time.

Examples?

The beta c++ vs. The Chad#

>Is Bjarne Stroustrup the greatest computer science mind who ever lived?
no.
Imagine if he abused a less famous name-derivative to name his language....
nobady would use it or know about it.
C++ is famous just because of naming.

I wish someone made a pure C derivative but only with classes and nothing more.

except for headers
also they should made it inner() based OOP

Pointers vs smart pointers. C style casts vs sepples casts. Arguably references.

Wow. You must know nothing about why C++ was named. It was originally named "C with Classes". It was supposed to be C with the added ability to have classes. Later, it was changed to C++. Even if C++ had a totally different name, I'm sure people would still use the language because everyone would be tired of having to write code with the lack of abstractions and using hacks that are not only hideous, but are totally unsafe.

C with Classes. It wasn't good enough that's why it evolved into the masterpiece that C++ is today.

>Pointers vs smart pointers
How is smart pointers verbose?

>sepples casts
That was by design.

>Arguably references
Why?

>I wish someone made a pure C derivative
That would be still retarded. C is retarded by itself and OOP won't fix that.
Fun fact: I can't find the source, but the committee considered adding classes to C at some point.

I know how it evolved from a simple C derivatives header to a standalone language.
But how the fuck it ended importing every fucking feature from every fucking unrelated language is beyond me.

The problem is that they aren't the default.

C++ was made in 80s as you know and as time progressed, other languages began to sprout like Python, Ruby, C# and many more. Many of these languages had features that helped the programmer write more slick and streamlined code. The C++ committee thought these language features could helpful to C++ programmers.

After 40 years, there's still no shittier bait thread that comes close to this.
Is user the greatest idiot who ever lived?

>Compilation times don't matter unless they take an absurd amount of time.
I'd rather get paid to write code than wait for a large project to recompile and I expect the guy writing my checks would rather that too.

>I've never seen this as a problem.
I mean this feeds into the above point; you end up wasting a lot of time because sepples compiles slowly and often

>What is a smart pointer?
yeah i figure that's okay if you're okay with the downsides of sepples exceptions generally. They blow up the binary size and slow things down a little bit. They're probably not the worst bit.

>Languages features are meant to make a programmer's life easier. If you're not a using a feature that could help you, maybe you're using the language wrong.
I invite you to debug some enormous multi-screen template compilation error and try to remember how easy generic programming in c++ makes your life lol

Everything in C++ is like this. I understand why, like ofc a language that is simultaneously obsessed with maximum runtime performance and ease of programming of high-level languages is going to commit to static binding over runtime dynamic binding but that means you have to do a bunch of goofy shit with sorting your #includes and ultimately you wind up asking yourself why you didn't just do the whole fucking thing in C

HolyC is better

>I invite you to debug some enormous multi-screen template compilation error and try to remember how easy generic programming in c++ makes your life lol
I don't disagree with you. Template arguments in C++ is one of the worst aspect of the language. But if you over-do templates and it's mess, that's on the programmer.

>references
getting confused by &x vs x& I would guess

It's a subtle difference but if you have context you be able to figure it out.

Bjarne is an unsung hero of computer science.
C++ has done more for computer users than any other language except maybe for C.
Literally 80% of the stuff that matters is written in C++ (pro-tip: the crap you put on GitHub in Rust or Ebola does not matter).

It's not a pretty language, being a general-purpose, high-level language based on C, but it's a very nice generic language with decent functional and object-oriented abilities, while allowing to go as low-level as required, just like C.

Watch how C++ completely dominate programming competitions. There is a reason for that. You can actually write short yet very powerful programs (thanks to the STL, which is unmatched in any other language, not even Java with its cookie-cutter collections) that are also extremely fast.

>>Compilation times don't matter unless they take an absurd amount of time.
>I'd rather get paid to write code than wait for a large project to recompile and I expect the guy writing my checks would rather that too.
Every build system I've used only recompiles the files that have been modified.

C++ is a good language if you're willing to deal with some of the bullshit that comes with using the language.

yeah its all on the programmer, and there's so much C++ that you spend more effort on the language than the problem. That's why I think it's not a good language, I want a language that lets me think about the problem, not the means used to solve the problem, I want a transparent language where I always know what's happening.

That said, I think there's probably a few domains where only C++ will do, and I really feel bad for the guys stuck in those trenches.

Attached: phonemolly.png (98x270, 6K)

>I understand why, like ofc a language that is simultaneously obsessed with maximum runtime performance and ease of programming of high-level languages is going to commit to static binding over runtime dynamic binding but that means you have to do a bunch of goofy shit
There are comfy ways to do compile-time anything. It's just that C++ is badly designed around the idea that templates are a means for doing compile time checks like stackoverflow.com/questions/3703658/specifying-one-type-for-all-arguments-passed-to-variadic-function-or-variadic-te
A proper macro facility could emit a proper error message in such cases.

C++ and C are solely responsible for the existence of antiviruses.

>Literally 80% of the stuff that matters is written in C++
It's part of the reason why computing today sucks.

>macro
Eww.

I'm not talking of the poor text replacement mechanism Cniles call macros, ofc.

Computing sucks if don't use the language's idiom and the tools it provides.

It also sucks if you do so.

>C++ is good if you can deal with the stuff that is bad

Attached: Capture.png (1381x725, 1.26M)

>that link
What the fuck I hate C++ now.

If the pros outweighs the cons then it's good to use.

>unions and everything with constructors you look crooked at, the problem being that some parts of the STL would be nice to stick into a union, but no, those methheads need to introduce std::variant
you can put anything in a union as long as it is trivially constructible, otherwise you would need a tagged union which is what std::variant is

>changes made to private members require recompilation of anything that uses an interface to the class
this is by design and unavoidable because changing private members changes the size and layout of the class which breaks ABI, if it becomes a problem then you can use the pimpl idiom

>you can't really write code that accounts for all possible exception types
you don't need to, your application should only account for exceptions that it understands

>Implicit generation of copy constructor, constructor, operator= cause lots of issues that just sort of have to be memorized
just remember the rule of five, otherwise you don't need to worry about this

>it's just a way to demonstrate how flush with autism we are
i wasn't aware that learning how to do your job and use engineering tools correctly and effectively was "autism"

Stop harassing me

Nice response. Best I've seen so far.

And in case of sepples it sucks even if you aren't using sepples directly but due to some underlying sepples in your workflow.

>problem is memory management
use move semantics and let your objects destruct themselves when they fall out of scope. literally rocket surgery.

I like you.
What's the rule of five?

Brainlet detected.

C was a real work of genius, C++ made the impossible possible by bloating it with shittons of pointless features (which allow for more breaking and also give no clear best way to do things) and breaking compatibility for no reason. The reason anyone hates it is because we have to use it, as it's now the standard "oop extension of C" a lot of software is made with, while less used languages like Objective C did the same but a lot better (cleaner implementation of OOP concepts and backwards compatible with C).

One of the guys who actually define how C++ will evolve once gave a list of his favorite 10 C++ programs or something like that, and it was found out after years that one of them had a memory leak. Nice.

I don't know anything about Rust, and I know it could never be the same as it's not C based, and C is just too important even just for OS-related work, but it wouldn't be hard for it to be better than Bjarne's mess. Fuck C++.

>t. professional C++ programmer for over 10 years, now luckily using plain C because it's still a thing in IoT.

>you can put anything in a union as long as it is trivially constructible
Basically nothing beyond raw pointers and number types.

>C was a real work of genius
another brainlet detected

It's not even necessarily about programmers. C and C++ are responsible for all kinds of inner-system effects.

>C++ made the impossible possible by bloating it with shittons of pointless features
Examples?

>One of the guys who actually define how C++ will evolve once gave a list of his favorite 10 C++ programs or something like that, and it was found out after years that one of them had a memory leak. Nice.
If a program written in C++ is badly made then you can expect bugs.

>>t. professional C++ programmer for over 10 years, now luckily using plain C because it's still a thing in IoT.
>>luckily

Have fun manually managing memory and using hideous hacks to do what you could do in a few lines of C++ code.

If you can't handle C++ at its worse, you don't deserve it at its best.

Absolutely not true. Most early viruses replicated themselves on floppy disks, etc. They were written in a myriad of languages and did not really exploit anything, if the lack of sandboxing.

The answer to viruses is changing the security model, implementing sandboxing and signatures. Which is working remarkably well on some platforms (anywhere with a "store").

Would we have something better than Excel, Photoshop, [insert favorite DAW] with other languages?
Well, there are hundreds of languages now and no one is preventing anyone from doing better. I just don't see it.

en.wikipedia.org/wiki/Rule_of_five_(C++_programming)
the rule is basically that if you implement one of those functions, then you typically need to either implement or delete the rest of them

and POD types i.e. C structs, if you need anything more than that then you can declare a default constructor/destructor on the union in which case you need to manually call union member construction/destruction, but this can be complicated which is why std::variant exists

C++ is the "AR-15" of programming language.
Battle proven, nothing will replace it ever.

Rust could in the future.

>>C++ made the impossible possible by bloating it with shittons of pointless features
>Examples?
The templates are a good one. Horrible at best and added for the sake of it rather than for solving actual issues, leading to inconsistency in code because your idiot co-worker will do things one way in a case, another way in another, and the result is an unclean, unoptimized mess. It is still possible to write very good code in C++, of course, but the language doesn't help.
>>One of the guys who actually define how C++ will evolve once gave a list of his favorite 10 C++ programs or something like that, and it was found out after years that one of them had a memory leak. Nice.
>If a program written in C++ is badly made then you can expect bugs.
But the fact that the very designers end up writing "bad code" tells you how confused it's design is.
>>>t. professional C++ programmer for over 10 years, now luckily using plain C because it's still a thing in IoT.
>>>luckily
>Have fun manually managing memory and using hideous hacks to do what you could do in a few lines of C++ code.
Of course I have fun doing it. If I didn't need to manually manage memory I probably wouldn't even use C or C++ in the first place. If I wanted to do stuff with few lines of code I'd use Python.

GCC
LLVM
Photoshop
Excel
Chrome
Firefox
Oracle JVM/OpenJDK
CATIA
AutoCAD
F-16 and F-35 software
MySQL
The NASA mars rover
KDE
98% of video games
And many, many more

When you're arguing against C++ you're arguing against all that, and the smart people who made the decision to use C++ to write those things.

>GCC
I thought a good chunk of the codebase was in C.

They use it because it's standard and lots of libs and tools are for it. We talk about the language here.

Nope it's mostly in C++.
You'd have to be insane to write a C++ compiler in C.

>templates
why do so many people hate these? what is actually that hard about them? i have found them quite useful, do people really not have any need for compile-time code generation?