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

If C++ is such a mess, why doesn't someone create something

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: 148
Thread images: 8

If C++ is such a mess, why doesn't someone create something similar to it and remove all of the bad parts about it .
>>
call it C-- :^)
>>
>>61928051
It's called C
>>
it's called HolyC
>>
They did, it's called C11.
>>
This is basically what every programming language created after C++ is trying to do.
>>
>>61928051
It's called C#
>>
Isn't D supposed to be precisely that? But the problem is, C++ is the wrong starting point - you should start with C and make it better.
>>
>>61928051
Work on improving the current languages instead of spliting the work force even more.
>>
>>61928051
it's called c
>>
That's literally Rust
>>
>>61928051
aint there a comic that pertains to this phenomenon? Many such cases.
>>
>>61928051
Because the people complaining about it are brainlets.
>>
File: C__C.png (65KB, 406x374px) Image search: [Google]
C__C.png
65KB, 406x374px
>>61928051
>>61928069
>>
>>61928051
It's called D.
>>
>>61928440
>>
>>61928600
>>
There is literally nothing wrong with C++. The only reason for all the anti C++ propaganda is because women can't understand it, and diversity quotas must be met
>>
D and Rust both try to do this. D's point is basically entirely to be a better C++, while Rust has quite a few additional goals beyond just "removing the bad parts of C++".
>>
>>61928069
Literally this
>>
>>61928376
No, that's where C++ went wrong. If you want high-level programming constructs, it pretty much can't be a compiled language, and it certainly can't be C-based. C is top-notch for what it is, but it's not a good basis for a higher-level language with polymorphism and object orientation.
>>
>>61928732
If half of people can't understand something, that doesn't speak well for it.
>>
>>61928961
That's like saying if people don't meet the requirements a job, then standards have to be lowered.
>>
>>61928051
Because it works and people do work, if they don't like C++, they use other tools. Only faggots, pajeets and neets are complaining because they have no work and problems to solve but complain about languages.
>>
>>61928376
D has very sensible syntax compared to C++, and it's honestly my favorite C-like language. My only problem with it, is that it sticks far too close to the syntax of C, e.g. I'd love to have everything be an expression, have destructuring, macros, etc.
>>
>>61928961
Relatively few people can understand code as it is, so your argument doesn't hold
>>
>>61928051
"Within C++, there is a much smaller and cleaner language struggling to get out. [...] And no, that smaller and cleaner language is not Java or C#."
– Bjarne S.
>>
>>61928732
>women can't understand it
Not even most professional devs that use the language fully understand it. It's an eldritch horror of a language.
>>
>>61929709
Pretty much everyone can read code, in a mechanical fashion. Understanding and making out the big picture behind it is a whole another affair.
>>
>>61928094
...and fail to do
>>
>>61928069
Wrong
>>
>>61928051
Everyone agrees that 90% of C++ is not worth using.

Nobody agrees on which 90% is not worth using.
>>
>>61929792
Anyone who says they understand any language fully is lying.
>>
>>61928069
Nice standard containers faggot.

