Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1107 Excellent

About Nitage

  • Rank
  1. Nitage

    Criticism of C++

      I couldn't disagree more with that line of argument. A very common weakness of GC'd languages is a lack of robust facilities for managing resources other than memory. In my opinion, RAII is the gold standard for resources management.
  2.   As a general principle: where the option exists to use functionality that's been written by domain experts and has been extensively tested in the real world, you should strongly prefer that over your own code.
  3. Nitage

    C++ dynamic_cast

      Am I missing something here? A pointer/reference to a derived class should implicitly convert to a pointer/reference to a base class, so a simple assignment should do and dynamic_cast isn't necessary.
  4.   You listed some requirements in your original post. The purpose of switching language is to satisfy those requirements, nothing more.   So the real question is why would you not switch to a language that meets your requirements only because that language offers other functionality that you don't intend on using?
  5. I like Ada's version, where the header contains only the interface. Not so much the C/C++ version where the decision of what goes into the header file isn't logical, but is instead a consequence of technical details regarding translation units.
  6.   I'm not going to say that you're crazy, but what you're doing is throwing out good solutions because they aren't perfect.   Almost everything you've asked for can be achieved by using C compiled as C++ with a few whitelisted C++ features. For example, your issue with member function pointers not being automatically tied to an object instance can be solved by using a template function that uses `std::bind` internally. You can then ban all other uses of template functions or std::bind, or any of the other C++ features you dislike. Basically, it seems you want C with a bit of extra syntactic sugar. You can get that from C++.   The same goes for Go, D and Rust - any one of them meets your basic requirements. It seems like you're just seeking out reasons not to use them rather than having genuine requirements that preclude their use.     If that's true - that this "flaw" kept you from even considering C++ - then you've made a mistake. Your statement that you "Cannot set a callback on a member function"and that it's "impossible in the base C++ language" is just false and you've thrown out a potential solution due to a misconception.
  7. Nitage

    D language enum question

    That's an anonymous enum with a single member which is an array of arrays of strings.   Its C++ equivalent is:   constexpr const char* logTypes[2][2] = {   {"red"       , "color"},   {"blue"       , "color2"}, };
  8. Nitage

    C++ compile times

    The dominating reason for slow times is the preprocessor, no question. The preprocessors #include directive can mean compiling a 100 line file requires processing several orders of magnitude more code, and #if... directives make it very hard to cache the results of processing a file. There are also other issues; C++ compilers do more than C# ones. Some parts of C# compilation are deferred until runtime (JIT) and the Microsoft C# compiler doesn't optimize nearly as aggressively as their C++ compiler or g++. For example, it doesn't ever perform tail call optimization (there's a IL 'tail' instruction which the F# compiler emits, but the C# one doesn't). This is minor in comparison to the preprocessor issue though.
  9. i = j * 5; … in C you know, at least, that j is being multiplied by five and the results stored in i. But if you see that same snippet of code in C++, you don’t know anything. Nothing.... [/quote] I've read the Joel article several times before and have never found it convincing. The alternative to operator overloading for 'j *5;' is 'multiply(j,5);'. Now, if you write a binary operator* that doesn't multiply you are an idiot, but no more of an idiot than if you'd written a function called 'multiply' that doesn't multiply.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!