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

When will this shit finally die out?

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: 37
Thread images: 1

File: cpp_logo.png (23KB, 360x405px) Image search: [Google]
cpp_logo.png
23KB, 360x405px
When will this shit finally die out?
>>
That's like song when nuts and bolts well die off. Never
>>
>haha I can't even make a CRUD app in fucking python or JS but I'm gonna read a lot about theory and be the eternal sophist I've been on all hobbyist boards on 4chan for the last 5 years where I pretended to know shit and flamed everyone who actually did something and right know I've read enough flamewars against C++ to pretend I'm actually savvy and flame it as well cause haha "memory leaks" and "stdlib" and "templates" (whatever are they??) are bad! hahaha my life is pathetic
>>
As long as the gaming industry is still alive.
>>
>>62374855
who are you quoting?
>>
>>62374885
OP
>>
>>62374855
This anon gets it.
>>
>memory leaks
>C++
Learn about destructors, faggots
>>
>>62375065
Find the dangling refernce:
#include <iostream>
#include <string>
#include <vector>
using namespace std;

struct StudentGrade {
public:
string name;
char grade;
};

class GradeMap {
private:
vector<StudentGrade> m_map;

public:
GradeMap() {}

char& operator[](string key) {
for (size_t i = 0; i < m_map.size(); ++i) {
if (m_map[i].name == key) {
return m_map[i].grade;
}
}
m_map.push_back(StudentGrade{key, '?'});
return (m_map.back()).grade;
}
};

int main() {
GradeMap grades;

char& gradeJoe = grades["Joe"];
gradeJoe = 'A'; // does a push_back

char& gradeFrank = grades["Frank"];
gradeFrank = 'B'; // does a push_back

std::cout << "Joe has a grade of " << gradeJoe << '\n';
std::cout << "Frank has a grade of " << gradeFrank << '\n';

return 0;
}
>>
>>62375118
vectors are destroyed when they go out of scope
therefor the vector member StudentGrade is the only object not being collected
>>
>>62375118
gradeJoe after you push Frank onto the vector
>>
>>62374885
Fuck you
>>
>>62374815
When you get something else that is as portable,fast and supported.
>>
>>62374855
nice projection
>>
>>62375169
>>62375183
Too bad it'll compile just fine. You were looking for it because I gave you a snippet to look closely
>>
>>62375169
how much school does it take to achieve this level of autism
>>
>>62375248
it's funny how cowards like you always turn to armchair psychology to run away.
>>
>>62374815
C++ is fine. Certain aspects of the standard library are apt to be infectious and bias people towards suboptimal approaches, but that's more a fault of the programmer's lack of competence.

Ultimately, writing in C++ as though it's C is more comfortable than writing in C. Even something as simple as constexpr and references (implicit dereferencing), is readily missed. Operator overloading is also nice. I don't think I've encountered a type system that's as logically "complete".
>>
>>62375330
nice projection
>>
>>62375389
You might be surprised at C#'s capability in terms of well-formed types
>>
>>62375281
...I'm a high school dropout.
Completely self-taught, went for certs instead of a degree.
Learn your paradigms, the individual nuances become trivial.
>>
>>62375442
There is a way to do truly native C#?
>>
>>62375484
There is .net native atm and soon corert for this.
>>
>>62375484
Well, there is the official C# Native, but it still has a reference overhead

I was speaking in terms of its robustness when it comes to types.

Obviously a native c# environment wouldn't have framework-dependent features
>>
>>62375264
This snippet is fucking terrible. If you initialize references on an object it should be set as const
>>
>>62375118
>char& gradeJoe = grades["Joe"];
>gradeJoe = 'A'; // does a push_back

This is awful :P
>>
>>62375118
>struct
>public:
>>
>>62375118
You lost me at
  char& operator[](string key) {


Can't you just iterate through a string?
>>
I can't believe people willing use stuff like C++/C#/Java.

They're all awful in every sense of the word.
>>
>>62375281
... Not him, but you should expect this level of knowledge from a high school C++ class, (that's how I know it.) It's just that most the people here are really retarded and don't put any actual effort into studying anything, and then they argue over things that they know less than an actual high schooler about. /g/ is literally "that guy" that has way too strong of opinions for little reason. I don't know why I spend time here. In fact, later nerds.
>>
>>62377054
You don't actually think that.
>>
>>62374815
its syntax? never
>>
>>62375484
.NET Native, and Mono has had statically-linked AOT for a while now.
>>
>>62377054
bait
>>
>>62377071
I don't know where you went to high school, but this is definitely Uni level programming.
>>
>>62376764
What's wrong?
>>62377036
kek
>>
>>62377687
What did he mean by this????
Thread posts: 37
Thread images: 1


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