>>61928051
What are the ugly parts for you?
Boost errors? Multiple inheritance? Operator overloading?
>>
>>61929969
The shit inherited from C, heavy and bizarrely limited template syntax, other nitpicks
>>
>>61929958
No, actually, most languages aren't as extremely convoluted and impenetrable as sepples, Java, etc.
>>
>>61929985
Can't take all of C out of C++, but at least the ugliest C habits will warn/error.
As for template syntax it's a shame concepts didn't land in C++17 and so we wait another 3 years to see if 20 folks at ISO/IEC can agree.
>>
>>61930003
You can hack around the lack of concepts if you try, the main reason for wanting concepts is for clearer error messages.
>>
>>61928961
>women are people
>>
>>61928961
Exactly half the population has below average intelligence, so who gives a flying fuck about them.
Also your argument assumes that women are people.
>>
>>61928898
t. Retard who has no idea what they're talking about.
>>
>>61928082
try c++17
>>
>>61930835
C++17 and C++14 were minor improvements, C++11 is the version that transformed the language into something usable (albeit still ugly)
>>
>>61928051
They've tried, repeatedly.
>>
Maybe you are looking for Go
>>
>>61928898
>"Oh no using polymorphism makes your code slower!"
>"I know, we'll make the whole language not compiled, that'll fix it!"
t. Retard
>>
>>61928051
Because if all you can say about a language is it's a "mess" i.e. it actually trusts the programmer, then there isn't much wrong with it. Compared to all the other languages that are slow/totally lack multithreading/are basically impossible to perform static analysis on/don't have generics, being a "mess" is nothing.
>>
>>61931004
It's a mess if it's inconsistent and misleading, despite how powerful it is. You could have a language as powerful as C++ with a cleaner connection between syntax and semantics if you designed from the ground up rather than accumulating shit over the years (see: D, for the most part)
>>
>>61928051
See this >>61928440
Also the demand for c++ is getting lower and lower. Java and c# can do anything c++ does aside from graphics intensive applications like games or photoshop. The "java is slow" meme is no longer relevant in current year, where engineer work hours are magnitudes more valuable than the milliseconds c++ might save you.
>>
>>61931414
People don't give a shit about performance anymore, that's why the typical web page is bloated up with megabytes of unnecessary JS. It's a sad state of affairs.
>>
>>61928051
It's called rust
>>
>>61931572
Rust looks nothing like C++ though.
>>
>>61931578
turns out C++ without the bad parts looks nothing like C++
>>
Modern C++ is awesome and elegant if you know what are you doing. RAAI and templated containers are awesome.

In stuff where you need a lot buffers and math (3D graphics) it is still miles away of any competition. C is nice for drivers and some low power embeded (probably as wraper for FFI too).

Still for UI clients and servers I would go with C#.

Retards and Chinks can work with Golang. Lol no generics.
>>
>>61928069
/threat

>OP knew this
>>
>>61931564
Young people do. If there is anything good about the impatience of youngsters, it must be their demand for smooth applications that don't feel clunky. Old people on the other hand are used to the days when they would click a link and go make some coffee while the page loads. That is why news sites feel free to put so much JS bloat and ads on their pages while anything youngsters use have a native android/ios application that is relatively fast. Even none native web pages that young people use feel very smooth while having tons of JS. All those 3.0 sites or whatever they are called where you scroll down and the background moves slower and shit.
>>
>>61928061
best lang
http://www.cs.tufts.edu/~nr/c--/index.html
>>
>>61928069
>21st century
>still has overflows

