Jump to content

  • Log In with Google      Sign In   
  • Create Account


Telastyn

Member Since 13 Oct 2003
Offline Last Active Jul 18 2014 06:13 AM
*****

#4817506 Reading someone's code

Posted by Telastyn on 30 May 2011 - 07:58 AM

I generally agree with loom_weaver on the descriptions of good/bad comments, though the 'in msec' comment is a bad comment. Well, not such a bad comment as 'duration' is a bad name. In general, I disagree with your assessment of comments:

1. what is this class supposed to do (and what things isn't)


This should be fairly obvious by name. And if you are good about your 'one class handles one task' it's even better.

Sure, sometimes things need to push the envelope or can't have a great name due to their... generalness. Then make a comment describing what's going on, but realize that the need to make a comment is a code smell.

2. who is supposed to call it, and with what kind of parameters (nothing exhaustive)


Protection level enforces who can call it, and your parameters have descriptive types/names to make the calling convention obvious.

3. maybe explain how it does it if it takes some unexpected approach to optimize it or something like that


Certainly. This is the case where comments are most valuable (in addition to loom_weaver's 'don't do this or else' or 'bug 4255 was caused by this being ___'). Cases where you divert from coding norms for a good reason. Comments exist to supply reasons to code, not to describe code.


#4817068 Computer Science pre-school requirements

Posted by Telastyn on 29 May 2011 - 06:32 AM

Part of getting a degree is exhibiting proof that you can stick through all the crap that you don't like. Do you think that actual workplaces will be 100% interesting and easy to build motivation for?


#4816771 Where i can get a programmer for a clientless bot?

Posted by Telastyn on 28 May 2011 - 08:09 AM

Do your own dirty work.


#4816151 What is Microsofts problem?

Posted by Telastyn on 26 May 2011 - 01:54 PM

Because clearly, dicking around with makefiles is a far superior approach.


#4814056 OOP is "necessary"... yeah, and so is dancing in traffic...

Posted by Telastyn on 21 May 2011 - 07:27 PM

Assuming this isn't simply trolling, but ignorance (and for the benefit of others)

A class is just, to be blunt, "A space that holds things inside of it that can be accessed from other spaces.".


Classes aid object oriented programming, but are not a specific requirement of it. It's nothing more than an approach for designing and conceptualizing your program. One that over time, programmers have found to be very easy to teach, and fairly good for many domains.


Frankly, you need to do more than "used it before" before denouncing something pretty much an entire profession has found to be a fairly good way of approaching things. And offer more than hand waving backed with nothing even resembling an argument.


#4814046 A base-language is really necessary?

Posted by Telastyn on 21 May 2011 - 07:10 PM

Weren't you already banned for trolling?

(For beginners that might read the thread):

Is this true?


Able? No. Succeed? For any relatively sizable game, yes.

Like, if I'm not an expert at, say, C++ inside and out, that limited-knowledge will prevent or make it difficult to develop a game? How so?


It will make things more difficult. The best analogy is to tools. You can build a house with a handsaw and plain old hammer, but you'll get a better house done quicker with more/better tools. Language features, API knowledge, program design skill are all tools for a developer's box.

I know C++ basics, how to use it for what I do, but I really don't know it that well overall. I found it kind of dumb to dig deeper into the language seeing how it has little to do with game programming itself, in the big picture, but why do people say that?


Because they know that all parts of the language have to do with game programming if you apply the language to writing a game.

I hear everyone saying that knowing a base-language 100% is necessary before programming games. But again, why? A base-language, to the max, doesn't have much effect on game programming mechanisms, like APIs themself(which have nothing to do with base-languages in the field of relation of use), graphics(which, again, don't pertain to a base-level language's structure or use), etc.


Because making a game is more than sending some commands to an API. How do you tie the different APIs together? How do you implement the game rules?

To be honest, many here recommend such a strong foundation in programming because far too many beginners have this viewpoint. 'It doesn't apply to games, so I won't learn it'. Programs are programs. Games have a few certain nuances and requirements but 98% of the process and skills required are the same. Too many beginners start before they're really ready; to their detriment.

I really believe it's true. The people who are pushing programming languages so much are people who probably just know the language and assume "everyone" must as well, when it's not necessary to know a whole language in and out to use it to your advantage, program, etc.


No, but everything else being equal, a programmer with more knowledge of the language at hand will produce better code than one without. Sometimes this doesn't matter. The resultant code is good enough.

Again, remember, most of C++'s "deeper" things seem to be related to OOP, and we ALL should know that OOP will not make or break the weight or code behind a game.

All in all, since C++'s deeper things are mainly OOP, it is basically not necessary to learn them because OOP doesn't limit or unlimit your ability or knowledge, skills or code behind a game: It is not necessary.

BUT I'd like to hear some others' opinions. This is why I asked this. Sorry if it came off mean...


Pssh. Templates are not OOP. Metaprogramming is not OOP.

Basic, competent C++ knowledge should provide some skill designing programs in an OO fashion. Having that isn't strictly necessary to create a working game, but it will help significantly, and will aid you in not getting laughed out of any programming interviews.


There's no OOP in Java,


Troll alert!!!



#4812227 Computer science or game programming?

Posted by Telastyn on 17 May 2011 - 09:00 PM


... especially in a field such as CS, which is constantly evolving.



Sorry, I don't mean to pick on you, but I would like to take a moment to point out that while I agree with your overall conclusion, I strongly disagree with you on this point. The fundamentals of CS are not really evolving much today. Basic algorithms, data structures, analysis and computer architecture have not changed in the past 30 years, nor does it seem likely that they are going to go through any radical updates in the forseeable future. Of course the cutting edge of CS is rapidly advancing, but this is not the sort of stuff that you will learn in a typical undergrad CS curriculum, nor is it even that important (no offense to those involved in research) to 99% of the general programming population out there. This is exactly why a CS degree is so valuable; because these foundational concepts are not likely to change and are very useful in a wide array of situations.


Note that this involves core structures and algorithms, computation... the math based part of computer science. Gamedev specific stuff in general changes much more rapidly (except for some core graphical concepts and 'near real time' practices/considerations), which is one of the reasons that many gamedev specific degrees suck; much less of them is relevant for the entirety of your career.


#4811184 8yr+ .Net developer interested in game programming - should I learn C++?

Posted by Telastyn on 15 May 2011 - 01:26 PM

Learning C++ when you comes from C# is just dropping a few concepts and learn to manage the memory efficiently.


This is patently false. To use C++ effectively if you're coming from a .NET world also involves learning much of the undefined behavior, best practices regarding it's retarded compilation model, adapting to work with horrific compiler infrastructure, and learning the standard library (and hunting down some framework to provide all the things you'd expect a standard library to provide, but C++'s doesn't).

For the OP:

If all you know well is C#, it's an entirely practical endeavor to learn another language. If your goal is just to make a game (which is a good goal, since making a game; any game... is hard) then C# is a better option than C++ given what you've said. Will using C# restrict where it can run? Certainly. But let's be honest here, your first game isn't going to be any sort of profitable venture. The skills learned about tying different parts of the game together, designing it, tweaking the pacing/rules, handling graphics will all apply regardless of language used. If you're realistically looking to get into professional gamedev in the next 4-6 years, use C++. If you're looking to make games for the web or mobile, don't use C#. Until then, use what you know so you can ignore the environment and focus on the game. It's hard enough without you adding complexity.


#4810943 Why you ALWAYS wanna use brackets

Posted by Telastyn on 14 May 2011 - 09:25 PM

The bug in this code isn't the lack of brackets, it's the lack of semi-colon after the first return in main. If anything this is an argument for language designers to require parens for return calls.


#4810261 Game Engine or not?

Posted by Telastyn on 13 May 2011 - 09:42 AM

This is one of the most bizarre responses I have ever gotten lol. Is this a serious answer? Do you all actually think like this ? I would honestly hate using something and not knowing what the hell it was truly doing.


After spending many years playing around with low level details and not getting anything actually done, yeah. Knowing the gist of how things work is good enough for pretty much everything. I don't particularly care about the mechanics of buffering and decoding video if I just want to play one. I want an API that reduces all that headache to 1-2 lines of code so I can go back to making the game.

So you would recommend that a new programmer whos never made games before to use the highest level engine possible to make a game, and not at all concern themselves with anything that they dont need to in order to finish the game?


I recommend that a new programmer not make games. Learn to program first.

If your short term goal is to make a game, use the most/best APIs/tools to accomplish that goal.

If your short term goal is to learn to program, then some portion of that will involve mucking about in low level stuff to get used to debugging things there and get a better understanding about buffers, bit fiddling, pointers, implementing your own algorithms/data structures and the such. But all of that code should be throw away. It should be focused on gaining knowledge and experience, and once done a programmer should pretty much avoid doing any of it again.


#4810242 Game Engine or not?

Posted by Telastyn on 13 May 2011 - 09:01 AM

My approach to programming has always been to use the least amount of abstraction libraries as possible without sacraficing too much time for complexity (I wouldnt do a game in x86 assembly :rolleyes: )


Game engines mostly aren't abstractions, and where they are they're implementing the abstractions that you'll need to do to be productive anyways.

So what exactly does a typical game engine do for you?? Does it basically do common game tasks for you such as collision detection and AI? If so, how can someone learn how to truly program games by using one?


How can someone truly write games if they spend all their time reinventing the wheel?

So is the typical idea that someone should start out with something lower level like sdl and opengl, and once they know whats happening and they just need to be productive, move onto an engine?


No. Knowing what is happening is overrated.

I mean I know there are programs like Game Maker where pretty much anyone can make a game with, so where does the abstraction stop?? Where does a programmer put him/her self and say "this is the level I want to be developing my games at, this is how much help I want from the API"?


A good programmer wants all the help they can get from APIs. The less code you write, the less time it takes, the less debugging you need to do, the less maintenance.

I mean, if programs like Game Maker exist, whats stopping anyone from making some awesome game with almost no programming experience? Im really not familiar with these sort of programs but the wiki for Game Maker says it allows someone to make a game with no programming experience. If thats the case, there must be limitations on these sort of engines and prgrams right??


Absolutely. Programs like these can never satisfy every scenario/requirement. Or satisfy them better than alternatives. Same with APIs. Sometimes the abstractions prevent you from doing cool tricks that are required to get what you want. But the approach isn't 'learn cool tricks, then use the API', it's 'use the API until you can't do what you need to do easily'.


#4806536 A few questions....

Posted by Telastyn on 04 May 2011 - 01:14 PM

1. Other than MSDN? I can't think of one. Online resources in my experience are vastly inferior to books, which are in turn vastly inferior to actual brick and mortar classes. Exceptions exist of course, but...

2. Code Complete and Design Patterns (Gamma et al) were very helpful to me, but require you get to a certain level of experience before you read them. Trying to use all of their advise without thinking or knowing how to incorporate it all practically can be detrimental. In the end, only practice will help you get the feel for program design. Design a program, see what works, what doesn't. Design another, see how/why you can't re-use code from the first program. Rinse and repeat, trying new approaches. Eventually you'll develop a feel for certain concepts/patterns, where to apply them, what to avoid... the art of program design.

3. Possibly, but if you've got experience with Java, then C# is probably your best bet.


#4804125 Class design to determine child 'instigator' at runtime

Posted by Telastyn on 28 April 2011 - 02:29 PM

Redesign it. If you're encoding data into a typename, you're invariably going to run into this. Being a grunt or being a squad leader isn't a type, it's an attribute.


#4802633 Computer Science, The Ivy League and The UK.

Posted by Telastyn on 25 April 2011 - 06:11 AM

I like to write stories and such, however my older sister does English Lit. and Oxford and I'm completely put off by the pretentious bullsh*t you are forced to spew.


Pretty much any university (or job for that matter) forces you to do things you don't want to do. Learning to deal with that is useful.

Anyway, to get to my point, when applying to a job in the gaming industry, (ideally I'd like to be an AI programmer) would skills in these sort of areas be something that would put me at an advantage or would they be completely superfluous,


All skills can be put to your advantage with the right spin in the right scenario. That said, AI developers don't particularly need a lot of grounding in arts and history. [edit: though the majority of other positions do benefit]

thus should I spend less time focusing on them and more on learning libraries like SDL?


No. Arts and history are universal; they'll benefit you throughout your ~40 year career. Particular libraries are things you should be able to pickup along the way, and will often be obsolete by the time you actually enter the workforce.


Sadly, it's been some time since I attended university, and I know very little about the UK system so cannot offer advice there.


#4802358 How many books do you have to read when you're a programmer?

Posted by Telastyn on 24 April 2011 - 11:55 AM

I think I found a good method of reading books now. Yes, I do think that writing code is better than reading the book, but then I hit a few contradictions:

1. If you start programming from the beginning, you need at least 1 book as a guide to learn.
2. After reading the fundementals from the first book, you need other books to fill in lessons and subjects outside of the curriculum of the first book.
3. For those who learned at least 2 programming languages, you need at least 1 book for each language.

In total, in your possession, you should have a few books, but I see most posts say they learn by writing. That still counts as if you have read a book.


Quit trying to make some sort of generalized rules for these things. I don't have a book for each language I've learned. I have a number of books that are reference guides, some that are good for their concepts, but not for their examples. EVERYONE learns by writing. Do you really think it takes me a few months to read a book? No, it takes a few days. It takes a few months of writing code to turn reading into knowledge.




PARTNERS