Ways to avoid the needs and the musts of global variables??

Started by
86 comments, last by swiftcoder 13 years, 4 months ago
I think my real distaste for your attitude stems from your insistence on generalizing from your own experience as if nobody else will ever - should ever - experience anything different.

My point is, briefly, this: maybe it works great for you to do things the way you do. But to assume that your personal path is the optimal route for everyone is the height of both ignorance and arrogance.

These recommendations, best practices, tools - they don't exist because we feel like making a mess of things. They exist because they have concrete benefits to a certain class of people. You sit here and claim not to belong to the class of people who benefit from them; fine. Maybe that's true, maybe you just don't understand them well enough to benefit, I'm not arguing either way here. All I'm saying is that your attitude that nobody else should belong to that class of people is just... disgusting.

To then insinuate that people are unskilled, or unintelligent, or should be fired, or whatnot just for not agreeing with you... that, frankly, makes me feel a little sick.





Sure, maybe you really do find it best to cut your lawn with a toothpick and a butter knife. But don't you dare look down on me for finding it more efficient to use a damned lawn mower.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement
Quote:Original post by ApochPiQ
I think my real distaste for your attitude stems from your insistence on generalizing from your own experience as if nobody else will ever - should ever - experience anything different.

My point is, briefly, this: maybe it works great for you to do things the way you do. But to assume that your personal path is the optimal route for everyone is the height of both ignorance and arrogance.

These recommendations, best practices, tools - they don't exist because we feel like making a mess of things. They exist because they have concrete benefits to a certain class of people. You sit here and claim not to belong to the class of people who benefit from them; fine. Maybe that's true, maybe you just don't understand them well enough to benefit, I'm not arguing either way here. All I'm saying is that your attitude that nobody else should belong to that class of people is just... disgusting.

To then insinuate that people are unskilled, or unintelligent, or should be fired, or whatnot just for not agreeing with you... that, frankly, makes me feel a little sick.
Please stop this. As a moderator you should be fully aware that the whole purpose of a discussion forum is to illicit opinion. I can only offer my own and you can only offer your own and both are valid opinions.

But more than that, stop using emotive language to make me out to be some sort of Hitler. Just because you've read too much into what I say doesn't make you right either.

But just to be plain. I never insinuated anyone is dumb for not agreeing with me. Nor that they should be fired for disagreeing with me. In fact, I didn't say or insinuate any of the things you accuse me of, and I'm calling you out on it. Please fire away with your examples or be quiet.
------------------------------Great Little War Game
Collecting opinions is fine. But the fact of the matter is that some opinions are dangerous and potentially damaging to the people most interested in hearing them; I feel that yours belong to that category. The notion that all opinions are equally valid is borne of the same immaturity as a schoolchild's insistence that everything should be "fair."


Anyways, you asked for examples of the things I'm accusing you of saying. Fair enough. I don't think I read too far into any of this, though; if anything, I'm doing the best I can to give you the benefit of the doubt.

Quote:Original post by Rubicon
"Just get it done" is the most important factor in a programmers make up, but this goes totally unsaid. Well, unsaid by those that don't actually think it's top of the list and are therefore just seat filling drones- and those guys should just do what they're bloody well told.


Quote:Original post by Rubicon
if there are programmers in an outfit that pass a null into a function which then crashes and they can't figure out why that is and fix it quickly, they should get fired.


Quote:Original post by Rubicon
If we ever ran into these notional problems that advocates dream up, then we'd probably re-examine our working practices. However they just don't. So we get on with churning out perfectly fine working code and f**k the standards comittees and globals police.


Quote:Original post by Rubicon
And just to finish off, what the hell is a unit test anyway? (rhetorical) I think I can guess and it sounds an awfully tedious way to avoid getting work done to me. If anyone asked me what our unit testing practices were in an interview, the very next thing to happen is me saying "thanks for your time" and handing him his train fare. We don't write unit tests, we write games.



I didn't even have to try to dig to find those, and they're all from this thread.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

But the way you are painting me is of course perfectly fair. okay, getting the rules now. And please don't "give me the benefit of the doubt" whilst lecturing about condescension