C an insecure POS.
>>
>>61931414
Java can handle 2d graphics intensive apps just fine. Besides the fact that a lot of post processing is now gpu intensive, pixel manipulation in general can be highly parallelized in many scenarios and basic tasks like drawing a shape to an array don't require much horsepower in the first place. If you wanted you could easily make a performant image manipulation tool in java. I imagine games would be fine too on current hardware considering it seems like a lot of games now aren't super CPU intensive, though memory usage will go up.
>>
>>61928051
C++ had massive number of library,any replace need to be compatible,same speed,same memory model and easy to learn for new programmers and c++ programmers.
>>
>>61930936
No one said switching to an intepreted language would make it perform better. C++ is just a really awkward compromise and its lack of reflection makes its OOP features incredibly unpleasant to use. Useful reflection is hard to do in a compiled language. I'd rather accept a performance hit and gain reflection.
>>
>>61931859
>templated containers are awesome
In heavily templated code, if you use the wrong type, instead of a simple "you used the wrong type here," you get 16 pages of compile errors. Makes C++ a nightmare to develop with.
>>
>>61928051
it's called rust
>>
>>61933463
Concepts will fix this and you can hack around to achieve the same thing with <type_traits>
>>
>>61928051
It's called Java
>>
>>61933479
It certainly won't fix the codebase I work on at work. I've also been burned a few times by "the latest C++ spec will fix EVERYTHING, I promise!"
>>
File: standards.png (24KB, 500x283px) Image search: [Google]
standards.png
24KB, 500x283px
>>61928051
>>
>>61933513
The funniest part is that C++ was born by trying to be a universal standard that covers all use cases.
>>
>>61933485
ahaha haa ha...
>>
>>61933507
Any codebase older than C++11 is basically unrepairable.
>>
If people complain about a language that is a sign it is actually used in the real world.
Proof: Who complains about lisp now a days?
>>
>>61933807
Lisp isn't even mentioned unless you're in the presence of NEETs or academics.
>>
File: 1468683408746.jpg (55KB, 800x530px) Image search: [Google]
1468683408746.jpg
55KB, 800x530px
>>61933463
this happens only if you have no idea what the fuck you are doing, c++ is not for retards, and this is actually much better than shit compiling incorrectly and you get errors at runtime instead of compile time
>>
>>61933902
This. C++ with a stronger type system (i.e. with the last bits of C compatibility removed, no array decay) would be awesome.
>>
>>61933985
Well Rust then.
But it changes a whole lot more (if for the better imo).
>>
>>61934005
Rust is very different, it's not a "fixed" C++ but a completely different take. I think a fixed C++ would look like Dlang but without all the GC stuff.
>>
>>61934023
I would agree, but Rust is the closest you can get to a GCless D right now.

I swear, if D had started out without a GC we wouldn't even be having this conversation.
>>
>>61933807
Being used in the "real world" almost never means a language is good. C is the main exception, and Python not being shit is largely dependent on C not being shit.

>Proof: Who complains about lisp now a days?
Plenty of people do, actually. It's broken ground in modern industry through new dialects like Clojure and brainlets don't like it because they can only use languages that were specifically designed for retards, i.e. Java and Go.
>>
>>61933902
So, you're a retard if your code doesn't compile first time every time? Or are you a retard if you don't want to read a 16 page compiler error? Please indicate exactly which type of wrong you are.
>>
>>61934130
your are a retard if you dont know what type to insert into vector you declared in your header
>>
>>61928051
Go
>>
>>61934130
>Or are you a retard if you don't want to read a 16 page compiler error?
>"Couldn't use T here because T doesn't have method()" repeated a dozen times as the template instantiation unwinds is hard to read
>>
>>61934168
>no generics
>>>/out/
>>
>>61934171
To be fair, yes it is hard to read, even the comitee agrees.
Concepts should help with that.
>>
>>61934190
dude just use interface{}

Seriously though, who wants to use a strongly typed language with such a pathetic and weak type system?
>>
>>61934198
People who haven't kept up with the advances in programming languages since the 70s.
And people who only know Java, barely.
>>
when will we get modules? i think its a nice feature
>>
>>61934197
Concepts only clean up what's already possible.
>>
>>61934230
We should have gotten them in C++17, that shit was fucking ready.
>>
>>61934165
>Assuming I was the one who declared the vector
>Assuming that the type of every C++ expression is obvious just by reading it
>>
>>61934287
Oh well, it'll probably be supported as compiler extensions before then anyway.
>>
>>61934313
It kinda already is. Which is why I'm a bit mad they didn't standardize it.
>>
>>61934309
care to post any examples? something stl or boost related maybe?
>>
C2 did this for C. Hoping for a C2++ that also standardizes the ABI.
>>
>>61929951
this
>>
File: 1501938637569.png (260KB, 498x1480px) Image search: [Google]
1501938637569.png
260KB, 498x1480px
>>61928051
kindly reminder
>>
>>61934052
>muh GC
Confirmed for programlets.
>>
>>61934438
>calling people who don't want to use a GC programlets
You know some people don't have the luxury to not have to know how much nanoseconds their code takes to run?

