When will this shit finally die out?
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 Sup Forums 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.
who are you quoting?
OP
This user gets it.
>memory leaks
>C++
Learn about destructors, faggots
Find the dangling refernce:
#include
#include
#include
using namespace std;
struct StudentGrade {
public:
string name;
char grade;
};
class GradeMap {
private:
vector 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
vectors are destroyed when they go out of scope
therefor the vector member StudentGrade is the only object not being collected
gradeJoe after you push Frank onto the vector
Fuck you
When you get something else that is as portable,fast and supported.
nice projection
Too bad it'll compile just fine. You were looking for it because I gave you a snippet to look closely
how much school does it take to achieve this level of autism
it's funny how cowards like you always turn to armchair psychology to run away.
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".
nice projection
You might be surprised at C#'s capability in terms of well-formed types
...I'm a high school dropout.
Completely self-taught, went for certs instead of a degree.
Learn your paradigms, the individual nuances become trivial.
There is a way to do truly native C#?
There is .net native atm and soon corert for this.
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
This snippet is fucking terrible. If you initialize references on an object it should be set as const
>char& gradeJoe = grades["Joe"];
>gradeJoe = 'A'; // does a push_back
This is awful :P
>struct
>public:
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.
... 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. Sup Forums 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.
You don't actually think that.
its syntax? never
.NET Native, and Mono has had statically-linked AOT for a while now.
bait
I don't know where you went to high school, but this is definitely Uni level programming.
What's wrong?
kek
What did he mean by this????