Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

163 Neutral

About xeyedmary

  • Rank
  1. Saw the band with Paz in HMH 11/27/2016 and you all rocked. No regrets, keep rocking, PIX4EVR, period.
  2. IIch verstehe twitter als ein Konzept, aber es ist mir egal, was jeder von euch zu sagen hat.
  3. xeyedmary

    c++ or c# for 2d and 3d game creation?

    Its an annoying one but (due to Microsoft's marketing) most people tend to advise people to learn C# as their first language which pretty much shoves them straight into Unity and they never get to experience anything else.   I would say that Unity (The company) has spent many many more $ on marketing their product too than all other middleware companies combined.   And again, Microsoft has in the past spent much much more $ on marketing their product (C# & .NET) than C++ has ever had (which unlike .NET or Java obviously doesn't actually belong to any single company so has noone to market it).   So long story short. Unity and C# is a branding exercise towards "prosumers".   Bullshit. C++ is just a lot more complex than C#. Marketing has nothing to do with it.   C++ gives you: 5 different types of cast. 4 different types of object constructor (default, parameterised, copy, move) and a 5th way of invoking them (copy constructor via assignment ) 2 different types of built-in object reference, plus 3 types of standard library reference (plus one more that is deprecated). Also: pointers to references, references to pointers... a string type that needs C-style functions, pointer-style semantics, and isn't usable for anything except American English (char*) a string type that can only handle UTF-8 if you don't use most of its functionality (std::string) a system clock that doesn't understand UTC (std::chrono) the preprocessor system and the need to understand it for #includes, and how that ties into "compilation units" etc the erase-remove idiom, and other oddities of the 'algorithm-first' approach to containers the "most vexing parse" no garbage collection, but maybe some ref-counting if you used the right reference type Indeed. C++ is a mess. But I would point out a problem with your list: Strings are not a core language feature. If you want to count them in anyway there are wide strings on linux and UTF-16 on windows. So I'm a little confused why you would say "a string type that can only handle UTF-8" when that's patently false.   But yes, its a pretty complicated language. And C++17 is coming soon.
  4. xeyedmary

    Just Starting Out

    This is what I did, and continue to do to this day. Made a point list of every important concept in C++, going down in feature adoption (newest features last, roughly), and learned them. Made an effort to find and learn examples of that feature. After I "mastered" it, I re-worked the feature again. Just when you think you know something- you really don't. By no means exhaustive:   * Be darn sure you understand OOP principals (inheritance, polymorphism, encapsulation), especially how methods are inherited, which get called in a class hierarchy * Learn (no, master) every single example on this page preserved on archive.org: http://web.archive.org/web/20160309042615/http://patterns.pl/ * Master your tool chain of choice (really should be gcc, clang, visual studio(later version is better), icc, anything iso/ieee compliant) * Learn http://www.cplusplus.com/doc/tutorial/pointers/ * http://www.cplusplus.com/reference/stl/ * Make darn sure you understand completely the concepts here: http://eli.thegreenplace.net/2011/12/15/understanding-lvalues-and-rvalues-in-c-and-c For extra credit, read up on c++11's perfect forwarding template: https://www.justsoftwaresolutions.co.uk/cplusplus/rvalue_references_and_perfect_forwarding.html * http://www.cplusplus.com/doc/oldtutorial/templates/ * std::thread, std::mutex, and friends.   Just now trying to completely understand futures & promises (http://thispointer.com/c11-multithreading-part-8-stdfuture-stdpromise-and-returning-values-from-thread/)   And revisit old concepts. It never hurts to make sure you understand C++ concepts you think you've already mastered.   (my opinion. don't like it, just publish your own)
  5. xeyedmary

    Reentrant flag passing

    Yep. Since CMake 2.8.12 we need to add add_compile_options(-pthread) and done.
  6. Confining this to GNU C/C++ 5.4.0 for simplicity, I don't have access to llvm/clang or intel or msvc, not too sure it matters.   So I was given to believe that including pthreads (using cmake I'm linking via "set ( PROJECT_LINK_LIBS pthread )" in with a very simple test example, testing some thoughts on C++11 threads) defined the _REENTRANT macro after reading this and that on net. So, since seeing is believing I just spun up a simple test case: #ifdef _REENTRANT cout << "-------------------> reentrant " << endl; #endif in a POCO constructor, and added it to the code. To my jaded surprise the line didn't get printed out. As soon as I actually passed -D_REENTRANT to the compiler invocation it of course got printed. Anyone got the skinny on this behavior with 5.4.0? Did I "do it wrong"? Am I reading the spec (or, actually, the gcc list of expected behaviors) incorrectly?
  7. xeyedmary

    C++ without pointers

    Do not use malloc and free on C++ objects, as the constructors and destructors will not be called. Technically you can malloc the memory and then placement-new the object into the memory - assuming correct alignment - and then manually call the destructor before calling free - but why go to all that trouble when new and delete do it correctly with less typing? There are valid use cases for placement-new and manual destructor calls, but most people won't run into them in normal coding.   Don't be pedantic. I wasn't saying he should use malloc with classes.
  8. You only need one instantiation of a "character"? Is this a "lone wolf running around loose in a maze" type of scenario?   No matter. The answer to your question depends on what level of OOP purist you are. The easy answer is, sure, its fine. I'm not going to defend that, it all depends on how important basic tenets of OOP are to you and your application. For a very simple, one off, situation, like a test, I really don't have a big issue with them. They can even make some aspects of security in an application better.   The more difficult no, don't use a singleton, depends on how committed you are to adhering to OOP principals, which hopefully is strong. Singletons break basic OOP contracts by tightly coupling your data to your code, break the single responsibility principal, and can cause insidious inheritance issues that are hard to track down. If you have a need to manage the life cycle and state of a single object, sure use a singleton. But you'll develop a serious code smell if you find you're creating more than one. Its best to avoid the situation entirely by creating proper RAII'd & OOP'd objects rather than spending time on creating Singletons.   Singletons are an OOP form of Globals, and globals are bad for a variety of reasons in a true OOP design. Best avoided. But-   The language is a toolbox. Use a hammer to hit nails. Use a singleton for quickly trotting out a specific test case, or testing an aspect of your design. Use the information gained to design a proper OOP solution.
  9. This. Unless I'm targeting my code for windows (the need for which is becoming less and less as time flows on) using a Linux shell is pure joy. Even in powershell I'll forget what I'm on and try to write a quick perl line and *bam* pw doesn't know what I'm talking about. Remember: Linux was written by coders for coders (arguably), where as Windows was written by a corporation for people to consume, NOT MODIFY, at least to the extent that Microsoft wants.   Windows works, and well enough for what its meant to do, but its obvious that some things are an afterthought next to Linux. Powershell being an example. Every Linux has shipped with shells and the ability to automate simple tasks easily from waay back, with grep, wget, telnet, perl, awk, etc. Powershell came after Windows developers more and more discovered Linux shells...
  10. Are you guys running some home-brewed version of glibc? That's no blemish, that a space-station of an error, in my opinion.
  11. xeyedmary

    .data segment vs malloc/new

    Attempting to manage a full, contiguous, and large block of memory like this is doomed to failure, I'm by no means "the expert" but I have some practical experience in this area, having added UTF-8 capabilities to an existing windows application used  in computer forensics. The application ran outside of the pc's main file system (usually an hd, hhd, ssd, or mmc) on a usb stick, and cataloged, timestamped, and compressed all the file system objects it found on that file system into a secure file repository (so the usb file system it was running on had to be sufficiently large enough to hold this repository.) That means that this application had to be able to create files of arbitrary size.   A bit of a different scenario than attempting to manage an area of memory of arbitrary size. Or is it? The only way to manage such a large image of memory (static or in RAM) was to write a manager that segmented the data (or memory) and swapped in and out of the "view" the data under the "cursor" (I'm using a cursor metaphor for convenience, of course what I really mean is a logical view on the data.)   This allows for files, or data in memory, to be of any size and even allows lesser architectures (this product ran equally well on 32 bit or 64 bit windows  machines) and not be hit with the issues that come with attempting to manage huge, contiguous blocks of memory on them. The experience I gained from working on this particular app would lead me to believe that trying to do it any other way is doomed to at the least have defects.   Another possible approach is using a PC's GPU, which is more suited to processing large amounts of data, and very quickly, but I don't have any direct experience with using GPUs in the manner I've described.   So Good Luck!
  12.   There is no spoon.   Actually, if you want to pursue this to the extreme, what might have more value knowledge-wise is find a handy youtube video on building analog computers out of tinker toys, Lincoln logs, there's probably videos on how to create simple logic gates using light bulbs and switches, which I played with as a kid. Google Babbage's engine. Quantum computing is getting into reality, there's a cool topic.
  13. Actually, I was just looking at an Atmel microcontroller tonight based on the ARM Cortex-A5 architecture that has built in hardware-based encryption and a cryptographically secure random number generator. Hmmm....   Yeah, been playing with a LoPy my self, has the same plus a MicroPython interpreter, kinda fun actually.
  14. xeyedmary

    Variable Not Defined

    I love beating dead horses.   See the problem though? This is equivalent to: <...code...> std::string; <...code...>
  15. Periscope? No. Can't do it. I'm really scared its gonna be a bunch of gross old dudes masturbating.
  • Advertisement

Important Information

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

GameDev.net 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!