Go write a kernel driver in your managed language and then talk back to me.
>>
>>61934321
ive read gcc doesnt support it yet at all
>>
>>61934438
GC is only worth it if you don't need sustained performance or if your physical memory is 5 times the heap size.
>>
This is a valid C++ example from wikipedia:
#include <iostream>

template <typename T>
struct has_typedef_foobar {
// Types "yes" and "no" are guaranteed to have different sizes,
// specifically sizeof(yes) == 1 and sizeof(no) == 2.
typedef char yes[1];
typedef char no[2];

template <typename C>
static yes& test(typename C::foobar*);

template <typename>
static no& test(...);

// If the "sizeof" of the result of calling test<T>(nullptr) is equal to sizeof(yes),
// the first overload worked and T has a nested type named foobar.
static const bool value = sizeof(test<T>(nullptr)) == sizeof(yes);
};

struct foo {
typedef float foobar;
};

int main() {
std::cout << std::boolalpha;
std::cout << has_typedef_foobar<int>::value << std::endl;
std::cout << has_typedef_foobar<foo>::value << std::endl;
}

How can anyone like this language is beyond my comprehension.
>>
>>61928440
>>
>>61934506
I've never needed to write this kind of TMP magic.
>>
>>61934506
just look up definition of std::forward, its pure magic but end user is never required to know how to write such code. there are things in c++ you will never write yourself but use them all the time
>>
>>61934611
This. Library code can afford to be overly complicated. Look up something like strlen in gcc.
>>
>>61928051
what about c#
>>
>>61934762
C# is more like Java than C++.
>>
>>61928051
>all of the bad parts about it
Because there is none.
>>
I always laugh when people say they hate on C++. They're likely millennials or C faggots that shill their language. Both are cancer and we ignore them everytime they mention java or php at meetups.
>>
>>61935595
people actually fucking suggest PHP?
>>
>>61935637
People have said with straight faces can they use PHP to make large applications. Not just normal apps, but shit like bank software or an accounting system to deploy to stores.
>>
>>61935713
That's horrifying.
>>
>>61935725
protip: a lot of them are on /g/ as well
>>
>>61935637
It's the best for web applications, there really are no good languages for web
>>
>>61930869
Try Rust
>>
>>61935736
Web apps is the worst dump of programming resources Ive ever seen. All that skill being wasted on entertainment shit.
>>
>>61935713
I've been on a coding conference where some dude gave a presentation on doing machine learning in PHP. At least he did a comparison with Java at the last slide showing PHP was a million times slower.
>>
>>61929792
It is because you keep moving the goalpost regarding "understanding" the language.
C++ is very explicit if done correctly, but if I were to defend undefined behavior, I can't.
It is a general purpose language, so I think it makes sense if there would be scenarios I have never encountered and never will encounter if it wasn't for these anti C++ threads.
99% of my problems with C++ is related to cmake, not the language.
>>
>>61935847
cmkae is not related with c++ in any way
>>
>>61935878
It is a widely used method to compile C++ though.
We use it everywhere at work.
I know it is retarded as fuck, and troubleshooting is a pain and 99% of it is pure magic.
>>
>>61935941
im using cmake, what exactly is the pain and the magic you are talking about? any specific make functions?
>>
>>61935970
>make functions?
*Cmake functions?
>>
>>61935970
I wanted to make a Qt class as a project, have the header files in a separate dir to the source files, so I could link the project with other programs that used the headers.
I ended giving up and just told the other cmake project where the project was located, but giving a static path is a bad strategy.
>>
File: 1471502181003.jpg (46KB, 667x556px) Image search: [Google]
1471502181003.jpg
46KB, 667x556px
>>61936023
thats not c++ problem, you could keep .h file in the same dir as .cpp and just link. qt uses things that are not part of c++ and will never be in the standard, its a cmake problem not c++, none of your problems are lated to c++
>>
>>61928069
Oh so C has full support for cross platform threads, function overloading, and lambdas now?
>>
>>61936136
Function overloading is undesirable when it fucks up the linkage. I'd sooner take the _Generic macro, except C's type system is awful so you often get unintuitive behavior.
>>
>>61936096
I know.
keeping it all in the same dir means the automoc works.
The Qt moc stuff is still C++, it is just an extra compile step.
It is a bit more flexible than defining it as macros.
The problems is related to C++ though because the generated c++ code from Qt is not placed correctly so the C++ compiler has an underfull vtable.

