Programmer, game designer, geek.
Catching Elephant is a theme by Andy Taylor
I tested a bunch of struct initializations and references, to check what my compiler would or would not do. Unfortunately, I forgot which came first in the struct definition, Left or Right, so I had to change the definition to fit what I had already written down, because I was too lazy to change the initializations I had typed. So yeah, the struct definition here is “struct Rect {int Right, Left, Top, Bottom;};”. Keep in mind that I don’t really know C++, I just like to do science-y things.
I approve of this experiment. It’s certainly interesting, even if not very practical.
Bear in mind that running the experiment several times over different compiler versions (or even the same version patched differently) may yield drastically different results. Heck, you could change a few switches on g++ and get a completely different result set here. This is one of the reasons why undefined behaviour is something you should avoid at all costs - a mere compiler upgrade can put you up the creek without a paddle sometimes. Hell, just upgrading the build system (which could change the switches passed to g++) might yield different results!
I think it would be interesting to demonstrate this effect by running the same experiment a few times with a few different versions of compilers and build systems, but I don’t know if anyone has enough time on their hands for such an endeavour.
i have a royal pet peeve to students being rude to teachers bc srsly if you’re rude to teachers you are the scum of the earth if they’re trying to teach you stuff and you insult them then you really suck ok
I’m not sure where this idea has come from where both you and Kayne think I treat Kayne worse than Logan does. I rarely bother even responding to Kayne, and when I do I can’t recall one instance where I’ve been anything more than a little cold.
I got the idea from Kayne, I have no idea what your interactions are with Kayne as I have enough to worry about concerning my own interactions. The word “apparently” should’ve been included in my sentiments regarding your position on the leaderboard of Kayne abuse.
OK. Sorry to have caused offense, I recognise that “man up” is a gender-weighted sentiment and should really have been omitted in favour of just “grow up”.
I’m not sure how far you’ve been following my relationship with Kayne, but the attitude I get in response for helping him - politely, I might add, these recent posts of mine are very uncharacteristic and representative in part simply of my mood of late. It’s less than grateful, let’s put it that way.
I do struggle with helping people. I don’t know how to help people. I want to help people, but I tend to be quite abrupt and cold when providing support. Perhaps it’s from dealing with computers for so long, perhaps it’s just a part of me. Either way, I know it’s an issue and I am working on improving.
However, I don’t appreciate being called an “asshole” by Kayne for offering assistance to someone over the internet despite the fact that I stand to gain absolutely nothing from it. Ultimately, when I provide Kayne with any support I am doing it selflessly and often in the face of a great deal of abuse.
If I see someone struggling, despite my best interests I will always dive in to help them (apart from that brief period when I took a break from dealing with Kayne, because it was taking its toll on my mood).
I completely understand your point of view and I do think that Logan and (particularly) Mitchell are too hard on the poor kid, but I would appreciate some recognition that, for my part at least, we are trying to support him. We’re not getting paid for it either, and if he doesn’t like our manner of support he’s completely free to look elsewhere, block us, unfollow us and cut all communication with us.
I don’t like how I’ve treated Kayne in the last few posts. I agree that I was bitter and resentful. Spiteful, even. And I apologise for that, and for the impression it must have left on anyone else who feels they could otherwise come to me for support. I will endeavour to improve the way I provide support and handle my relationships in the future.
#include <iostream> using namespace std; struct Rect { int l, r; int t, b; }; int main() { Rect r = {0, r.l + 10, 0, r.t + 10}; cout << r.l << endl; cout << r.r <<...Just for the record, I’m not actually doing this. It was in my code for a moment when I discovered that it was possible, but I dropped it in favour of a clearer, more robust system.
Why do you people think I’m an idiot?
For the record, I never called you an idiot.
What I said, in fairly blunt language, was that what you posted was stupid and that you really have no idea what you are doing. You might be a wonderfully intelligent person. I know a lot of really, really smart people who don’t know dick-all about programming. The key difference is that, when they are programming or facing programming-related tasks, they actually listen to people who are good at programming. Most of them are even proactive enough to approach programmers preemptively and ask for their help and/or advice. Or at least do due-dilligence and try to find an answer on their own.
And they do it for the same reasons why I go find someone who actually knows math when I’m struggling with it, or find someone who knows biology when I don’t understand it. Knowing the limits of your expertise is part of being a professional in any industry.Why do I say you really have no idea what you’re doing?
- You “discovered” behavior that is excruciatingly obvious to anyone who has even a basic level understanding of C or C++, and understands the difference between object declaration and object initialization.
- You described it in a way the indicates you do not know the difference between fundamental C++ concepts such as object declaration, object initialization, constructors, and value assignment. I’m quite sympathetic to mangling equivalent or similar terms (function vs. method, for instance), but what you communicated to the world indicates that you literally do not understand what the statements you are writing are actually doing.
- Instead of taking a little bit of extra effort to look up why it allows you to do it, or testing it to see when it works and when it breaks, or even trying to understand it further, you simply wrote a really, really dumb test harness and posted it on the internet.
- I’m not even going to go into the sins against software engineering you committed in the process. Simply put, if you were following any sort of best practices or common sense you wouldn’t have “discovered” this.
If you discover anything that the language allows you to do that you were previously unaware of it means you don’t know the goddamn language as well as you thought you did. Take that as an opportunity to actually learn something new.
There is no crime in not knowing what you are doing. But if you don’t know, fess up and admit it. Find people who are better than you at it and try to actually learn from them. Read code written by people who do know what they are doing and put the effort into trying to figure out why they are doing things a certain way. Don’t just sit back and post stupid shit you “discover” that C++ allows you to do.
Also for the record, I really don’t give two shits what abominations you have in your own code. Just don’t cry about it when shit breaks and you can’t figure it out.
OK, I’m going to say this once: I AM SICK OF PEOPLE TREATING ME LIKE A STUPID IDIOT.
I can’t even focus right now.
Just gonna pop in here and let Kayne know that you’re alienating yet another person who could potentially help you in the future.
If you ever want a career in games development, you need to stop getting so bloody emotional about things like this and just accept the facts of the situation.
Fact 1: You do not know all there is to know about programming.
Fact 2: The gaps in your knowledge are different to the gaps in my knowledge, which are different to the gaps in Logan’s knowledge, which are different to the gaps in ghost’s knowledge and so on.
Fact 3: Accepting advice from these people, rather than whinging about the fact that the advice didn’t come in little bundles of chocolately love surrounded with hugs and kisses and lots of cotton-wool, would be the difference between spending the rest of your life struggling to push out a single project and actually getting shit done for a change.I was 17 years old when I made the breakthrough realisation that I was pushing away all of my online mentors by taking their criticism to heart and feeling bad about myself instead of using the opportunity to learn. I still struggle sometimes to swallow my pride and accept advice instead of arguing endlessly about irrelevant details of a parcel of advice. Everybody has difficulty accepting advice and everybody has difficulty being told they’re wrong about something. But mature, professional people accept that not everybody in the world is there to make their lives easier and more comfortable. Sometimes, people are mean. And sometimes, you can learn from mean people. Do you really mean to cripple your own learning just because you can’t cope with a few harsh words?
And by the way, I’m this upset because frankly I don’t want to end up being the last person still available to help you after you keep pushing everyone else away and flat refuse to learn from the resources people have provided you with.
I just hate the fact that my posting about a programming quirk sparked such a huge backlash; I don’t understand why this happened.
Also, I have a right to push people away, it’s what I’ve always done. I work best on my own, even when it hurts to do so.
You also have the right to sodomise yourself with a pineapple, are you gonna do that? Just because you have the right to do something doesn’t mean it’s a sensible course of action.
I also wasn’t imposing myself upon your rights. You can still push people away despite my advice. I haven’t stopped you pushing people away so there is no issue of “rights” here. The issue of having a right to something only comes up when someone is physically (or otherwise) impeding your ability to do it.
And you can hate it all you want, or you can learn from it and grow. You can keep posting meta-conversation shit about “oh, woe is me, everyone on the internet is so nasty all of a sudden! how will I go on?!” or you can man up, grow up, look people dead in the eye and say “thank you for your advice, this is one less mistake I’ll be making in the future.”
Otherwise you’re only destroying yourself, Kayne; and the only reason I give a flying fuck is because I (for some fucked up reason and god knows why) happen to like you. I also believe in you and want to see you succeed. But I am at the end of my tether and then some, so please think very carefully about how you continue this discussion (if you continue this discussion).
I just succeeded in kicking my powerstrip and shutting down my workstation while writing javascript, so I’m going to take this as a sign from the oh so benevolent universe to go take a shower and contemplate my own mortality.
I used to hate doing that when I worked lots on a desktop system. On a laptop you have the entire battery life’s worth of response time. It’s like having a UPS only it comes with the computer.
Speaking of which, get yourself a UPS. We don’t need you kicking your powerstrip and shutting down your workstation while you’re about to post the most awesomely enlightening post ever made on tumblr and then forgetting it by the time it boots back up again!
strncpy() is better than strcpy() right?
Info: I can’t send a std::string over the network, so I’m using a char array.
You actually probably shouldn’t deal in strings over network anyway for a responsive UDP game protocol.
Hey Logan, thanks for the minecraft protocol link. Super helpful, I crank out my own byte-based protocols usually but this will remove 90% of that work and leave me just customising it on a per-project basis.
Sweet!
#include <iostream> using namespace std; struct Rect { int l, r; int t, b; }; int main() { Rect r = {0, r.l + 10, 0, r.t + 10}; cout << r.l << endl; cout << r.r <<...Just for the record, I’m not actually doing this. It was in my code for a moment when I discovered that it was possible, but I dropped it in favour of a clearer, more robust system.
Why do you people think I’m an idiot?
For the record, I never called you an idiot.
What I said, in fairly blunt language, was that what you posted was stupid and that you really have no idea what you are doing. You might be a wonderfully intelligent person. I know a lot of really, really smart people who don’t know dick-all about programming. The key difference is that, when they are programming or facing programming-related tasks, they actually listen to people who are good at programming. Most of them are even proactive enough to approach programmers preemptively and ask for their help and/or advice. Or at least do due-dilligence and try to find an answer on their own.
And they do it for the same reasons why I go find someone who actually knows math when I’m struggling with it, or find someone who knows biology when I don’t understand it. Knowing the limits of your expertise is part of being a professional in any industry.Why do I say you really have no idea what you’re doing?
- You “discovered” behavior that is excruciatingly obvious to anyone who has even a basic level understanding of C or C++, and understands the difference between object declaration and object initialization.
- You described it in a way the indicates you do not know the difference between fundamental C++ concepts such as object declaration, object initialization, constructors, and value assignment. I’m quite sympathetic to mangling equivalent or similar terms (function vs. method, for instance), but what you communicated to the world indicates that you literally do not understand what the statements you are writing are actually doing.
- Instead of taking a little bit of extra effort to look up why it allows you to do it, or testing it to see when it works and when it breaks, or even trying to understand it further, you simply wrote a really, really dumb test harness and posted it on the internet.
- I’m not even going to go into the sins against software engineering you committed in the process. Simply put, if you were following any sort of best practices or common sense you wouldn’t have “discovered” this.
If you discover anything that the language allows you to do that you were previously unaware of it means you don’t know the goddamn language as well as you thought you did. Take that as an opportunity to actually learn something new.
There is no crime in not knowing what you are doing. But if you don’t know, fess up and admit it. Find people who are better than you at it and try to actually learn from them. Read code written by people who do know what they are doing and put the effort into trying to figure out why they are doing things a certain way. Don’t just sit back and post stupid shit you “discover” that C++ allows you to do.
Also for the record, I really don’t give two shits what abominations you have in your own code. Just don’t cry about it when shit breaks and you can’t figure it out.
OK, I’m going to say this once: I AM SICK OF PEOPLE TREATING ME LIKE A STUPID IDIOT.
I can’t even focus right now.
Just gonna pop in here and let Kayne know that you’re alienating yet another person who could potentially help you in the future.
If you ever want a career in games development, you need to stop getting so bloody emotional about things like this and just accept the facts of the situation.
Fact 1: You do not know all there is to know about programming.
Fact 2: The gaps in your knowledge are different to the gaps in my knowledge, which are different to the gaps in Logan’s knowledge, which are different to the gaps in ghost’s knowledge and so on.
Fact 3: Accepting advice from these people, rather than whinging about the fact that the advice didn’t come in little bundles of chocolately love surrounded with hugs and kisses and lots of cotton-wool, would be the difference between spending the rest of your life struggling to push out a single project and actually getting shit done for a change.
I was 17 years old when I made the breakthrough realisation that I was pushing away all of my online mentors by taking their criticism to heart and feeling bad about myself instead of using the opportunity to learn. I still struggle sometimes to swallow my pride and accept advice instead of arguing endlessly about irrelevant details of a parcel of advice. Everybody has difficulty accepting advice and everybody has difficulty being told they’re wrong about something. But mature, professional people accept that not everybody in the world is there to make their lives easier and more comfortable. Sometimes, people are mean. And sometimes, you can learn from mean people. Do you really mean to cripple your own learning just because you can’t cope with a few harsh words?
And by the way, I’m this upset because frankly I don’t want to end up being the last person still available to help you after you keep pushing everyone else away and flat refuse to learn from the resources people have provided you with.
message me and I’ll add you to this list
- Chris: friend
- Logan: tolerate
- Mitchell: detest
- deafilion: I’d like to get to know you better
- quantumpsychiatrist: friendly acquaintanceship
In fairness, Kayne, Logan and Mitchell have probably helped you a lot more than I have and taken a lot more of your crap in response.
I tend to be over-polite and over-helpful in cases where I should just tell you you’re being a fecking idiot and to get your bloody head out of the clouds and start writing good code.
Because, as Logan has pointed out in the past (and you should note this is the first time I have, a long while after Logan), you do have it in you to be a good programmer. Maybe even a great one. If you can just put your personal hang-ups on hold for long enough to realise that those who are trying to help you are not “the enemy” and that their style of “tough love” help is just as useful (if not moreso) than my style of gentle nurturing / occasional frustrated outburst.
So far, we’re annoyed.
First off, there’s the complete lack of information in the so-called “announcement”. All I got from that was the name and the fact you have to buy it with a Kinect. Even if you already got an xbox 360 kinect. Presumably the 360 kinect doesn’t work with the One anyway.
Secondly, there’s this nonsense about no backwards-compatibility. I’m a businessman so I understand the decision but I’m a gamer so I’m enraged by it. Seriously, would it have been that hard to consider gamers ahead of business for one tiny thing, Microsoft?
Finally, this nonsense about used games costing a fee to activate. I’ve never heard such rot in my life. Has the relationship between publishers and retailers degraded to such a level that console manufacturers (who happen to also be publishers which demonstrates why they’re even taking a side in this war) are unleashing measures against one of the places that retailers can actually make any damn money any more?
I was excited. Now I’m seriously considering packing in console gaming, sticking to PC gaming and looking after my 360 like a porcelain doll so that I don’t end up having to replace the damn thing with this One crap.