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

Will C++ ever be replaced? What is your opinion on the language

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: 23
Thread images: 2

File: c++.png (62KB, 1385x1557px) Image search: [Google]
c++.png
62KB, 1385x1557px
Will C++ ever be replaced? What is your opinion on the language itself?
>>
The only well written C++ programs are basically just C programs
>>
C++ would be a great language if not for all the badly thought-out legacy garbage it carried over from C.
>>
File: 1477366347109.png (300KB, 800x425px) Image search: [Google]
1477366347109.png
300KB, 800x425px
>>57256520
>The only well written C++ programs are basically just C programs
> implying well written means error prone, worthless, and unsafe
Lol
>>
>>57256660
>Implying that the left is C in any way
lol
>>
There isn't any other language that has a decent enough amount of abstraction while still letting you do low-level memory management, so not in the near future
>>
>>57256660
I really prefer the left.

I know what is going on. I know what it a pointer and what is not.

What the fuck comes back from load_shapes()? WHO THE FUCK KNOWS. What type are we iterating? WHO THE FUCK KNOWS. How is that loop actually implemented? WHO KNOWS.

I feel like everything is just vague bullshit. Why does no one want to know what they're doing when it comes to code.
>>
>>57256754
That's the point. I'd rather all of that information be implemented by the class/compiler
>>
>>57256476
D
>>
>>57256754
>what is self-descriptive and well-encapsulated code

You are the reason C++ is the clusterfuck of a language that it became
>>
>>57256660
Sorry, what is **i on the left example? I get that *i is the actual element you're interested in, but what the heck is **i?
>>
>>57258328
Pointer to the pointer
>>
>>57258394
I'm tired, how is that useful/what does it do in this context?
>>
I unironically think both C and C++ should be replaced with Ada
>>
>>57258451
> pointer
Pointers can link to a random variable or it can link to a an array of variables.

> pointer of pointers
Same as before, except a bit more recursive. A pointer of a pointer can link to a random variable, or it can be linked to an array of pointers. In which an array of pointers can each individually link to a separate array of pointers

Think about it like this
A string is nothing more than an array of characters, right? How do we get an array of strings? We need an array of pointers, each linking to their own array of characters
>>
Rust. Doesn't matter though because there's so much legacy C++ around that we'll be using it for the next 100 years or more.
>>
>>57258394
No, i is a pointer to a pointer (an iterator into a vector of pointers to shapes), and **i is the thing pointed to by the thing pointed to by i (**i is a shape).

This code seems pretty broken regardless. Each function should manage its own memory, and returning a vector of pointers to newly-allocated objects seems like bad news. With how
load_shapes()
works it could look something like this …
circle p(42);
vector<shape *> v = load_shapes();

for (int i = 0; i < v.size(); i++)
if (v[i] != NULL && *v[i] == p)
cout << *v[i] << " is a match\n";

// later, possibly elsewhere
for (int i = 0; i < v.size(); i++)
delete v[i];

… but really something like
void load_shapes(vector<shape *> v);
where you pre-allocate the shapes would be better.
>>
>>57256476
Yeah it's gonna be replaced by C++++
Or C+=2
>>
>>57258570
Fortunately your shitty opinion doesn't matter
>>
>>57259277
C++++ is actually undefined behaviour. There's no sequence point between the two increments, so you can't tell whether it should be incremented once or twice.
>>
I'll wait for Rust or John Blows language to do the job.

>>57258570
/thread
>>57256815
>having both classes and structs to have stack and dynamic objects separated
anyway, it's fucked
>>
>>57256476
its not gonna be replaced soon but it shouldve been long time ago.
>>
>>57256520
Well-Written C++ programs are actually as far away from C++ as possible.
Aside from the primitive data types, and operators good C++ programs basically don't use any C features.
Thread posts: 23
Thread images: 2


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