Re: Cracktro :)
Posted: October 24th, 2019, 7:16 pm
Hey albinopapa, thank you SO, SO much for going through my code and providing me with such valuable feedback. I will take my time to study your elaborate response in detail. I always felt it would be completely unreasonable to ask a more experienced programmer to go through my code and comment on my style or the lack thereof. Yet you did so without asking and for that I am most grateful. I've read it diagonally so far, and saw a lot of sound advice indeed.
As most people (?) I'm not really afraid of the logic behind the programming, but have a severe lack of patience when it comes to learning how to use the tools (C++, the debugger, image editing software maybe, etc) that are at our disposal. (Github is a particular pet peeve of mine, I hate it with a passion). This then bites me in the ass later on when I have to go through my own code again and understand none of it
I look at Chili's code examples and say to myself, now THAT is poetry. I don't understand it, but it looks beautiful
Now why can I not do that? Well, I'd say one of the issues with C++ is that it is compatible with C (more or less), and that I originally learned programming before Object orienting programming was a thing (talking Turbo Pascal 4.0 and Turbo Assembler here). I'm familiar with pointers and not afraid to use them, but I probably should Because once your program grows too large one of them is going to fail and well... good luck debugging that.
The thing is, there are SO many ways to do the same thing in C++, and it is very hard for an amateur (when googling / using stackoverflow) to understand what is right or not, what is old fashioned or not, best practices etc. I believe this to be a major disadvantage of C++. Endless possibilities are not always advantageous. Still, I love its power, so C++ it is and C++ it will stay.
Advanced concepts such as multi threaded programming, Windows Programming, Inheritance, meta programming, templates, the STL, safe pointers etc I know very little about if not nothing. I'm only starting to dare to use std::vector and std::string rather than an ordinary array. You see, I apprehend stuff I don't know the internals of, and am afraid it might slow down my program enormously, because I use the tools (STL) in the wrong way, unknowingly. This happened with the code my girlfriend wrote for her PhD thesis; I made it 1000% faster by removing a vector resize from the most inner loop. Which mattered a lot, because the program then still needed two weeks (!) to finish. Better have a stable energy supplier in such case, I tell ya because in case of a power outage, you loose up to two weeks worth of calculations.
Since Chili told me to use XAudio2 instead of the WAVE mapper I'm playing with that right now. So far I have succeeded in making it play a single wave file, after discovering that I need to put "CoInitializeEx( NULL,COINIT_MULTITHREADED );" in the beginning of the code. I barely understand what it does, but hey I have sound!
Now, onto https://docs.microsoft.com/en-us/window ... -from-disk
As most people (?) I'm not really afraid of the logic behind the programming, but have a severe lack of patience when it comes to learning how to use the tools (C++, the debugger, image editing software maybe, etc) that are at our disposal. (Github is a particular pet peeve of mine, I hate it with a passion). This then bites me in the ass later on when I have to go through my own code again and understand none of it
I look at Chili's code examples and say to myself, now THAT is poetry. I don't understand it, but it looks beautiful
Now why can I not do that? Well, I'd say one of the issues with C++ is that it is compatible with C (more or less), and that I originally learned programming before Object orienting programming was a thing (talking Turbo Pascal 4.0 and Turbo Assembler here). I'm familiar with pointers and not afraid to use them, but I probably should Because once your program grows too large one of them is going to fail and well... good luck debugging that.
The thing is, there are SO many ways to do the same thing in C++, and it is very hard for an amateur (when googling / using stackoverflow) to understand what is right or not, what is old fashioned or not, best practices etc. I believe this to be a major disadvantage of C++. Endless possibilities are not always advantageous. Still, I love its power, so C++ it is and C++ it will stay.
Advanced concepts such as multi threaded programming, Windows Programming, Inheritance, meta programming, templates, the STL, safe pointers etc I know very little about if not nothing. I'm only starting to dare to use std::vector and std::string rather than an ordinary array. You see, I apprehend stuff I don't know the internals of, and am afraid it might slow down my program enormously, because I use the tools (STL) in the wrong way, unknowingly. This happened with the code my girlfriend wrote for her PhD thesis; I made it 1000% faster by removing a vector resize from the most inner loop. Which mattered a lot, because the program then still needed two weeks (!) to finish. Better have a stable energy supplier in such case, I tell ya because in case of a power outage, you loose up to two weeks worth of calculations.
Since Chili told me to use XAudio2 instead of the WAVE mapper I'm playing with that right now. So far I have succeeded in making it play a single wave file, after discovering that I need to put "CoInitializeEx( NULL,COINIT_MULTITHREADED );" in the beginning of the code. I barely understand what it does, but hey I have sound!
Now, onto https://docs.microsoft.com/en-us/window ... -from-disk