But problems like that take up way more of my time than any problems caused by C++.
The most frustrating part of C++ is "#include".
>>
>>61935847
>C++ is very explicit if done correctly
You can hide any sort of design flaw with "if done properly".
>It is a general purpose language
There is no such thing as a "general purpose language". I cannot think of a single thing sepples does better than other languages. For complex tasks with performance critical parts, C libraries can be written to interface with higher level languages, and for systems programming C is virtually unbeatable.
>>
>>61936205
no, moc is not part of c++ and it will never be, you literally cant compile qt's .cpp files in any, and by any i mean fucking any c++ compiler without qt's precompiler. anything you post is related to how qt works and all your problems are related to how you cant configure cmake to compile qt. this has literally nothing to do with c++
>>
C++ is shit. You can't even refactor stuff.
>>
>>61936261
C++ has strings.
>>
>>61936313
Your editor can though
>>
>>61936313
Refactoring is a buzzword.
>>
>>61935595
I Love C++. Sometimes I get bogged down in the complexity especially when I have to deal with move semantics and rule of 5. Right now I have to deal with the issue of cache locality and when you learn about it, you realize OOP is a meme and Linus was kinda right. So I have to either ditch C++ for C and lose auto, smartpointers, std::async, std::thread, and compiler support in general or be the madman that writes C in C++
>>
>>61936313
git gud
>>
File: maxresdefault[1].jpg (65KB, 1280x720px) Image search: [Google]
maxresdefault[1].jpg
65KB, 1280x720px
>>61936423
my man
>>
>>61936423
>OOP is a meme
It depends on what you are doing.
I think the STL have a good design.
I think cout is a lot better than printf even if you don't need something that low level for printing.
OOP is always better to use than it is to write.
But I have also seen it "overdone".
Eg when you have two functions and one of them is the constructor, it shouldn't really be a class.
>>
>>61936544
>I think the STL have a good design.
Then you've never used a map, or a vector<bool>.
>>
>>61936549
generally a good design then.
What is wrong with either of those?
>>
>>61936584
>map, unordered_map
the standard all but forces them to be implemented as a linked list, meaning they perform like donkeys hit
>vector<bool>
specialized as a bitfield which fucks over e.g. iterators.
>>
>>61936654
The performance has been decent when I have used it.
I never understood why they can't just call it a hash table and implement it as such.
Same goes for priority queue, just call it a heap, implement it as such, maybe call it min_heap and max_heap to avoid confusion and then make people implement their own stuff if they need something different.
>>
I coded a decent amount of C but C++ has
>namespaces
>generics
>RAII
>STL

coding C can now just feel like dicking around. Especially since most code you want to write these days is high-level, it's like how about not reinventing wheels or having to use an external lib for normal tasks
>>
>>61935758
hate that game.
>>
>>61936875
He's either shitposting or retarded. Both libc++ and libstdc++ use a hash table for unordered_map and a rb-tree for map.

vector<bool> was a mistake, though.
>>
>>61937306
C++ hate is a meme. If people in /g/ knew how to program /dpt/ wouldn't be the shitfest it is.
>>
File: C++.png (40KB, 1620x774px) Image search: [Google]
C++.png
40KB, 1620x774px
>>61938948
C++ is easy to hate if you actually use it and learn its "quirks", but often it's just illiterate retards who have nothing better to do but shitpost.
>>
>>61928440
Lol nope.

Rust is a system ML derivative with a C-like syntax.

It achieves what OP wants (something better than C++) but in a different way.
>>
>>61936136
considering your favorite language was probably bootstrapped from C, yes it does
Thread posts: 148
Thread images: 8


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