Closed zsparal closed 9 years ago
Hey, man! Thanks a lot! I'll be going through these quite soon and see what changes need to be made before tomorrow! Thanks for being so active in chat today, it was a lot of fun!
Yeah, unfortunately these changes are not terribly dramatic, the code is pretty good in this state (it can only be improved with drastic changes). I'll send a PR for that version too just to showcase it.
If you have the time, I am always willing to try to improve my coding ability and will mention / update my code on stream tomorrow; however, please don't spend too long on it! I don't want to waste you time.
Oh I have fun working on on small projects like this, and refactoring things doesn't take too much time. I don't actually expect you to merge the other PR, it will be way too drastic, but it might be good for educational purposes.
Well, as long as it isn't too demanding, that's fine. Again, I would love to look at it and figure out why it's more efficient, etc. Please note that tomorrow will come with some rather drastic changes anyway, so again... There is no pressure from me.
Thanks again for all the help! =)
Toeger's surpasses this, I didn't have time to do the example I was talking about (I ended up doing it in Rust).
This is a PR with very few fixes and some comments on best practices that I didn't necessarily want to do without asking. I'll post an other PR with an example of how I'd do some of this stuff.
You should probably consider stripping spaces at the end of lines for consistency (I have it set automatically in
.vimrc
, but you can probably do the same invi
.Comments:
PID
is very noticably out of place on any line it's onauto
much more (variable initializations). It makes your code more flexible in the long run: you can easily switch the return value of an initialization function and your code will continue to work, as long as the new return value provides the same interfaceclang++ -Weverything
will come up with more warnings. Some of them are simply annoying, but you can opt-out of them with-Wno-[error-name]