I see a load of random quotes by me above, but nothing that backs up your claim that I insinuate or downright assert that disagreeing with me is either dumb or should get you fired.

The "drones" comment is admitedly a bit harsh, and I'll even go so far as to admit I shouldn't have said that. But it's still nowhere near what you are claiming.

I think an apology is due, but we all know there won't be one as you now have a bee in your bonnet.
------------------------------Great Little War Game
I guess I will jump in this really quickly.

There is a huge difference between writing a game (in which much of the code will never be used again), and writing an application that is going to be maintained for many many years.

Maintaining code takes a different mindset then just creating code. Writing code that is easy to maintain is a whole different beast. I come from application dev world in which we know we will be working on this code base for a long long time.

Unit tests, pattern dev, inheritance patterns are all things that can be used to make that whole process easier. Now there is something to say about getting the product out the door, but when you have to start working on that upgrade that people are going to pay about 1/4th of the original price, you need to have everything in place to make sure you can get it done without all the issues that could come up by just "getting it shipped".

Any time I have worked on a new project I was one of the ones that forced to issue to make sure we did it "right", instead of just getting it done. Did I ever regret that extra time spent? Not once.

To the main topic on here; globals. It all depends. A global that is set at start up and only read from is not really an issue. A global that can only be changed by a single object, is not really a problem. Globals that can be changed by anything at anytime are just not a lot of fun to debug.

theTroll
Quote:Original post by TheTroll
There is a huge difference between writing a game (in which much of the code will never be used again), and writing an application that is going to be maintained for many many years.


The problem is if the game does well and a sequal is created sudden all that 'code we are never going to use again' becomes 'code which makes you want to stab the guy who wrote it in the eyes'.

We are dealing with this right now at work; various systems in the game were written to 'just work' and 'get out the door' (on a game which slipped by a year at that); one year after that, when the guy who wrote it had left, the rest of us (me as a new hire onto the team) were left to deal with code which, frankly, only just held together.

Systems with magic numbers all over them and no clue as to what they did; systems which only worked due to the way the old data was setup by the guy who original made it with undocumented limits which took one guy around two weeks to track down and figure out! Overly complicated system which could be reduced in complexity (and as a team we have vowed to rip them out and start again!) and fall apart at the slightest proding.

The idea of writing code like it'll never be touched again just makes me shake my head; unless what you do flops there really is no such thing.

Yeah, I know, I was trying to explain the mindset.

I pretty much try to never write code that I wouldn't want to use again.

theTroll
Yeah, wasn't meant as an attack or anything, more to highlight the dangers of such mindsets in general [smile]
I should probably state at this point that "just make it work", at least from my mouth, does not mean "bodge it quickly".

What I'm really on about is to write some code to turn the wheels and make it a method called CCar::TurnWheels(float dt);

As opposed to thinking about what refactoring I can do to enable me to inherit CWheel from CCarPart and then consider a design pattern that best serves a wheel turning scenario and then unit testing whether it worked or not. By the time you've read that sentence, I would have my wheels turning. Well, ok. Ish! :)

And by global variable being ok, I mean TimeMgr=Engine->GetTimeMgr(); and not "Sprite[2].x++;"
------------------------------Great Little War Game
ApochPiQ, I think I am more aligned with your thoughts on engineering but I don't think you're necessarily being fair on Rubicon. I also happen to disagree with him a lot of the time, but that doesn't mean that his position is not legitimate, or that he is in any way trying to be vindictive.

This thread has covered a decent spectrum of opinions on the OP's topic, and has been quite interesting. I think it has also been useful because it shows the degree to which competent (if competence is dubiously defined as the ability to remain employed and ship/deploy games) disagree about fairly fundamental things, which probably isn't something that a new programmer would necessarily expect.

On that note, I've worked with people I've strongly disagreed with about many engineering practices, and the thing that I've learned is that you can't take it personally... it is frustrating to not "win" the intellectual argument, but that either means I'm wrong or that I'm not good enough at explaining my position.

This topic is closed to new replies.

Advertisement