Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

3778 Excellent

About Telastyn

  • Rank
  1. Telastyn

    Criticism of C++

    No, I'm talking about C++ in general, not unique_ptr. "Modern C++" is all well and good, but there is 15+ years of libraries and tutorials written for "not Modern C++" - and all that stuff still works.
  2. Telastyn

    Criticism of C++

      That, more than anything is the biggest criticism I have against C++. It is exceptionally easy to use it "incorrectly". 
  3.   It's blurry, since different people consider OOP different things. Generally though, Object Oriented Programming isn't programming, it is design.   When you go to break your problem into managable chunks, do you think "what parts make this up?" (OO), "what steps do I need to take?" (procedural), or "what operations make this up?" (functional).
  4. One other thing that should be mentioned is that OOP has changed quite a bit over its existence. Inheritance for example is generally seen as something to avoid these days. Mutable state in objects is generally seen as something to avoid these days.   Why? Because programmers used them and found out that in many cases they suck. Some programmers said "let's make this better". Some programmers said "screw it, I'm going back to my cave" and haven't seen the practical improvements made in OOP technique over the decades. If all people know of OO is old style inheritance heavy, side-effect heavy code - they are completely right that it is bad.   Likewise, many of the other commenters are correct that C++ is a pretty terrible language to make OO code in. Java is a pretty terrible language to make pragmatic OO code in. Universities were horrible at teaching OO throughout the 90's and early 00's (and are still largely terrible). If all you see is horrible OO code, it's not a terribly improper leap to assume that it is terrible, or it makes it too hard to write not-terrible code.   Another thing to consider is personal experience. Like others have mentioned, OO is a tool and like any tool is good at some things and bad at others. If my experiences tell me that most problems are these sort (that OO happens to solve well) or that these sorts of things cause me pain (which OO prevents) then I'm going to think OO is awesome. Some people's experience simply tells them that the verbosity of most OO languages provides no benefit, or the object focused approach yields inferior solutions for the sort of problems they commonly encounter.
  5. Enh, up I imagine the runtime modification would screw up your profiling more than simply including it always (in beta) and turning on logging when needed. When done judiciously, it won't substantially impact performance but still give you plenty of instrumentation to identify issues.
  6. You're better off using an aspect oriented programming framework like PostSharp to inject these things during a build step rather than at runtime. I'm not sure how viable ubiquitous runtime modification of a loaded assembly is.
  7. Telastyn

    Having trouble accessing an objects properties.

    The solution is to not need BladeWarrior's methods to fight. Generally that means making common methods available on character, making BladeWarrior an instance of Character (rather than a derivative of it), or by letting the thing that controls the fighting get a BladeWarrior rather than a Character array (though that one depends a lot more on how your game works).
  8. Telastyn

    Code Review - Event Use?

      But it has a single responsibility: to allocate power to a subsystem. It knows how to tie the various other single responsibilities together. Something has to do that after all.   It might be good to separate that responsibility from the power source, but I'm not sure the decoupling benefits (flexibility, testability) here are worth the downsides (more overhead, harder to implement/read/maintain).
  9. Telastyn

    Code Review - Event Use?

      Yes, that seems to be the obvious thing to do.     Just passing things around is the simplest, most straightforward way to code. It should be your default approach until you have some requirement (there may or may not be something passed in, there may be N things passed in at any given time, there may be things in weird plugins we don't know about).   I don't know your requirements but I would approach it like this: public interface Subsystem { bool IsPowered { get; } int MaxPower { get; } int PowerLevel { get; } } public interface PowerSource { int SuppliedPower { get; } IEnumerable<KeyValuePair<Subsystem, int>> PowerAllocation { get; } void AllocatePowerToSubsystem(Subsystem target); } If you can't simply allocate any subsystem to any power source, the Allocate method may need to be in a higher level "Ship" object. Either way, the entire logic for that operation lives in the one method devoted to doing it - not spread across 6 event handlers which provide no benefit.
  10. Telastyn

    Code Review - Event Use?

    Please, please stop using events for logic. They are fragile, a complete pain to debug, a mess for concurrency, and make reading your code way more difficult.
  11. Telastyn

    Am I read to start making games yet?

    I will disagree with some of my colleges here... The old "If you have to ask..." line of idioms comes to mind here. It is (or should be) pretty obvious as you're learning to program how you can apply this thing you learned into making a (ugly, incomplete, stupid, buggy) game. Just take X and make that HP, and take Y and make that some enemy and *poof* you have a game rather than a homework problem. ...if you can't see that, or somehow can't envision how a game would work - then you're not ready. You'll just flounder, or worse, copy-paste some code and have no idea how it works or how to adapt it to your problem. Just keep moving forward. It doesn't really matter where you are (or even where you're going) as long as you keep improving.
  12. Telastyn

    How to get motivated to learn Programming?

    I don't mean to more of a sourpuss than normal, but you don't need a mentor to learn to program, you need to learn how to learn; and learn how to work effectively. Eventually the mentor will leave or the engaging web tutorial will end. What then? You get to the part that is actually hard: slogging through years of unfun debugging and polish to make (statistically) a really bad, ugly game work. All the programming-fu in the world will not help you if you cannot develop the work ethic (or at least stubbornness) to put it to use. Hopefully this advice will help, even if I have no idea how to achieve it. For me, it took a whole lot of trial, error and introspection while failing my way out of college.
  13. Telastyn

    CS Degree - Is it worth it?

    Pssh. It's as good a reason as any. You're only 18-22 once, and if you're off being an adult you'll generally have a very hard time finding friends (and dating partners) around your age - they're all off at college. Learning who you are is a key part of college, and sexuality is an important aspect of adulthood. Beyond that, the social aspects of finding and maintaining relationships are important skills to grow so that you can be successful both professionally and personally. It's certainly not a key reason you should go to college, but seeing "I already know how to program" as the only aspect of improvement at school is absurdly shortsighted.
  14. Telastyn

    Stick with C++ or venture into C#?

    I personally have a lot less aggravation using C# than C++. Games are hard (and frustrating) enough that adding to that is unwise.
  15. Telastyn

    CS Degree - Is it worth it?

      Uninhibited coeds tend to have an inverse financial effect when compared to employment. I have lost somewhere around $25-30k *per year* over the past 15 years by making less than my degree'd peers. And that doesn't include the 15 months I spent unemployed because nobody would hire a non-degree'd computer programmer with no formal experience. Not getting a degree is absurdly more expensive than even today's universities.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!